LangChain and LangGraph: graphs, state, checkpointers, interrupts, durable execution

A child of Topic: agentic-frameworks. Measured on langgraph 1.2.14 and langchain 1.4.3: 44 small graph runs with no model, SQLite and Postgres checkpointers, 9 Claude Haiku 4.5 calls inside a graph that was killed and resumed, two create_agent runs on a local model. Data as of October 2026. Reading: 34 min, plus 10 in closed details.

Fig. 1 · the running example, killed and resumed

The idea in one picture

LangGraph runs your program as rounds of parallel steps over one shared state and saves a checkpoint of that state at the barrier after every round; surviving a crash, waiting days for a person and rewinding are all that checkpoint. LangChain 1.x is the thin layer above: one interface for models, tools and retrievers, and a ready agent loop that compiles to a LangGraph graph.

LangChain's create_agent builds a StateGraph; compile() turns any graph into a Pregel runtime that loops plan (which nodes are triggered), execute (all of them in parallel, each against the state as of the step start) and update (merge their writes through the reducers). Each finished task's output is saved as a pending write, and each update saves a checkpoint under the run's thread_id. Resume, whether after a SIGKILL or after a person answers an interrupt(), is just loading the last checkpoint and planning again. Fig. 1 is the page's running example, run for real with Claude Haiku 4.5 and killed halfway (section 5 has the timings and the run without checkpoints):

  1. One graph, one state, one checkpointer. The graph of section 2 compiled with a SqliteSaver: the nodes inside the process that runs them, the model, the shared state and the database beside them. Process 1 calls invoke({}) on a fresh thread; the input is saved as the first checkpoints.
  2. Super-step 1: read_and_test. One node runs and returns core and test_output; at the barrier the update is applied to the state and a checkpoint is written.
  3. Super-step 2: both diagnoses at once. The two nodes run in parallel, each a model call. diagnose_top_words returns after 6.6 s and its output is saved at once as a pending write, before the step ends.
  4. SIGKILL at 6.6 s. The driver kills the process while diagnose_word_count's call is in flight. Memory is gone and that call returns nothing; the database still holds the checkpoints and the pending write.
  5. Process 2: invoke(None) on the same thread. A fresh process loads the last checkpoint and its pending write and plans again: only diagnose_word_count runs (6.3 s). At the barrier the operator.add reducer joins both diagnoses into one list; a checkpoint is written.
  6. propose_fix, then interrupt(). propose_fix makes the third returned call (7.8 s); human_review calls interrupt(): the pause is saved, invoke returns the diff at 21.0 s and process 2 exits. Nothing runs while the person decides, for seconds or for days.
  7. Process 3: Command(resume="approve"). Another process loads the thread; human_review runs again from its first line, interrupt() now returns "approve", apply_and_test applies the patch and the tests pass. SQLite holds 7 checkpoints and 19 writes; 4 model calls started for 3 that returned ($0.0132 at list prices).

You need the agent loop itself, written by hand in Building a harness, and the root's workflows against agents (Topic: agentic-frameworks, Reading). Nothing else.

New terms, and the problem each solves

