# LangChain vs LangGraph

URL: https://aiseason.tech/langchain-vs-langgraph

LangChain gives you the building blocks of an LLM app — models, prompts, retrievers, tools and hundreds of integrations. LangGraph gives you control over how an agent runs — state, branching, loops, retries and human approval. They are made by the same team, work together, and most real agent projects use both. New to LangChain? Start with the hands-on [LangChain tutorial for beginners](https://aiseason.tech/langchain-tutorial).

| Fact | Value |
| --- | --- |
| LangChain is | A toolbox of components and integrations for building LLM applications |
| LangGraph is | A framework for running agents and workflows as graphs with shared state |
| Use LangChain for | Model interfaces, prompt templates, document loaders, splitters, retrievers, tool wrappers |
| Use LangGraph for | Multi-step agents, branching, loops, retries, persistence, human-in-the-loop |
| Relationship | Complementary — LangChain's agents run on LangGraph underneath |
| Learn first | The raw LLM API, then LangChain components, then LangGraph |

### The one-line difference

**LangChain answers "what are the pieces?"** — a common interface to models from many providers, prompts, output parsers, loaders and retrievers. **LangGraph answers "how does the agent run?"** — which step comes next, what state is carried between steps, when to loop back, when to stop and when to wait for a human.

### What LangChain is good at

- **One interface to many models** — switch between providers without rewriting your app.
- **Prompt templates and output parsers** — reusable prompts and structured results you can use in code.
- **Document loaders and text splitters** — PDFs, web pages, spreadsheets and more, chunked for retrieval.
- **Retrievers and vector-store integrations** — the plumbing for [RAG](https://aiseason.tech/rag-ai-agents).
- **Tools** — wrap any Python function so a model can call it.
- **Chains with LCEL** — compose steps with the pipe syntax: prompt, model, parser.

It shines when you want to move fast and lean on existing integrations. The trade-off is abstraction: if you haven't used the raw API first, it can be hard to see what is actually happening.

### What LangGraph is good at

LangGraph models an agent as a **graph**. Each **node** is a step — call the model, run a tool, validate an answer. **Edges** decide what runs next, including conditional edges that branch on the result. A typed **state** object flows through the graph, so every step can read and update what has happened so far.

- **Loops and branching** — the agent can retry, take a different path, or go back to the model after a tool call.
- **Persistence** — checkpoints save the state, so a run can pause and resume later or survive a crash.
- **Human-in-the-loop** — stop before a risky step, wait for approval, then continue.
- **Streaming** — send progress and tokens to your UI as the agent works.
- **Multi-agent designs** — supervisors and specialist sub-agents as parts of one graph.

### Side by side

|  | LangChain | LangGraph |
| --- | --- | --- |
| Main job | Components and integrations | Orchestration and control flow |
| Mental model | Building blocks you compose | A graph of steps with shared state |
| Best for | RAG pipelines, simple chains, quick prototypes | Agents with loops, branches, retries, approval |
| State between steps | Mostly what you pass along | Explicit, typed and persistable |
| Human approval | You build it yourself | Built in (interrupts) |
| Learning curve | Gentle to start | Steeper first week, clearer later |

### When to use which

- **A chatbot over your documents** — LangChain components for loading, splitting and retrieval are enough.
- **An agent that calls a couple of tools once or twice** — LangChain's agent helper (which runs on LangGraph) or a hand-written loop.
- **An agent that must plan, retry, branch or wait for approval** — LangGraph.
- **Several agents handing work to each other** — LangGraph, or see the [framework comparison](https://aiseason.tech/ai-agent-frameworks) for alternatives such as CrewAI.

> In practice, most production agent codebases use LangChain components (models, retrievers, tools) inside a LangGraph graph.

### The order to learn them

1. Call an LLM API directly and build one agent loop by hand — our [Python tutorial](https://aiseason.tech/how-to-build-an-ai-agent) takes about an hour.
2. Learn LangChain's core pieces: chat models, prompt templates, structured output, tools and retrievers — see the [LangChain tutorial](https://aiseason.tech/langchain-tutorial).
3. Rebuild your agent in LangGraph: define the state, add the model and tool nodes, connect them with conditional edges — the [LangGraph tutorial](https://aiseason.tech/langgraph-tutorial) walks through it.
4. Add persistence and a human-approval step, then deploy.

Framework APIs change quickly; always check the current documentation. The concepts — components, state, graphs, checkpoints — stay the same.

### How AI Season teaches LangChain and LangGraph

In the [AI Season curriculum](https://aiseason.tech/curriculum), students first build agents from raw API calls, then use LangChain for structure and LangGraph for stateful workflows with branching and retries — and later deploy, guard and connect those agents through MCP. Explanations are in Urdu, code in English. Cohort 02 starts 1st January 2027.

### Frequently asked questions

**Is LangGraph replacing LangChain?**
No. They do different jobs and are designed to work together: LangChain provides components and integrations, LangGraph runs stateful agents. LangChain's own agents are built on LangGraph.

**Should I learn LangChain or LangGraph first?**
Learn the raw LLM API first, then LangChain's basic components, then LangGraph. Starting with LangGraph is fine if you already understand tool calling.

**Can I use LangGraph without LangChain?**
Yes. LangGraph nodes can call any code, including provider SDKs directly. Many teams still use LangChain's model and retriever interfaces for convenience.

**Is LangChain good for production?**
Yes, when you understand what its abstractions do. For agents that need reliability and control, pair it with LangGraph's state, checkpoints and human-in-the-loop features.

**Are LangChain and LangGraph free?**
Both are open-source libraries and free to use. You pay only for the model APIs and infrastructure you choose.

---

_Last updated: 2026-11-16. Canonical page: https://aiseason.tech/langchain-vs-langgraph. Source: AI Season (https://aiseason.tech/)._
