Frameworks

LangChain vs LangGraph

By Matt Doughty, CEO & Co-Founder of Prefactor ·

TL;DR

LangChain is the broad toolkit — integrations, chains, and components for building LLM applications. LangGraph, from the same team, is the narrower engine for stateful agents: workflows modelled as graphs with explicit state, persistence, and human-approval stops. The confusion is natural because they share an ecosystem; the choice is about how much control your agent's loop needs.

DimensionLangChainLangGraph
What it isComponent toolkit and integration layerAgent runtime modelled as a graph
Mental modelChains: composed steps, largely linearNodes and edges with explicit shared state
Control over the loopAbstractions decide much of the flowYou draw the flow — branches, cycles, retries
State and persistenceBolt-on per componentFirst-class: checkpoints, resumable runs
Human-in-the-loopPossible, hand-rolledNative interrupt points in the graph
Sweet spotIntegrations, prototypes, straightforward pipelinesProduction agents with audits, approvals, long runs

The verdict

Treat them as layers rather than rivals — LangGraph is built by the LangChain team and uses its integrations, so the real question is which layer owns your control flow. Prototype freely with LangChain components; the moment your agent needs to pause for approval, survive a restart mid-task, branch on intermediate results, or show an auditor exactly what path a run took, you are describing a graph with state, and fighting chain abstractions to fake one costs more than adopting LangGraph. Teams shipping consequential agents increasingly start in LangGraph for the loop and pull in LangChain components as parts — and either way, the readiness work around the framework — [identity, gates, evaluation](/guides/build-an-agentic-ai-system) — is unchanged, because the framework is the most replaceable layer in the system.

Frequently asked questions

Do I have to choose between LangChain and LangGraph?

No — LangGraph workflows routinely use LangChain integrations as their tools and model wrappers. Choose where the loop lives; reuse components from either side of that line.

Is your organisation ready for AI agents?

Take the assessment →