Learn LangGraph

Low-level library for stateful, durable agents and workflows as graphs

25 lessons · 5 hours · 4 levels · covers LangGraph 1.2.x (langgraph 1.2, langgraph-checkpoint 4.x, as of Oct 2026)

LangGraph is LangChain's low-level orchestration library and runtime for building long-running, stateful agents and workflows in Python. You describe your application as a graph of steps that share state, and LangGraph adds persistence, streaming, human-in-the-loop pauses, memory and durable execution. Learn it when a simple agent loop is not enough and you need control, reliability and production deployment.

Before you start

LangGraph builds on these; the tree links to the exact lessons you need.

How deep do you want to go?

1. EssentialsRead and write simple code, do the everyday basics8 lessons · 1 hour in total
2. PracticalUse it productively at work, with the usual idioms16 lessons · 3 hours in total
3. AdvancedThe less common features, performance and trade-offs22 lessons · 4 hours in total
4. ExpertInternals and the edge cases experts know25 lessons · 5 hours in total

The LangGraph tree

LangGraphWhy graphs for agentsWhy graphs foragentsState and StateGraphState and StateGraphNodes and edgesNodes and edgesCompiling and running a graphCompiling andrunning a graphReducers: how updates mergeReducers: howupdates mergeConditional edges and routingConditional edgesand routingMessagesState and chat historyMessagesState andchat historyCalling a model inside a nodeCalling a modelinside a nodeA hand-built tool-calling agentA hand-builttool-calling agentToolNode, tools_condition and create_agentToolNode,tools_condition and…Streaming modesStreaming modesCheckpointers and threadsCheckpointers andthreadsRuntime context and configurationRuntime context andconfigurationCommand and Send: dynamic routingCommand and Send:dynamic routingHuman-in-the-loop with interruptHuman-in-the-loopwith interruptTesting graphs and nodesTesting graphs andnodesWhat an AI agent isWhat an AI agent isType hints basicsType hints basicsDefining functionsDefining functionsMessages and conversation historyMessages andconversation historyChat modelsChat modelsTool calling (function calling)Tool calling (functioncalling)Iterators and generatorsIterators andgeneratorsDataclassesDataclassesTesting with pytest and unittestTesting with pytestand unittest
Essentials and Practical shown (16 of 25 lessons); the full list is below. Click a lesson to read it.

All 25 lessons, in order

Graph basics

  1. Why graphs for agents · Essentials · 8 min

    LangGraph models an agent or workflow as a graph of steps sharing state, giving you control a plain agent loop lacks.

  2. State and StateGraph · Essentials · 10 min

    Define the shared state with a TypedDict, then create a StateGraph builder around it.

  3. Nodes and edges · Essentials · 10 min

    Add functions as nodes and connect them with edges from START to END to define the order of work.

  4. Compiling and running a graph · Essentials · 9 min

    compile() checks the builder and returns a runnable graph; invoke() runs it to the end with an input state.

  5. Reducers: how updates merge · Essentials · 10 min

    Annotate a state key with a reducer, such as operator.add, so node updates accumulate instead of overwrite.

  6. MessagesState and chat history · Essentials · 9 min

    Keep a conversation in state with the add_messages reducer or the ready-made MessagesState.

Control flow

  1. Conditional edges and routing · Essentials · 10 min

    Use add_conditional_edges with a routing function to pick the next node at run time, including loops.

  2. Runtime context and configuration · Practical · 10 min

    Pass run-wide, read-only data like user IDs or model choice via context_schema and Runtime instead of state.

  3. Command and Send: dynamic routing · Practical · 13 min

    Return Command to update state and jump in one step; return Send objects to fan out work in parallel (map-reduce).

Agents and tools

  1. Calling a model inside a node · Essentials · 10 min

    A node that sends the message history to a chat model and appends the reply is the core building block of LLM graphs.

  2. A hand-built tool-calling agent · Practical · 14 min

    Build the classic agent loop yourself: a model node, a tools node, and a conditional edge that loops until no tool calls remain.

  3. ToolNode, tools_condition and create_agent · Practical · 10 min

    Use prebuilt ToolNode and tools_condition in your own graph, or LangChain's create_agent for a complete agent.

  4. Streaming modes · Practical · 12 min

    Stream state updates, full values, LLM tokens or custom progress events while a graph runs.

Persistence and memory

  1. Checkpointers and threads · Practical · 12 min

    Compile with a checkpointer and pass a thread_id so state is saved after every step and conversations continue.

  2. Long-term memory with stores · Advanced · 14 min

    Use a store to keep memories across threads, organized by namespace, with optional semantic search.

Human in the loop and time travel

  1. Human-in-the-loop with interrupt · Practical · 14 min

    Call interrupt() inside a node to pause the run, show a payload to a person, and resume with Command(resume=...).

  2. Time travel: history, replay and forks · Advanced · 13 min

    Browse a thread's checkpoint history, replay from a past step, or edit past state with update_state to fork a new path.

Production

  1. Testing graphs and nodes · Practical · 11 min

    Unit-test nodes directly, test whole graphs with a fresh in-memory checkpointer, and fake the model for deterministic runs.

  2. Studio, langgraph dev and tracing · Advanced · 12 min

    Run your graph in a local Agent Server with langgraph dev, debug it visually in LangSmith Studio, and trace runs.

  3. Durable execution and fault tolerance · Expert · 16 min

    Survive crashes and flaky dependencies with durability modes, retries, timeouts, error handlers and idempotent steps.

  4. Deploying with LangSmith Deployment · Expert · 14 min

    Ship graphs to the Agent Server via LangSmith Deployment (formerly LangGraph Platform), then call them with the SDK.

  5. Under the hood: Pregel, super-steps, channels · Expert · 15 min

    How the runtime executes graphs in super-steps over channels, and what that means for parallelism, errors and checkpoints.

Subgraphs, multi-agent and Functional API

  1. Subgraphs · Advanced · 13 min

    Use a compiled graph as a node, sharing state keys directly or translating state inside a wrapper node.

  2. Multi-agent: supervisors and handoffs · Advanced · 15 min

    Coordinate several agents with a supervisor that routes work, or with handoffs where agents pass control via Command.

  3. The Functional API · Advanced · 13 min

    Get persistence, interrupts and streaming with plain Python control flow using @entrypoint and @task.