LangGraph
TL;DR
LangGraph is an MIT-licensed Python library from LangChain Inc. for building stateful agents as graphs of nodes and edges over shared state. It adds checkpointing, interrupts for human review, and long-term stores. It suits Python developers who want explicit control over multi-step and multi-agent flows rather than a prebuilt agent loop.
Key facts
| Type | Framework |
|---|---|
| Languages / SDKs | Python |
| License | MIT |
| Pricing model | Open core |
| Orchestration pattern | Graph |
| GitHub stars | 42,532 (as of 2026-10-01) |
| GitHub forks | 7,208 |
| Last push | 2026-10-01 |
| Latest release | cli==0.4.32.dev0 |
| Repository | langchain-ai/langgraph |
| Website | www.langchain.com |
| Documentation | docs.langchain.com |
| Last verified | 2026-09-30 |
Key features
- Graph API: a typed
StateGraphwith nodes, fixed or conditional edges, and per-key reducers that merge state updates. (source) - Functional API (
@entrypoint,@task) that brings persistence, interrupts and streaming to code written with normal loops and conditionals. (source) - Checkpointers that snapshot a thread's state at every step, used for resumption, fault tolerance and conversation memory. (source)
interrupt()pauses a run anywhere inside a node and waits for aCommand(resume=...)from the caller. (source)- Time travel: replay from an earlier checkpoint or fork from it with modified state. (source)
- Stores for long-term memory shared across threads, separate from per-thread checkpoints. (source)
- Subgraphs: a compiled graph can be used as a node in another graph, the basis for multi-agent setups. (source)
- Streaming through stream modes such as
updates,values,messagesandcustom, plus a typed event-streaming API added in v1.2. (source)
Architecture and orchestration pattern
Pattern: Graph
A LangGraph program is a StateGraph: a typed state schema, nodes (plain functions) that return partial state updates, and edges, fixed or conditional, that pick the next node. Each state key has a reducer that decides how updates are merged. The runtime follows a Pregel-style model of discrete super-steps, so nodes on parallel branches execute in the same step. A decorator-based Functional API exposes the same runtime for code that uses ordinary control flow.
There is no built-in agent-role abstraction. Multi-agent systems are assembled by composing graphs: a compiled graph can run as a node of a parent graph, and LangChain's multi-agent guides (subagents, handoffs, routers) are built on this runtime. The developer owns the topology.
Persistence has two layers. Checkpointers save a thread's state after each step, keyed by thread_id; this is what makes resumption, replay and forking possible. Stores keep application data across threads for long-term memory. In-memory implementations are meant for development, and the docs recommend database-backed ones in production.
Human in the loop
Any node can call interrupt(value). The run pauses, the checkpointer saves state, and the value is returned to the caller. The caller resumes by invoking the graph again on the same thread_id with Command(resume=...), and that value becomes the return value of interrupt(). The docs show approve or reject gates, review-and-edit of LLM output or tool calls, and input validation loops. A checkpointer and a thread ID are required. On resume the interrupted node starts again from its first line, so side effects placed before the interrupt should be idempotent. Earlier checkpoints can also be replayed or forked with edited state.
Protocols
| Protocol | Support | Note |
|---|---|---|
| MCP | Yes evidence | Server side: Agent Server (the runtime behind langgraph dev and LangSmith deployments, langgraph-api >= 0.2.3) exposes LangGraph agents as MCP tools at /mcp over Streamable HTTP. |
| A2A | Yes evidence | Server side: Agent Server serves each assistant at /a2a/{assistant_id} using the A2A v1.0 JSON-RPC binding (v0.3 method names accepted); task subscription and push notifications are listed as not yet supported. |
| AG-UI | Partial evidence | LangChain docs show serving a LangGraph graph over AG-UI through CopilotKit's copilotkit and ag-ui-langgraph packages mounted as a FastAPI bridge; AG-UI is not built into LangGraph, and the AG-UI README lists LangChain under partnerships. |
Best for
- Agents that must pause for a human decision and resume later from saved state (shortlist)
- Custom research or retrieval agents where each step and branch is defined explicitly (shortlist)
- Running agent logic in your own Python process with an MIT-licensed library (shortlist)
- Long-running workflows that need to recover from failures at the last checkpoint
Not for
- Getting a basic tool-calling agent running with minimal code; the docs point to LangChain's prebuilt agents for that
- TypeScript or JavaScript projects, which need the separate LangGraph.js package
- Teams that want role and task abstractions supplied by the framework
Quickstart
pip install -U langgraph from typing import TypedDict
from langgraph.graph import StateGraph, START, END
from langgraph.checkpoint.memory import InMemorySaver
from langgraph.types import interrupt, Command
class State(TypedDict):
draft: str
approved: bool
def write(state: State):
return {"draft": "Refund order 123"}
def review(state: State):
return {"approved": interrupt({"please_check": state["draft"]})}
g = StateGraph(State).add_node(write).add_node(review)
g = g.add_edge(START, "write").add_edge("write", "review").add_edge("review", END)
graph = g.compile(checkpointer=InMemorySaver())
cfg = {"configurable": {"thread_id": "t1"}}
graph.invoke({"draft": "", "approved": False}, cfg) # stops inside review
print(graph.invoke(Command(resume=True), cfg)) # resumes; approved=True
Common pitfalls
- The package requires Python 3.10 or newer (
requires-pythoninlibs/langgraph/pyproject.toml). - Model providers are separate packages; the official quickstart uses an Anthropic model and expects
ANTHROPIC_API_KEY. interrupt()only works when the graph is compiled with a checkpointer and invoked with athread_idin the config.- On resume the interrupted node re-runs from the top; keep side effects after the
interrupt()call or make them idempotent. - LangGraph v1 deprecated the prebuilt
create_react_agent; new code should use LangChain'screate_agent.
Pros
- Checkpointing at every step lets runs resume after failures or pauses without extra plumbing. (source)
- Interrupts can sit anywhere in node code and cover approve, reject and edit flows. (source)
- The v1 release kept graph primitives and the execution model unchanged, which keeps upgrades small. (source)
- Works on its own; the README states it can be used without LangChain. (source)
- Graphs served by Agent Server can be called by other agents over A2A at
/a2a/{assistant_id}. (source)
Cons
- Deliberately low-level; the overview recommends LangChain's prebuilt agents to anyone who wants a quicker start. (source)
- The
langgraph-supervisoradd-on is no longer actively maintained; the docs ask users to migrate to a tool-wrapped subagents pattern. (source) create_react_agentis deprecated in v1 in favor of LangChain'screate_agent, so older examples need changes. (source)- Resuming an interrupt re-executes the node from its beginning, which can duplicate non-idempotent side effects. (source)
- Managed deployment is part of LangSmith; the pricing page lists Deployment access from the paid Plus plan upward. (source)
Alternatives
FAQ
Does LangGraph support MCP?
Yes, on the serving side. Agent Server, which runs LangGraph graphs locally via langgraph dev or in LangSmith deployments, exposes agents as MCP tools at /mcp over Streamable HTTP.
Is LangGraph free?
The library is MIT-licensed. LangChain Inc. sells LangSmith plans, and the pricing page lists deployment access starting with the paid Plus plan.
What language is LangGraph?
This repository is the Python library and needs Python 3.10 or newer. JavaScript and TypeScript users have a separate LangGraph.js project.
How is LangGraph different from LangChain?
LangChain supplies model and tool integrations plus a prebuilt create_agent loop that runs on LangGraph. LangGraph is the lower-level runtime for custom graphs with checkpoints and interrupts.
Sources
- LangGraph GitHub repository
- LangGraph overview (docs)
- LangGraph README
- Install LangGraph (docs)
- Graph API overview (docs)
- Functional API overview (docs)
- Persistence (docs)
- Interrupts (docs)
- Use time-travel (docs)
- Stores (docs)
- Subgraphs (docs)
- Streaming (docs)
- What's new in LangGraph v1
- Migrate from langgraph-supervisor
- MCP endpoint in Agent Server
- A2A endpoint in Agent Server
- CopilotKit integration (LangChain docs, AG-UI bridge)
- AG-UI README, supported integrations
- LangChain / LangSmith pricing
- langgraph pyproject.toml
- LangGraph product page