TermWhat it is, and why it existsSection
Runnable, LCELLangChain's one interface (invoke, batch, stream) for prompts, models, parsers, retrievers and tools; | chains them1
StateGraph, node, edgeA workflow or agent written as named steps over typed state, so the runtime can schedule, save and resume it2
ReducerHow to merge when two steps running at once write the same key3
Channel, super-stepEach key (and each edge) is a versioned channel; a super-step is one round of plan, parallel execute, update3
Checkpoint, thread_idThe state saved after every super-step, keyed by the run's id: resume, inspect, rewind4
Pending write, durabilityA finished task's output saved before the step ends, so a crash loses only the work in flight; durability says when checkpoints are written4, 5
interrupt(), CommandPause for a person (for days) and resume with their answer; route from inside a node6
Stream modeWhich events a long run yields while it goes7
Subgraph, Command.PARENTA graph as a node of another; hand control from one agent to another8
create_agent, middlewareThe standard tool-calling loop without writing the graph; approvals, limits, summaries as plug-in hooks9
StoreMemory that crosses threads (users, projects), unlike the checkpoint10
Agent ServerLangChain's hosted runner: processes, database and resume run for you11
What the experiments on this page found

    Labels: MEASURED run for this page (Apple M1 Pro; langgraph 1.2.14 and langchain 1.4.3 on 6 October 2026; section 1 on langchain-core 1.6.7, 24 October 2026); DOCS read from official docs or source; UNCONFIRMED no primary source found. The graphs of sections 3 to 8 have no model: every node is a plain function over the running example (the textstats repository with two planted bugs, shared across the agents topics), so their traces are exact. Real model calls appear in sections 5 and 9.

    1. LangChain 1.x: one interface for every building block

    Since 1.0 (October 2025) the langchain package is an agent library, create_agent plus middleware (section 9), built on the interfaces in langchain-core. The pre-1.0 chains, retrievers and indexes moved to langchain-classic; on 1.4.3, import langchain.chains raises ModuleNotFoundError and from langchain_classic.chains import RetrievalQA works MEASURED. LangGraph does not need LangChain at all: its README says it "can be used without LangChain", and every graph in sections 2 to 8 imports only langgraph.

    Everything is a Runnable. A prompt template, a chat model, an output parser, a retriever, a tool, and any chain built from them implement one interface, Runnable: invoke (one input), batch (a list, run concurrently), stream, the async ainvoke, and wrappers such as with_retry and with_fallbacks. LCEL, the LangChain Expression Language (August 2023, "a declarative way to truly compose chains", LangChain), is the | operator over Runnables: prompt | model | parser builds a RunnableSequence whose invoke feeds each step's output to the next. One call on the running example, with a fake model so that every value shown is exact MEASURED:

    One invoke() through prompt | model | parser: what each Runnable receives and returns

    Real values from src/code/e8_lcel.py (langchain-core 1.6.7). The model is FakeListChatModel returning a fixed answer, so nothing here depends on a provider. The same six methods exist on every block: .

    Models, tools, retrievers. init_chat_model("provider:model") (or a class such as ChatOpenAI) gives every provider the same message types and the same invoke. @tool turns a typed, documented function into the JSON schema the model sees; a retriever is a Runnable from a query string to a list of Documents, and vector_store.as_retriever(search_kwargs={"k": 2}) makes one. Both on the running example:

    @tool on run_tests(path: str, verbose: bool = False) becomes:

    retriever.invoke("why does word_count miscount contractions?") over the three functions of textstats/core.py:

    The embeddings are LangChain's DeterministicFakeEmbedding (hash-seeded random vectors), so the ranking shows the interface, not retrieval quality; how to retrieve well is the retrieval pipeline's subject.

    What the abstraction costs. The same work (format two messages, call the model, return its text) through the chain and as two plain functions, fake model, no tracing MEASURED:

    Time is not the cost: per call is noise next to a model call of a second or more. The cost is distance: , and a prompt assembled inside a template you do not see unless you print it, which is the hidden-prompt criticism of section 12. LangChain's prompt.invoke(...).to_messages() prints exactly the two messages shown above.

    2. A graph from zero

    The running example's tests fail because of two bugs. A sensible workflow: run the tests, diagnose each failure (independent, so in parallel), propose one fix from both diagnoses, show it to a person, apply it only if they approve. LangGraph asks for it as three kinds of object:

    • State: a typed dictionary (a TypedDict, Pydantic model or dataclass) that every step reads and updates: here the code, the test output, the diagnoses, the patch, the decision.
    • Nodes: plain functions that take the state and return a partial update, a dictionary with only the keys they change. A node never mutates the state it was given.
    • Edges: which node runs after which. A normal edge always fires; a conditional edge calls a function on the state and returns the next node's name (or several, or END).

    This is the graph that section 5 runs with real Claude Haiku 4.5 calls, trimmed to its shape (full script: src/code/e6_real.py):

    class S(TypedDict, total=False):
        core: str
        test_output: str
        diagnoses: Annotated[list, operator.add]   # a reducer: parallel writes are concatenated
        patch: str
        decision: str
        passed: bool
    
    b = StateGraph(S)
    b.add_node("read_and_test", read_and_test)            # returns {"core": ..., "test_output": ...}
    b.add_node("diagnose_word_count", diag("test_word_count"))
    b.add_node("diagnose_top_words", diag("test_top_words"))
    b.add_node("propose_fix", propose_fix)                # one model call, returns {"patch": ...}
    b.add_node("human_review", human_review)              # calls interrupt(), returns {"decision": ...}
    b.add_node("apply_and_test", apply_and_test)
    b.add_edge(START, "read_and_test")
    b.add_edge("read_and_test", "diagnose_word_count")    # two edges out of one node:
    b.add_edge("read_and_test", "diagnose_top_words")     # both run, in parallel
    b.add_edge(["diagnose_word_count", "diagnose_top_words"], "propose_fix")   # wait for both
    b.add_edge("propose_fix", "human_review")
    b.add_edge("human_review", "apply_and_test")
    b.add_edge("apply_and_test", END)
    app = b.compile(checkpointer=SqliteSaver(conn))       # the checkpointer is what makes it durable
    app.invoke({}, {"configurable": {"thread_id": "fix-1"}})

    compile() checks the wiring (an edge to an unknown node raises ValueError: Found edge ending at unknown node; a node that no edge reaches compiles without complaint MEASURED) and returns a Pregel object, the runtime of section 3, with invoke (run to the end or the next interrupt), stream, get_state and get_state_history (read checkpoints) and update_state (write one: edit or rewind). Every call carries a config whose thread_id names the run; with a checkpointer it is required ("you must specify a thread_id", docs).

    The functional API writes the same thing as ordinary Python: a function marked @entrypoint calls functions marked @task whose results are saved (section 9 measures one). "Compiling a StateGraph or creating an @entrypoint produces a Pregel instance" (docs): one runtime under both.

    The code on the left as LangGraph draws it: two edges out of read_and_test run both diagnoses in one super-step

    START is where the input enters; reaching END with nothing else scheduled ends the run. Dashed arrows (in later figures) are conditional edges.

    Fig. 2 · super-steps of a recorded run

    3. How a graph runs: super-steps

    LangGraph's README says it "is inspired by Pregel and Apache Beam". Pregel is Google's system for computing over huge graphs (Malewicz et al., SIGMOD 2010), in the bulk synchronous parallel style of Valiant (CACM 33(8), 1990): work proceeds in rounds, everything in a round runs in parallel, and results are exchanged only at the barrier. LangGraph's round is the super-step, "a single tick of the graph where all nodes scheduled for that step execute (potentially in parallel)" (docs). Its three phases, as pregel/_algo.py implements them:

    1. Plan. Every state key is a channel with a version number that rises on each write. Edges are channels too, with names you never typed: branch:to:propose_fix, or join:diagnose_word_count+diagnose_top_words:propose_fix for a wait-for-both edge. Each node records the version of each trigger channel it last saw (versions_seen) and runs in this step if one has a newer version.
    2. Execute. All triggered nodes run in parallel, each reading the state as of the start of the step, so none sees another's output from the same step. What a node returns is not applied yet: it is held, and saved, as a pending write.
    3. Update. At the barrier all pending writes are applied together, sorted by task path rather than finishing time, each through its channel's reducer; written channels get the next version; a checkpoint is saved. When no node is triggered, the run ends.

    A key with no reducer is a LastValue channel: exactly one write per step. A key annotated with a reducer (Annotated[list, operator.add], or add_messages for chat messages) is a BinaryOperatorAggregate channel that folds in any number. Predict before you watch: on "Fan-out, reducer", check_top_words finishes before check_tokenize; which finding comes first in the merged list?

    Fig. 2 plays seven recorded graphs, one at a time; pick one

    In Fig. 2 the graph runs top to bottom (amber outline: triggered; amber fill: runs in this super-step; red: failed) and the pills above it mark the phase; each task's pending writes wait in the tray, each state channel's bar is as long as its version (with the new value under the bars after an update), and the saved checkpoints stack up below. Version numbers are the integer part of LangGraph's version strings (a counter plus a random suffix); only their order matters. Every frame is drawn from the checkpoints and task events of a real run on langgraph 1.2.14 with an InMemorySaver (src/code/e1_supersteps.py), not from a model of the algorithm MEASURED.

    Channels, versions and pending writes at this step

    Changed rows are highlighted after an update. Plain edges and wait-for-all joins are hidden channels too: branch:to:propose_fix, join:...:propose_fix.

    versions_seen at this step (what each node has already reacted to)
    What each of the seven graphs teaches, in one table

    Data: src/data/e1_supersteps.json; the repair of the failed thread is in src/data/e1b_checks.json.

    The answer. With the reducer the findings are concatenated in task-path order: check_top_words finished first, yet its finding comes second. Without it the step fails with InvalidUpdateError: At key 'findings': Can receive only one value per step. Use an Annotated key to handle multiple values. And something the message does not say MEASURED: both writes were already saved as pending writes, so every later get_state() on that thread raised the same error. The thread stays stuck until you write past it: update_state(config, {"findings": [...]}, as_node="check_tokenize") saved a new checkpoint, after which invoke(None, config) finished. To bypass a reducer on purpose for one write (reset a list), return Overwrite(value) (langgraph 1.0.2 and later).

    Predict: branch A is two nodes long (search, then read the hits), branch B one (lint). Both have a plain edge into join. How many times does join run? (Then pick "Uneven, plain edges" for Fig. 2.)
    Twice MEASURED. In super-step 3, B's edge has fired while A is on its second node, so join runs alongside a_read_hits; in super-step 4 A's edge fires and join runs again. The recorded log is read, a_search, b_lint, a_read_hits, join, join. Written as add_edge(["a_read_hits", "b_lint"], "join") the edge becomes one join: channel that fires only when both have written ("Uneven, join"): plain edges mean "run when any arrives", the list form "wait for all".

    Loops and the recursion limit. A conditional edge may point backwards (fix, test, fix again: the "Loop" graph). Each pass is a super-step, and the run stops with GraphRecursionError past recursion_limit super-steps. The default was 25 up to langgraph 1.0.x, then 10,000 in 1.1.0 and 10,007 in 1.2.0 SOURCE (DEFAULT_RECURSION_LIMIT in _internal/_config.py of each wheel; override with LANGGRAPH_DEFAULT_RECURSION_LIMIT or per call). Tutorials that warn about hitting 25 describe the old default: a runaway loop now runs for a very long time unless you set a limit, or a model-call limit (section 9).

    Map-reduce with Send. When the number of parallel tasks is known only at run time (one review per file), a conditional edge returns a list of Send("review", {"file": f}); each becomes one task in the next super-step with its own input instead of the shared state. The "Send" graph: three files, three review tasks in one step, gathered by a reducer, then summarise.

    4. Checkpointers: what is saved, where, and how big it gets

    A checkpointer is what you pass to compile(checkpointer=...): it saves a checkpoint at every super-step boundary and the pending writes of every task in between. Without one the state lives only in the running process and interrupts cannot be resumed (section 6); with one, a thread's whole history is in a database, keyed by thread_id.

    What one checkpoint holds (the Checkpoint type, langgraph-checkpoint 4.2.0): id (unique and increasing, so it sorts by time), ts, channel_values (the state plus trigger channels), channel_versions, versions_seen per node and updated_channels; beside it, metadata: source (input, loop, update or fork), step (-1 for the input checkpoint, then 0, 1, 2 ...), the parent checkpoint and the run id. Pick a checkpoint of the recorded linear run:

    Where it goes (docs): InMemorySaver (core package, "for experimentation"), SqliteSaver (langgraph-checkpoint-sqlite, "ideal for experimentation and local workflows"), PostgresSaver (langgraph-checkpoint-postgres, "used in LangSmith. Ideal for using in production"), plus separately packaged MongoDB and Azure Cosmos DB savers. Redis appears in the docs only as a store (section 10), not a checkpointer; the old version of this page listed it as a checkpointer backend. SQLite keeps the whole serialized state in each checkpoint row; Postgres keeps one row per channel per version, so an unchanged channel is not stored again MEASURED. Checkpoints hold every prompt, tool result and secret your agent saw: encrypt them (EncryptedSerializer, AES key from LANGGRAPH_AES_KEY).

    The table schemas and the serializer, read from the databases after the runs

    SQLite (3.1.1): two tables. checkpoints (thread_id, checkpoint_ns, checkpoint_id, parent_checkpoint_id, type, checkpoint BLOB, metadata BLOB) and writes (thread_id, checkpoint_ns, checkpoint_id, task_id, idx, channel, type, value BLOB).

    Postgres (3.1.2, Postgres 16 in Docker): four tables, created by setup() through 10 migrations. checkpoints (small JSONB rows), checkpoint_blobs (one row per channel per version), checkpoint_writes and checkpoint_migrations.

    Values are serialized with JsonPlusSerializer (msgpack; pickle fallback off by default; LANGGRAPH_STRICT_MSGPACK=true restricts which classes may be rebuilt); EncryptedSerializer wraps it (docs).

    A real checkpoint, as the saver stores it

    
    

    MEASURED straight from InMemorySaver.list() after the run (ids shortened to their last 8 characters, versions to their counter). Pending writes are stored against the checkpoint before the step that produced them, which is how a resumed run knows which tasks of that step are already done.

    Storage grows with the square of the run length

    An agent's state is mostly its message list, and the list changes every step. A checkpoint stores the whole list each time, so N steps that each add about the same amount store about N(N+1)/2 steps' worth. The test: an agent-shaped graph with no model, 40 super-steps, each adding a tool call and a 1,000-character tool result, stored bytes read back after every step MEASURED. LangGraph 1.2 added a beta channel type, DeltaChannel, that stores only each step's new writes and rebuilds the value by replaying them:

    So for long threads keep the message list short (trim or summarise with middleware, section 9, or a context policy), prune old checkpoints, or try DeltaChannel, whose docstring warns "The API and on-disk representation may change"; its price is on the read side, where reading the state replays writes.

    add_messages stores the whole list every step; DeltaChannel stores only the new part

    Stored bytes = checkpoint rows + blobs + writes, uncompressed (length() in SQLite, octet_length() in Postgres). Tool results are hex text, different every step, so compression would not hide the growth. get_state times are one call on the M1 Pro; Postgres times include the round trip into Docker. Script: src/code/e3_storage.py.

    Durability modes: when the checkpoint is written

    invoke(..., durability=...) takes three values (docs): "sync" persists "synchronously before the next step starts"; "async", the default in the source, persists "asynchronously while the next step executes", with a "small risk" of losing a checkpoint in a crash; "exit" persists "only when graph execution exits", so "you cannot recover from system failures (like process crashes) mid-execution". The cost of each, on a one-node loop of 200 super-steps (best of 3) MEASURED:

    Under half a millisecond per step on SQLite, against model calls of seconds: for agents sync is the safe choice and costs nothing that matters. exit is for short graphs where only the final state counts.

    5. What survives a crash

    A run can stop halfway because the process dies (a deploy, an out-of-memory kill), a node raises (a provider timeout), or a person has not answered yet (section 6). First without a model: run the tests, then two checks in parallel (0.5 s and 6 s), then merge; SIGKILL about 3 s into the parallel step, after the fast check returned and while the slow one runs; then a fresh process calls invoke(None, config) on the same thread. Every node logs when it runs MEASURED:

    With a checkpointer writing each step, the fast check's result survived as a pending write and the resumed process ran only the slow check and the merge, as the docs promise: "When you resume graph execution from that super-step you don't re-run the successful nodes." An exception instead of a kill behaved the same (the database held the fast node's write plus an __error__ write, and only the failed node re-ran). With exit nothing had been saved: invoke(None) failed with EmptyInputError: Received no input for __start__, and the only option was to start over.

    Now with real model calls. The graph of section 2, each diagnosis a Claude Haiku 4.5 call through claude -p with every tool off. A driver killed the whole process group the moment the first diagnosis returned, started a second process that called invoke(None) on the same thread (or a fresh invoke({}) when there was no checkpoint), and a third that approved at the interrupt with Command(resume="approve"). Predict: with exit, how many model calls does the whole run start, against 3 when nothing goes wrong? Then switch Fig. 3 to exit. It opens on the end of each run; step back or drag to replay it event by event (Fig. 1 plays the sync run step by step).

    The answer: 5 calls with exit against 4 with sync. Both lose the call that was in flight; only exit also pays again for the diagnosis that had already returned, because with no checkpoint the restart begins from the input.

    Every model call of the run shown in Fig. 3, with the model's answer

    Click a row. Tokens and cost come from each call's result record; output includes thinking tokens.

    What was in the database the moment the process died (the no-model kill)

    Read back from SQLite straight after the kill. Pending writes are listed under the checkpoint they belong to (the writes of super-step n against checkpoint n-1); the __error__ write marks the task that raised. Task ids shortened to 6 characters.

    How the real run was recorded

    Scripts src/code/e6_real.py (real) and src/code/e2_crash.py (no model). Claude Code , model claude-haiku-4-5-20251001, --tools "" --setting-sources project --strict-mcp-config --no-session-persistence, a system prompt asking for no em-dashes. Raw recordings stayed in a scratch folder; the redacted copies in src/recordings/e6/ keep a whitelisted init record, every assistant message (thinking signatures removed) and the result record. The "person" approving was the driver script.

    What a checkpointer does not do. It restarts nothing: a supervisor (a job queue, Kubernetes, the Agent Server of section 11) must notice the dead run and resume it with the same thread_id. It cannot save the call in flight, so the smaller your nodes, the less a crash costs. And it cannot make side effects safe: a node that sent an e-mail and died before its write was saved sends it again on resume. Per node, LangGraph adds RetryPolicy (defaults in 1.2.14: first wait 0.5 s, doubling, at most 128 s, 3 attempts in all, with jitter), TimeoutPolicy (1.2; run and idle timeouts, "Timeouts apply to async nodes only", 1.2.0a6 notes) and error_handler (1.2; runs after the retries are exhausted and may return a Command, for compensation steps). The parent's Orchestration lab tab, part "Durable execution", sets this checkpointer against Temporal-style event-history replay.

    Fig. 3 · The same kill, sync against exit: the diagnosis that returned before the kill is paid for again only without checkpoints

    Bars are model calls to scale in seconds, one lane per process; the red line is the SIGKILL. A call cut by the kill (hatched) was in flight: its tokens may well have been billed, but no result came back and the recording has no usage for it. Costs are total_cost_usd at API list prices (a subscription paid). Call times overlap other agents' load on the same machine, so durations are indicative MEASURED.

    Fig. 4 · Resume re-runs the node from its first line, so a side effect before interrupt() happens twice

    MEASURED counters end on the recorded counts of each line's executions in src/code/e4_interrupts.py (no model); the highlighted line is the one running; the steps are listed on the left.

    6. Interrupts and Command: pausing for a person, routing from inside a node

    An agent about to apply a patch, pay a refund or send an e-mail should sometimes ask first, and the answer may come tomorrow. Holding a process open for a day is fragile, so LangGraph pauses through the checkpoint: inside a node, interrupt(payload) raises a special exception, the runtime saves the state, and invoke returns with the payload (with 1.1's version="v2", in result.interrupts). Later, from any process, invoke(Command(resume=answer), config) loads the thread and runs the node again, and this time interrupt() returns the answer instead of raising. "The thread_id you choose is effectively your persistent cursor" (docs).

    The trap is runs the node again, from its first line ("The graph resumes from the start of the node, re-executing all logic", interrupt's docstring). Predict: a node sends a notification e-mail, then asks for approval; after one approval, how many e-mails went out? Fig. 4 steps through it; then move the e-mail after the question:

    1. invoke({}, config). propose runs, then review starts.
    2. review runs from its first line. It has started once.
    3. The e-mail goes out. One e-mail sent.
    4. interrupt() raises. The state is saved and invoke returns the question; the process may now exit.
    5. Later, maybe in another process: invoke(Command(resume="approve"), config).
    6. review runs again from its first line. Started twice now.
    7. The e-mail goes out a second time. Two e-mails for one approval.
    8. interrupt() now returns "approve" instead of raising.
    9. The node returns and apply runs next. Recorded: review started 2 times, 2 e-mails.

    Every rule in the docs follows from that one fact, and each was checked here MEASURED:

    Rules checked: two interrupts in one node are matched by order ("Matching is strictly index-based"); parallel interrupts are resumed together by interrupt id; a single plain value fails when several are pending; a bare try/except Exception swallows the interrupt and the node carries on; without a checkpointer the resume fails ("Cannot use Command(resume=...) without checkpointer"); response_schema (1.2.12) validates the resume value; interrupt_before is a breakpoint, not an approval.

    Command carries these instructions. Command(resume=...) answers interrupts; returned from a node, Command(update={...}, goto="node") updates the state and picks the next node in one move (the node declares its possible destinations, add_node("triage", f, destinations=("billing", "tech")), so the graph can be drawn); goto may also be a Send or a list; graph=Command.PARENT sends the jump to the enclosing graph, which is how one agent hands over to another (section 8).

    Static breakpoints, compile(interrupt_before=["apply"]), stop before a node with no code in it; resume with invoke(None, config). The docs keep them for debugging: "Static interrupts are not recommended for human-in-the-loop workflows." Time travel is the same machinery: get_state_history(config) lists every checkpoint; update_state(old_config, values, as_node=...) writes a new checkpoint whose parent is an old one (a fork); invoke(None, new_config) runs forward from it. The parent's Orchestration lab forks a recorded run with an edited diagnosis.

    7. Streaming: seven modes, one run

    A run that takes minutes must show progress. stream(..., stream_mode=...) yields events as the graph runs, and the mode decides what an event is. The two-check graph of section 3, one run per mode, events counted MEASURED:

    messages, the mode for chat interfaces, yields each model token with the node and step that produced it; it needs a model, so it was measured on the create_agent run of section 9. Modes combine (stream_mode=["updates", "custom"] yields (mode, data) pairs), and subgraphs=True adds events from inside subgraphs with their namespace. Since 1.1, version="v2" makes every event a typed {"type", "ns", "data"} dictionary; since 1.2 the docs recommend event streaming (stream_events(..., version="v3"), beta) for new applications, one typed stream per model call (docs; not run here).

    One run, as each stream mode emits it (the count is events per run)

    8. Subgraphs and handoffs

    A compiled graph can be a node of another, in two ways that behave differently on resume. Recorded: a parent graph (triage, fix_bug, apply) whose fix_bug is a two-node subgraph (locate, then patch, which calls interrupt()) MEASURED:

    In both, the subgraph got its own checkpoints under a namespace (fix_bug:<task id>), so locate was not re-run on resume and get_state(config, subgraphs=True) showed the paused subgraph's state. The difference: called from inside a function, the parent's wrapper function ran twice, because the parent node is what resumes from its first line. Whether a subgraph keeps state between calls is set by compile(checkpointer=...) on it: None (default) inherits the parent's checkpointer for one call, True keeps state per thread, False keeps none (docs).

    Handoffs. A node inside a subgraph returned Command(goto="billing", graph=Command.PARENT, update={...}); the parent ran billing next and the final log was ["triage: refund question, handing off", "billing: handled"] MEASURED. That is the whole mechanism behind LangGraph's handoff pattern. The prebuilt langgraph-supervisor and langgraph-swarm packages still exist, but the supervisor README now says "We now recommend using the supervisor pattern directly via tools rather than this library for most use cases" (langgraph-supervisor); LangChain's multi-agent docs point to subagents as tools and to Deep Agents. When several agents help at all is Multi-agent patterns's subject; its section 6 sets handoffs like this one against agents called as tools.

    9. create_agent and middleware: the agent loop as a graph

    Most people never write a StateGraph for a tool-calling agent: create_agent(model, tools, system_prompt=..., middleware=[...], checkpointer=...) builds the ReAct-style loop (call the model; if it asked for tools, run them and call it again; otherwise stop) and "uses LangGraph under the hood" (LangChain). It replaces LangGraph's create_react_agent, deprecated since 1.0 and due for removal in 2.0 (migration guide). The loop itself, written by hand, is Building a harness's subject.

    Middleware changes that loop without rewriting it. A middleware class implements some of six hooks (docs): before_agent and after_agent (once per invocation), before_model and after_model (around every model call, as graph nodes that may return a state update or jump), and wrap_model_call and wrap_tool_call (functions around each call, for retries, fallbacks, caching or rewriting the request). before_* hooks run first to last, after_* last to first, and wrap hooks nest like function calls. The hooks become nodes: the compiled graph of the same agent without and with two middlewares, read with get_graph() MEASURED:

    The built-in middleware in langchain 1.4.3 (16 classes)

    HumanInTheLoopMiddleware, SummarizationMiddleware, ModelCallLimitMiddleware, ToolCallLimitMiddleware, ModelRetryMiddleware, ToolRetryMiddleware, ModelFallbackMiddleware, ToolErrorMiddleware, PIIMiddleware, TodoListMiddleware, LLMToolSelectorMiddleware, ProviderToolSearchMiddleware, ContextEditingMiddleware, ShellToolMiddleware, FilesystemFileSearchMiddleware and LLMToolEmulator (the exports of langchain.agents.middleware in 1.4.3). The docs page adds filesystem, subagent and rubric middleware from the deepagents package.

    Each node-style hook is a node of the compiled graph

    A recorded run. The running example with three tools (read_file, run_tests, write_file), write_file behind the approval middleware, a SQLite checkpointer, and a small local model (Qwen3-4B-Instruct-2507, 4-bit, mlx-lm on the M1 Pro, temperature 0) through LangChain's ChatOpenAI pointed at the local server; every HTTP request was logged. The approval middleware calls interrupt() with the pending tool calls; the "person" was a script, run twice: once approving everything, once rejecting any write outside textstats/ with a reason MEASURED:

    Three things it shows. The request: the first body sent held our system prompt verbatim, the user message, and three tool schemas generated from the functions' signatures and docstrings, with nothing added by LangChain MEASURED, which answers the hidden-prompt criticism for this version. The gate: the interrupt payload is a HITLRequest, a list of action_requests (tool name, arguments, description) plus the decisions allowed for each; the answer is {"decisions": [...]}, each approve, edit (replace the arguments), reject (with a message the model sees as the tool result) or respond (answer instead of running the tool). The human: the model wrote a brand-new core.py at the repository root; the approve-all reviewer let it through and the bugs stayed; the checking reviewer's rejection made the model read the real file and fix one of the two bugs, after which it declared success without running the tests. Gates are only as good as the reviewer, and an agent's final message is not evidence.

    The first request, exactly as sent
    The interrupt payload of the first approval

    Same agent, same model, two reviewers: only the one who checks the path gets a fix

    
    

    Messages from the checkpoint after the run, each shortened. Times per request include waiting for a lock shared with other agents on the same local server, so they are not model speed. A 4-billion-parameter local model, not Claude: the point is what the framework did, not how well the model did.

    The functional API, measured. The same durability in plain Python: an @entrypoint function called two @task diagnoses in parallel, then a propose task per diagnosis; the first propose raised a simulated provider timeout. Calling invoke(None, config) again finished the run with task counters MEASURED: finished tasks came from the checkpoint; only the failed one and those after it ran.

    10. The store: memory across threads

    A checkpoint belongs to one thread: a new conversation starts empty. What should carry over (a user's preferences, facts about a project) goes in a store: "LangGraph stores provide cross-thread long-term memory, complementing per-thread checkpointer persistence" (docs). A store is a key-value database whose keys live in namespaces, tuples such as ("users", user_id, "prefs"); pass it to compile(store=...) and a node receives it as an argument. Three threads of one graph sharing an InMemoryStore MEASURED:

    Backends: InMemoryStore for tests; PostgresStore, MongoDBStore, RedisStore or UpstashStore for production; with an index configuration (an embedding function, its dimensions, the fields to embed) store.search(namespace, query=...) does semantic search (docs; not run here, it needs an embedding model). A store keeps exactly what your node writes. What to remember, what to do when a new fact contradicts an old one, and when to retrieve are a design problem of their own, which memory-layer libraries (Mem0, Zep's Graphiti, Letta) hand to a model; they are compared in Context engineering, section 8 (agent memory), which absorbed the old Agent memory layers page.

    11. Deployment: the Agent Server

    Everything above runs in your process with your database, and you own what a checkpointer does not do: a process per graph, a queue, something that notices a dead run and resumes it, an HTTP API. LangChain sells those as LangSmith Deployment (formerly LangGraph Platform). Its server, the Agent Server (formerly LangGraph Server), is "built on the concept of assistants" with "built-in persistence and a task queue", and with it "you do not need to implement or configure checkpointers or stores manually" (docs). LangSmith Studio (formerly LangGraph Studio) is a visual debugger over a running graph's threads, checkpoints and interrupts. Plans and prices are in the dated table below. Hosted agent runtimes in general (Claude Managed Agents, the OpenAI Agents API) are compared on the parent's Production stack tab.

    12. When a graph beats a plain loop, and the criticisms checked

    The root's thirty-line loop and a LangGraph graph do the same work while nothing goes wrong. The difference is what you would otherwise have to build:

    Each need on the left is something a plain loop makes you build; LangGraph's answer is the checkpoint or the super-step

    You needIn a plain loop you buildLangGraph gives youShown in
    A crash or deploy mid-run must not lose paid workYour own state store, written after every call, and replay logicCheckpoint per super-step plus pending writes: only the call in flight is lost5
    Approvals that wait hours or daysA persisted pause, a resume endpoint, the state reloaded in another processinterrupt() plus Command(resume=...) on the same thread_id6
    Real branching: fan-out, wait-for-all joins, loops with limits, map-reduce over a list known at run timeA small DAG engine over model calls, with merge rulesSuper-steps, reducers, list-form joins, Send, recursion_limit3
    Inspection: read, diff and fork any intermediate stateLogging every state yourselfget_state_history, update_state forks4, 6
    None of these: a short, linear tool loopNothing extra: the loop is simpler, and every prompt is in front of youroot

    If none applies, a plain loop over provider calls behind a gateway such as LiteLLM (Gateways and routing), with tracing (LLM observability), is the simpler system; if you only need a typed agent loop, the four libraries in Typed agent libraries are lighter; for a finished harness (tools, permissions, hooks, sessions) rather than a graph you assemble, the Claude Agent SDK runs Claude Code's own loop as a library.

    The criticisms are old, specific and mostly about the pre-1.0 package:

    • Abstraction tax. Max Woolf, 14 Jul 2023: "The problem with LangChain is that it makes simple things relatively complex" (minimaxir.com). Octomind (Fabian Both; undated, first archived 14 Jun 2024; the site is gone): "We used LangChain in production for over 12 months, starting in early 2023 then removing it in 2024", and "in hindsight, we would've been better off long-term without a framework" (archived copy). Both target prompt templates, output parsers and LCEL chains, which 1.0 moved to langchain-classic; neither discusses LangGraph. Section 1 measures what is left of the tax: about 0.2 ms and four extra stack frames per call.
    • Hidden prompts. Hamel Husain, 14 Feb 2024: the prompts a framework sends are "the fastest way to understand how they work" (hamel.dev). Anthropic, 19 Dec 2024: frameworks "often create extra layers of abstraction that can obscure the underlying prompts and responses, making them harder to debug" (Building effective agents); its first version named "LangGraph from LangChain" first among the frameworks it meant (archived 20 Dec 2024), the current one names others. The cure is unchanged: log the literal request, as section 9 does.
    • Graph ceremony. For a linear tool loop, a schema, nodes, edges and compile() are overhead; the parent's Same agent, six ways tab shows the same agent in both styles.
    • Churn. The 0.x years broke APIs often. Since October 2025 the promise is "no breaking changes until 2.0", and 1.0 is a long-term-support line until 2.0 ships (release policy); a year in no 2.x exists, while defaults still move inside 1.x (the recursion limit, section 3).
    • Two this page adds from its runs: the reducer error leaves a thread unreadable until repaired (section 3), and resuming re-executes the interrupted node and its wrapper (sections 6 and 8), which is correct but surprises everyone once.

    Versions and dates, mistakes, interview rehearsal

    Optional depth, all closed. Version numbers, dates, prices and download counts change: they live in one dated table.

    Versions, dates, prices and adoption (as of 6 October 2026)
    DateWhatSource
    24 Oct 2022First LangChain commit, by Harrison Chase; 0.0.1 on PyPI the next dayGitHub
    4 Apr 2023$10M seed led by BenchmarkLangChain
    1 Aug 2023LCEL, the | composition of RunnablesLangChain
    9 Aug 2023First LangGraph commit, by Nuno CamposGitHub
    12 Dec 2023The split: langchain-core (interfaces and LCEL) and langchain-community (third-party integrations); provider packages such as langchain-openai followedLangChain
    6 to 8 Jan 2024langchain 0.1.0, the first stable versionLangChain
    8 to 17 Jan 2024LangGraph on PyPI (0.0.8) and announced: "a module built on top of LangChain to better enable creation of cyclical graphs, often needed for agent runtimes"LangChain
    19 Feb 2025Functional API (@entrypoint, @task) stable in langgraph 0.2.74releases
    29 to 30 Jul 2025Deep Agents (planning tool, subagents, a file system, a detailed prompt) on LangGraph; now "The batteries-included agent harness"LangChain, README
    13 to 17 Oct 2025"LangGraph Platform is now LangSmith Deployment and LangGraph Studio is now LangSmith Studio"LangSmith changelog
    20 Oct 2025$125M Series B at a $1.25B valuation, led by IVPLangChain
    22 Oct 2025LangChain 1.0 and LangGraph 1.0 announced together (wheels on PyPI since 17 Oct): "no breaking changes until 2.0"; create_agent; legacy chains, retrievers and indexes to langchain-classic. LangChain is "the fastest way to build an AI agent", LangGraph "a lower level framework and runtime, useful for highly custom and controllable agents"LangChain, migration guide
    29 Oct 2025langgraph 1.0.2: Overwrite to bypass a reducerrelease
    Nov to Dec 2025Last releases of langgraph-supervisor (0.0.31, 19 Nov) and langgraph-swarm (0.1.0, 4 Dec); none sincePyPI
    10 Mar 2026LangGraph 1.1: opt-in version="v2" output (typed stream parts; invoke returns .value and .interrupts); default recursion limit 25 to 10,000releases
    12 May 2026LangGraph 1.2: per-node timeouts, node error handlers, graceful shutdown, DeltaChannel (beta), event streaming (beta); recursion limit 10,0071.2.0a6 notes
    22 May 2026langchain-community 0.4.2, the latest; it never reached 1.0PyPI
    10 Sep 2026AWS's open-source blog introduces Pizza Bot, an inbox for background agents built on Deep Agents and LangGraph; it "is a community project rather than an AWS service"AWS Open Source Blog
    21 Sep 2026langgraph 1.2.12: response_schema on interrupt()release
    6 Oct 2026langgraph 1.2.14 (released that day; measured here), langchain 1.4.3, langchain-core 1.6.7. No 2.x of langchain, langchain-core or langgraphPyPI
    6 Oct 2026Downloads in the previous 30 days: langchain 170,457,766, langgraph 44,769,952, openai-agents 12,449,784, crewai 2,442,764. CI runs and dependency installs count, so this measures reach, not usepypistats
    6 Oct 2026LangSmith Plus plan: $39 per seat per month with one small deployment included, usage-metered compute beyond (read through a summarising fetch: indicative)pricing
    2024 to 2025Own engineering blogs describing LangGraph systems: Uber (Finch, 17 Jul 2025), LinkedIn (SQL Bot, 9 Dec 2024); Klarna and Replit appear only in LangChain's case studies (vendor claims)Uber, LinkedIn
    Mistakes, one line each (every one shown in a section above)
    • Two parallel nodes write a key with no reducer: InvalidUpdateError, and the saved pending writes keep the thread failing on every read until update_state repairs it (3).
    • Expecting a join from plain edges: with branches of different lengths the node runs twice; use add_edge(["a", "b"], "join") (3).
    • A side effect before interrupt(): the e-mail is sent twice; move it after the interrupt, into a later node, or make it idempotent with a key (6).
    • interrupt() inside try/except Exception: the except branch catches it and the node carries on without pausing (measured: it auto-approved); catch specific types (6).
    • No checkpointer, or InMemorySaver, in production: the interrupt returns but the resume fails; in-memory state dies with the process; use Postgres, or SQLite on one machine (4, 6).
    • Reusing a thread_id for a new conversation, or a new one for a resume: the id is the cursor; your approval link must carry the paused run's id (6).
    • Letting the message list grow forever: 1.3 MB for 40 small steps in SQLite; trim, summarise, prune, or try DeltaChannel (4).
    • Trusting the old recursion limit of 25: set recursion_limit or a model-call limit yourself (3).
    • Approving tool calls without reading them: an approve-everything reviewer let a 4B model write a new core.py in the wrong directory (9).
    • Assuming LangGraph restarts crashed runs: it saves state; a supervisor, a queue or the Agent Server must call resume (5).
    Interview rehearsal: nine questions with short answers

    What is a super-step, and why does LangGraph use them? One round: plan the triggered nodes (a trigger channel newer than the node last saw), run them in parallel against the state as of the step start, apply all writes together through the reducers and save a checkpoint. From Pregel and bulk synchronous parallel computing; it makes parallel branches deterministic (fixed write order) and gives a natural point to checkpoint.

    What does a reducer do, and what happens without one? It merges several writes to one key in a step (append, add, merge messages by id). Without one a key accepts one write per step; two parallel writes raise InvalidUpdateError.

    A run crashes while two parallel nodes run; one had finished. What re-runs? With a checkpointer in sync or async mode, only the unfinished one: the finished output was a pending write. With "exit", everything. The call in flight is lost and paid again either way.

    How does interrupt() work, and what is the trap? It raises; the runtime saves state and returns the payload. Command(resume=value) reloads the thread and re-runs the node from its first line, and interrupt() returns the value. Everything before it runs again. Several interrupts in a node match by order; parallel ones resume by id.

    Checkpointer against store? A checkpointer saves the full graph state per thread at every step (resume, time travel); a store holds application key-value data across threads in namespaces (user preferences), optionally with semantic search.

    Which durability mode for an agent? sync: written before the next step, so a crash never loses a finished step, at under half a millisecond per step on SQLite. async (the default) overlaps the write at a small risk; exit cannot recover from a crash.

    Design a multi-day human approval. Postgres checkpointer; the approval node calls interrupt() with the diff; store the thread_id in the approval request; the approve endpoint calls invoke(Command(resume="approve"), {"thread_id": ...}) from any worker; side effects after the interrupt; something retries if that worker dies.

    What is create_agent, and how does middleware change the graph? LangChain 1.x's tool-calling loop compiled to a LangGraph graph (a model node and a tools node). Each node-style hook becomes its own node; wrap hooks nest around the call; the human-in-the-loop middleware is an after_model node that calls interrupt() with the pending tool calls.

    When would you not use LangGraph? A short linear tool loop that needs no crash survival, no waiting for people, no parallel branches and no inspection of intermediate state: a plain loop is simpler and shows every prompt.

    Measurements: langgraph 1.2.14, langchain 1.4.3, langchain-core 1.6.7, langgraph-checkpoint 4.2.0, langgraph-checkpoint-sqlite 3.1.1, langgraph-checkpoint-postgres 3.1.2 (Postgres 16 in Docker), langchain-openai 1.6.7, Python 3.12, Apple M1 Pro, 6 October 2026; section 1's LCEL run on langchain-core 1.6.7, langchain 1.4.3 and langchain-classic 1.0.8, 24 October 2026. Model calls: Claude Haiku 4.5 through Claude Code (claude -p, tools off, --setting-sources project --strict-mcp-config --no-session-persistence, Claude subscription) and a local Qwen3-4B-Instruct-2507 4-bit model on mlx-lm. Scripts, redacted recordings and data in this page's src/.