LangGraph
A low-level, MIT-licensed library and runtime for building stateful agents as graphs, with checkpointing, human-in-the-loop interrupts and streaming.
LangGraph models an agent as an explicit state graph of nodes and edges, trading some abstraction for control. Its built-in persistence (checkpointing), human-in-the-loop interrupts, and streaming make it a common choice for production agents that need to be debuggable and resumable.
LangGraph is a low-level orchestration library for building agents as explicit state graphs: you define nodes (steps), edges (transitions), and a shared state object, and the agent's control flow becomes something you can see, test, and resume. It trades the one-line convenience of higher-level frameworks for control — which is exactly what production agents tend to need once they outgrow a demo.
It is aimed at engineers building durable, multi-step or multi-agent systems where you care about persistence, branching logic, and being able to pause for human input. Despite the name, LangGraph does not require the rest of LangChain.
The latest Python release is 1.2.24, published on November 20, 2026; the JavaScript package @langchain/langgraph is at 1.7.5. The repository has about 45,500 GitHub stars as of November 2026.
Highlights
- Graph-based control flow — model loops, branches, and multi-agent handoffs as explicit nodes and edges instead of opaque prompt chains.
- Persistence / checkpointing — save and restore agent state, so runs are resumable and crash-safe.
- Human-in-the-loop — interrupt the graph for approval or input, then resume from the exact point.
- Streaming — stream tokens and intermediate steps for responsive UIs and debugging.
- Memory — short-term state per thread through the checkpointer, and a separate store for longer-term memory across threads.
- Deployable — pairs with LangSmith Deployment (formerly LangGraph Platform) and its Agent Server runtime for hosted deployment, plus LangSmith for tracing.
In an AI-assisted workflow
pip install -U langgraph # JS/TS: npm install @langchain/langgraphA complete graph with a checkpoint and a human approval step:
from typing import TypedDict
from langgraph.checkpoint.memory import InMemorySaver
from langgraph.graph import END, START, StateGraph
from langgraph.types import Command, interrupt
class State(TypedDict):
draft: str
approved: bool
def write_draft(state: State):
return {"draft": "Refund order #1001 for $40"} # call your model here
def human_review(state: State):
approved = interrupt({"question": "Approve this action?", "draft": state["draft"]})
return {"approved": approved}
g = StateGraph(State)
g.add_node("write_draft", write_draft)
g.add_node("human_review", human_review)
g.add_edge(START, "write_draft")
g.add_edge("write_draft", "human_review")
g.add_edge("human_review", END)
app = g.compile(checkpointer=InMemorySaver()) # resumable, interruptible
config = {"configurable": {"thread_id": "order-1001"}}
result = app.invoke({"draft": "", "approved": False}, config)
print(result["__interrupt__"]) # paused, waiting for a person
final = app.invoke(Command(resume=True), config) # resumes from the checkpoint
print(final["approved"]) # TrueThe second invoke can run in a different process hours later, as long as the checkpointer is persistent and the thread_id matches.
TIP
Reach for LangGraph when you need control and durability (checkpoints, HITL, branching). For quick role-based multi-agent setups, a higher-level framework like CrewAI is faster to start — see the framework comparison.
Good to know
LangGraph is open source (MIT) and free to self-host; the optional LangSmith Deployment (hosted deployment; LangChain renamed it from LangGraph Platform in October 2025) and LangSmith (observability) are commercial. As of November 2026, LangSmith's pricing page includes one small serverless Agent Server on the Plus plan ($39 per seat per month) and bills additional servers by compute and memory usage.
It's lower-level than role-based frameworks, so expect to write more wiring in exchange for more control. Things that catch teams out:
InMemorySaveris for demos. It keeps checkpoints in RAM and loses them on restart. UsePostgresSaverin production (SqliteSaverfor local development), and plan to prune old checkpoints.- Interrupts need a checkpointer and a
thread_id. Without both there is nothing to resume from. On resume the node restarts from its beginning, not from theinterrupt()line, so keep code before the call free of side effects or make it idempotent. On resume the node restarts from its beginning, not from theinterrupt()line, so keep code before the call free of side effects or make it idempotent. - The prebuilt agent moved.
create_react_agentin LangGraph is deprecated; the maintained high-level loop iscreate_agentin LangChain, which runs on LangGraph. - It prescribes nothing about prompts or agent design. That is the point, but it means you bring your own model calls, tools and architecture.
Among alternatives, CrewAI trades this control for role-based crews you can stand up quickly (LangGraph vs CrewAI). The OpenAI Agents SDK is a smaller handoff-based loop (comparison), and the Claude Agent SDK ships a finished coding-agent harness in place of graph primitives.
Frequently asked questions
- What is LangGraph?
- LangGraph is a low-level orchestration library for building agents as explicit state graphs: you define nodes (steps), edges (transitions), and a shared state object, so the agent's control flow becomes something you can see, test, and resume. Built-in checkpointing, human-in-the-loop interrupts, and streaming make runs durable and debuggable. Despite the name, it does not require the rest of LangChain.
- Is LangGraph free?
- Yes. LangGraph is open source under MIT and free to self-host, including its checkpointers. Hosting is the paid part: LangSmith Deployment (renamed from LangGraph Platform in October 2025) runs graphs on managed Agent Servers. As of November 2026, LangSmith's pricing page lists Plus at $39 per seat per month with one small serverless Agent Server included and further servers billed by resource usage; the free Developer plan does not include Agent Server.
- LangGraph vs CrewAI?
- LangGraph trades one-line convenience for control: explicit graphs, persistence, and human-in-the-loop, which production agents tend to need once they outgrow a demo. For quick role-based multi-agent setups, a higher-level framework like CrewAI is faster to start.
- Do I need LangChain to use LangGraph?
- No. LangGraph's docs say it does not require LangChain; nodes are plain Python functions and you can call any model SDK inside them. The dependency runs the other way: LangChain's create_agent is built on LangGraph, and LangGraph's own create_react_agent prebuilt was deprecated in favor of it.
- Where does LangGraph store checkpoints?
- In whatever checkpointer you compile the graph with. InMemorySaver keeps state in RAM and loses it on restart, SqliteSaver writes a local file for development, and PostgresSaver is the production option with async support. Each run is keyed by a thread_id in the config, and with PostgresSaver that ID must stay under 255 characters.
Filed under
agents · framework · orchestration · open-source · python
Related
- ToolCrewAIAn MIT-licensed Python framework that runs role-based AI agents as crews and wires them into event-driven Flows, with a hosted enterprise platform, CrewAI AMP.
- ToolOpenAI Agents SDKOpenAI's MIT-licensed agent framework for Python and TypeScript: agents, handoffs, guardrails, sessions, sandbox and voice agents, with built-in tracing.
- ToolAutoGen (AG2)Microsoft's multi-agent conversation framework, now archived in favour of Microsoft Agent Framework. AG2 is the community fork that is still developed.
- GuideWhich Agent Framework in 2026? LangGraph vs CrewAI vs AutoGen vs OpenAI Agents SDK vs Claude Agent SDK vs Pydantic AIA decision guide to the major AI agent frameworks — control vs. abstraction, multi-agent models, state and durability, and which fits your project.
- GuideAgent Memory Architecture: Short-Term, Long-Term, and When to Use EachHow AI agents remember: working vs long-term memory, a record schema, an extraction prompt, scoped retrieval, and Mem0, Zep, Letta and LangGraph compared.
- AgentAgent Tool Integration EngineerUse this agent to wire tools and function-calling into an agent loop reliably — clean tool schemas, errors fed back as observations, retries with limits, idempotency, and parallel calls. Examples — "connect our APIs as agent tools", "our agent calls tools wrong / ignores tool errors", "add function-calling with proper error recovery to our agent".
- GuideBest Durable Execution Engines for AI Agents in 2026: Temporal vs Restate vs DBOS vs InngestTemporal, Restate, DBOS, Inngest, Trigger.dev, Cloudflare Workflows, and Hatchet compared on LLM memoization, HITL sleep, replay, and self-hosting.
- ToolMem0A memory layer for AI agents and apps — persistent, personalized long-term memory across sessions.