—
LangChain vs LangGraph is a comparison that confuses many teams, because the two are not rivals: both are open-source projects from LangChain Inc., they share the same underlying pieces, and since LangChain 1.0, LangChain’s own agents run on LangGraph underneath. LangChain is the higher-level agent framework, offering model integrations, tools and a ready-made agent loop, while LangGraph is the lower-level orchestration runtime for building agents as explicit graphs with durable state. If you need a quick answer, start with LangChain when you want a working agent fast, and reach for LangGraph when the workflow needs explicit control over state, branching or human review.
The confusion is understandable. The names are similar, the documentation overlaps, and the two projects are often described together. But they answer different questions.
LangChain asks how to get a model, some tools and a prompt working together with the least effort. LangGraph asks how to make a long-running, stateful agent behave predictably when the work branches, loops or waits for a person. This article compares them fairly on architecture, state handling and use cases, so you can choose with confidence rather than by habit.
Key takeaways
- LangChain and LangGraph come from the same company, LangChain Inc., and are designed to work together, not to compete.
- LangChain provides the agent loop: a model, tools and a prompt, run by
create_agentsince version 1.0. - LangGraph provides the orchestration runtime: graphs of nodes and edges with checkpointed, durable state.
- LangChain agents are built on LangGraph underneath, so choosing LangChain does not mean avoiding LangGraph.
- Choose LangChain for speed and simplicity, and LangGraph for explicit control, long-running work and human review.
What each framework is
LangChain is a framework for building applications on top of large language models. It began as a Python library in October 2022, created by Harrison Chase, and it supplies the building blocks that most language-model applications need: model wrappers, prompt templates, retrievers, output parsers and tool handling.
Its agent support is the part most teams meet first. Since version 1.0, released in October 2025, the standard way to build an agent is create_agent: give it a model, a list of tools and a system prompt, and it runs the loop that reasons, calls tools and repeats until the task is done.
LangGraph is a library for building stateful, multi-actor applications with language models, first released in early 2024 and stable at version 1.0 in October 2025. It is lower level than LangChain: it does not prescribe prompts or an agent architecture, and it focuses on orchestration capabilities such as durable execution, streaming and human-in-the-loop support.
You define workflows as graphs of shared state, nodes and edges, and you can mix deterministic steps with model-driven steps in the same graph. It is built by LangChain Inc., the creators of LangChain, but it can be used without LangChain.
Architecture compared
The architectural difference is the shape of the work. A LangChain agent is a loop: the model decides what to do next at every turn, and the framework runs the tools it chooses.
That shape is simple to start with and flexible in practice, because the model can adapt to whatever it finds. But the shape is also invisible: the flow of work exists only in the model’s reasoning and in the trace afterwards, and there is no place to point to and say that this step always happens before that one.
A LangGraph agent is a graph: nodes do the work, edges control the flow, and a shared state carries information between steps. The shape is explicit and visible, which makes it testable step by step and auditable afterwards. A graph can loop, so an agent can draft, check and revise; it can branch, so a low-confidence result can go to a human while a confident one proceeds; and it can mix code and model calls, so a validation step uses plain code rather than an expensive model call.
Neither shape is better in general. The loop wins when the path genuinely depends on what the agent finds and cannot be drawn in advance.
The graph wins when the path can be drawn, because writing it down makes it reliable. A useful rule is that if you can draw the workflow on a whiteboard, you should probably build it as a graph, and if you cannot, the loop is the right shape. Our article on agent planning strategies covers how to decide which steps are worth planning in advance.
How the two fit together
In practice the two frameworks are used together more often than apart. A LangChain agent is already a LangGraph graph under the surface, since version 1.0 compiled the agent loop onto the LangGraph runtime.
That means a team can start with create_agent for speed, and move to an explicit graph when the agent needs a branch, a retry or a human checkpoint that the loop cannot express cleanly. The move is a change of structure, not a change of ecosystem: the same tools, models and prompts carry over.
State handling compared
State handling is where the difference is sharpest. In a LangChain agent, state is mainly the message history: the conversation so far, passed back to the model at each turn.
That is enough for a short task, and it is simple to reason about. But it is also fragile: if the process stops, the history is gone unless you have saved it yourself, and there is no built-in way to pause mid-task, inspect what the agent has done and resume from that point.
LangGraph handles state as a first-class concern. A checkpointer saves the graph’s state after every step, so execution can be paused and resumed at any point, and a run can recover from a failure instead of starting again.
State is a typed schema that every node reads from and writes to, which makes it explicit what information each step uses. Memory comes in two forms: short-term thread state for the working context of one task, and longer-term memory across sessions for facts and preferences that persist.

