Low-level orchestration for stateful, long-running LLM agents. LangGraph models your agent as a graph of nodes and edges with explicit state, durable checkpoints, and first-class human-in-the-loop.
Install
pip install langgraph langchain-anthropic
Version
v1.2.11 · August 2026 · Python 3.10 – 3.14
Best for
Cycles, conditional routing, multi-agent coordination, HITL workflows.
A chaptered tutorial that takes you from a first graph to a production-ready agent. Each chapter has its own page with Next → pagination.
4 · Tools ToolNode, custom executors, conditional tool use · 20 min 8 · Middleware pre_model_hook, post_model_hook, RetryPolicy, TimeoutPolicy, error_handler, ToolNode(handle_tool_errors) · 25 min 9 · Advanced patterns ReAct, Tree-of-Thoughts, reflection, structured output, caching, Functional API · 25 min
Looking for a reference?
The Zero → Hero chapters are task-oriented tutorials. If you already know the
shape of LangGraph and want exact signatures, feature tables, and breaking-change
history for a single primitive, jump to the Reference section near the bottom
of this page — one page per API (StateGraph, Checkpointers, Store, Functional
API, Command/Send, streaming modes). Each is verified line-by-line against the
installed langgraph==1.2.11 source.
Need one specific concept? Land directly on the chapter that owns it.
The API reference pages below are introspected against the installed langgraph==1.2.11 /
langgraph-checkpoint==4.2.0 / langgraph-checkpoint-sqlite==3.0.3 /
langgraph-checkpoint-postgres==3.0.5 source. If a signature disagrees with an
older blog post or docs page, the source wins.
StateGraph API reference Constructor, add_node (all 4 overloads), add_edge, add_conditional_edges, add_sequence, compile, Runtime, RetryPolicy, CachePolicy, TimeoutPolicy, RunControl, ExecutionInfo. Checkpointers reference Feature matrix for InMemorySaver, Sqlite, AsyncSqlite, Postgres, AsyncPostgres, ShallowPostgres — plus durability modes and connection strings. Functional API reference @entrypoint, @task, entrypoint.final, previous, injecting Runtime, feature matrix vs StateGraph. Command / Send reference Command(update, goto, resume, graph), Send for fan-out, interrupt + resume, Command.PARENT, Overwrite. Streaming modes reference All eight stream_mode values (including tools + ToolCallTransformer), v1 vs v2 typing, StreamPart discriminated union, GraphOutput, subgraphs=True. Prebuilt nodes reference ToolNode (all constructor params, wrap_tool_call, handle_tool_errors), InjectedState, InjectedStore, ToolRuntime, ToolCallRequest, tools_condition, ToolCallTransformer, ToolCallStream. Channels reference LastValue, BinaryOperatorAggregate, Topic, EphemeralValue, NamedBarrierValue, AnyValue — concurrent-write semantics, Annotated[] shorthands, fan-in patterns. Managed values reference IsLastStep and RemainingSteps — read-only state fields injected by the Pregel executor for recursion-limit detection and graceful truncation. RemoteGraph reference Call a LangGraph Platform deployment as a local graph — same invoke/stream/get_state surface, interrupt/resume, and subgraph node wiring. Graceful shutdown reference RunControl, request_drain(), GraphDrained — cooperative superstep-boundary draining for SIGTERM, pre-stop hooks, and timeout-with-checkpoint patterns. TracePolicy reference Per-node LangSmith tracing control — process_inputs, process_outputs, omit_payload; selectively redact, truncate, or silence individual node spans. Cache backends reference BaseCache abstract interface and InMemoryCache thread-safe implementation — TTL eviction, custom Redis backends, CachePolicy wiring, and serializer protocol.
Recipes RAG, support routing, research agent, doc pipelines, long-term memory conversations. Diagrams 20+ Mermaid architecture diagrams.
Verified against installed library
Introspected against langgraph==1.2.11, langgraph-checkpoint==4.2.0,
langgraph-prebuilt==1.1.0, langgraph-checkpoint-sqlite==3.0.3,
langgraph-checkpoint-postgres==3.0.5 in August 2026. The full class/API
surface — every symbol below and many more — is consolidated in the
Class & API Reference
section of the single-page guide.
Known corrections vs older drafts / third-party guides:
langgraph.llm_hooks and langgraph.cache.cache_node do not exist .
The real middleware API is pre_model_hook/post_model_hook kwargs on
langgraph.prebuilt.create_react_agent; see Chapter 8 .
langchain.agents.create_agent(middleware=[...]) and AgentMiddleware exist in
the separate langchain package (install with pip install langchain), which
is not bundled with langgraph. create_react_agent is deprecated per
official LangGraph v1 migration docs in favour of langchain.agents.create_agent.
AgentState / AgentStatePydantic are deprecated in langgraph.prebuilt (no
longer re-exported from the top-level __init__; still importable from
langgraph.prebuilt.chat_agent_executor). Deprecation notice targets langchain.agents
as migration (requires the langchain package).
SqliteSaver.from_conn_string(...) and PostgresSaver.from_conn_string(...)
are context managers (with ... as saver:), not factories that return
a saver directly. Some earlier examples omitted the with; see the
Checkpointers reference .
Interrupt.ns, Interrupt.when, Interrupt.resumable were removed in v0.6;
only Interrupt.value and Interrupt.id remain.
checkpoint_during=False on invoke/stream is deprecated — use
durability="exit" (or "sync" / "async").
ShallowPostgresSaver is deprecated as of langgraph-checkpoint-postgres
2.0.20. Use PostgresSaver + durability="exit".
from langgraph.graph import StateGraph, START , END
from langgraph.checkpoint.memory import InMemorySaver
from typing_extensions import TypedDict
def process ( state : State ) -> dict :
return { " response " : f "Processed: { state[ ' message ' ] } " }
builder = StateGraph ( State )
builder. add_node ( " process " , process )
builder. add_edge ( START , " process " )
builder. add_edge ( " process " , END )
graph = builder. compile ( checkpointer = InMemorySaver ())
config = { " configurable " : { " thread_id " : " user-1 " }} ,
Ready for the full walk-through? Start Chapter 1 →
Full per-volume history now lives in git — this table covers meaningfully
distinct versions only, oldest to newest.
Date Version Changes 2025-11 1.0.3 Initial guide: node caching, deferred nodes, pre/post model hooks, cross-thread memory, Python 3.13 support. 2026-04-16 1.1.6 Python 3.9 dropped; type-safe v2 streaming/invoke API; Pydantic/dataclass coercion; Python 3.14 support; time-travel fixes. 2026-04-21 1.1.8 Index redesigned into Zero → Hero chaptered tutorial + Jump-to-topic grid. 2026-04-22 1.1.9 Added six source-verified reference pages (StateGraph, Checkpointers, Store, Functional API, Command/Send, Streaming modes); corrected stale guidance (create_react_agent deprecation, from_conn_string context managers, ShallowPostgresSaver deprecation). 2026-05-12 1.2.0 ToolRuntime and ToolCallTransformer added to langgraph.prebuilt.2026-05-22 1.2.1 Patch release; all core symbols re-verified. 2026-06-15 1.2.5 v3 streaming protocol (beta) documented: GraphRunStream, SubgraphRunStream, native transformers. 2026-06-23 1.2.6 Deprecation of AgentState/AgentStatePydantic/ValidationNode in favor of langchain.agents; LangGraphDeprecatedSinceV11 added. 2026-07-01 1.2.7 TracePolicy, add_node(defer=True), graph visualization/schema-introspection APIs (get_graph(xray=), as_tool(), get_context_jsonschema()) documented.2026-07-09 1.2.8 Encrypted checkpoint serde (EncryptedSerializer), serde audit hooks documented. 2026-07-20 1.2.9 RunControl/cooperative draining, RemainingSteps, ToolRuntime execution metadata, TimeoutPolicy refinements.2026-08-01 1.2.10 Patch release; all core symbols re-verified against the installed source. 2026-08-17 1.2.11 Consolidated the 46 “class deep dive” volumes into one source-verified Class & API Reference section on the single-page guide; removed the per-volume pages and changelog entries (full history remains in git); refreshed all version callouts to langgraph==1.2.11.