LangChain vs LangGraph: the full comparison
| Aspect | LangChain | LangGraph |
|---|---|---|
| What it is | Agent framework: models, tools and agent loops | Orchestration runtime: graphs, state and persistence |
| Main abstraction | The agent loop, via create_agent |
The graph: nodes, edges and shared state |
| Flow control | Model decides each step | Developer defines the graph explicitly |
| Cycles and branching | Limited, loop repeats the same shape | First-class, built into graphs |
| State handling | Message history, via LangGraph underneath | Checkpointing after every step |
| Human review | Added with middleware or LangGraph | Built-in pause, inspect and edit |
| Deterministic steps | Possible, but not the focus | Mix code and model nodes freely |
| Learning curve | Lower, fastest first agent | Higher, needs graph thinking |
| Best use | Single-agent tools and retrieval tasks | Long-running, branching workflows |
Both frameworks are open source under the MIT licence, both are maintained by LangChain Inc., and both work in Python and JavaScript. The choice is not about quality or maturity. It is about which shape fits the work, and about how much control you need over what happens between the model’s decisions.
Use cases: when to choose which
Best for LangChain: a first agent, a retrieval-based assistant, or a short tool-using task that finishes in one pass.
Choose LangChain when you want a working agent quickly, when the task is a short loop of reasoning and tool use, and when the flow does not need to branch or pause. Question answering over internal documents, triage and drafting, and internal tools that look up data and act on it are all natural fits. The framework’s broad integration catalogue means you can usually assemble a prototype in a day, and the LangSmith platform gives you tracing and evaluation for the runs that follow.
Best for LangGraph: long-running work, branching workflows, and any agent that must pause for a human or survive a failure.
Choose LangGraph when the workflow has branches that depend on results, when a step can fail and must be retried, when a human must approve something before the agent proceeds, or when a run can last long enough that a crash would be expensive. Research pipelines, multi-stage document work, approval chains and agents that coordinate several tools over time are the natural home for graphs. Our article on evaluating agents that take actions explains how to test both shapes before users rely on them.
Decision framework: LangChain vs LangGraph
Answer these questions in order. The first yes that fits your work points to the framework to start with.
- ☐ Does the task finish in one short pass, with one or two tools? Start with LangChain.
- ☐ Is the next step genuinely unpredictable until the agent sees the last result? Start with LangChain.
- ☐ Can you draw the workflow as steps, branches and retries on a whiteboard? Use LangGraph.
- ☐ Must the work pause for a human before a consequential action? Use LangGraph.
- ☐ Must a run survive a crash, a restart or a wait of hours or days? Use LangGraph.
- ☐ Do some steps need plain code, such as validation or database checks, rather than a model? Use LangGraph.
- ☐ Are you building a first prototype and learning how agents behave? Start with LangChain, and move to LangGraph when the loop hides decisions you need to see.
- ☐ Does the system need both open-ended reasoning and a fixed workflow? Use both: a LangChain agent inside a LangGraph node.
Common mistakes in the LangChain vs LangGraph choice
The most common mistake is treating the choice as a contest and picking a winner for all work. Teams that build everything as a LangChain loop end up with agents whose behaviour is hidden in prompts and hard to debug.
Teams that build everything as a LangGraph graph end up with elaborate structures for tasks that a simple loop would have handled in an afternoon. The frameworks are complementary, and the right question is which shape fits this task, not which framework is better.
Frequently asked questions
Is LangGraph part of LangChain?
LangGraph is a separate library from LangChain Inc., the company behind LangChain, and it can be used on its own. Since LangChain 1.0, LangChain agents run on LangGraph underneath, so the two are closely related, but LangGraph does not require LangChain and LangChain does not require you to learn LangGraph to use create_agent.
Should I learn LangChain or LangGraph first?
Learn LangChain first if you want a working agent quickly, because create_agent gives you a complete loop with a model, tools and a prompt. Learn LangGraph next, when you need explicit control over state, branching or human review. The official overview at docs.langchain.com gives the same guidance.
Can I use LangChain and LangGraph together?
Yes, and that is the expected pattern. A LangChain agent can sit inside a LangGraph node for a step that needs open-ended reasoning, while the graph handles fetching, checking, branching and saving. The two share tools, models and prompts, so combining them does not mean maintaining two separate systems.
Which is better for production agents?
It depends on the work. LangChain is better for production agents that are short, single-purpose loops with clear tool use. LangGraph is better for production agents that are long-running, branching or need human approval, because checkpointing, explicit flow and pause-and-resume support are built in rather than added on.
Do LangChain and LangGraph cost anything?
Both frameworks are free and open source under the MIT licence. You pay for the language models and services the agents call, and LangSmith, LangChain Inc.’s separate platform for tracing, evaluation and deployment, has its own pricing for paid tiers.
What about Deep Agents?
Deep Agents is a higher-level harness built on LangGraph, offering planning, subagents and file tools for complex tasks. If LangChain feels too simple and LangGraph feels too low level, Deep Agents is the middle layer worth evaluating, although it is a separate package with its own scope.







