R.9

Index of figures

Every figure of this manual, in order, by the one claim that its caption makes.

Each row links to its figure, and the claim is the claim: field of the figure block. The build numbers the figures of each part in the order they appear, so a figure number is its place in its part. A measured number in a figure comes from our recorded runs, and each chart reads one file of the summary folder. The charts of Part 9 read the summaries of the production service. The colours follow the palette of the front matter:

  • violet is your code: the caller, its input, and its config
  • blue is LangChain: create_agent, middleware, messages, and tools as objects
  • indigo is LangGraph: the graph, its nodes, the Pregel loop, and its streams
  • plum is the chat model and each model call
  • green is tools and the results they return
  • olive is a service outside the process, such as a provider, LangSmith, or Ollama
  • amber is lifecycle: steps, next nodes, interrupts, and resumes
  • teal is durable state: checkpoints, stores, and their rows
  • rose is a failure: an exception, an error message, or a repeated side effect
  • grey is outside LangChain: Python, packages, the machine, and the operator
Fig.The claim it makes
0.1Each arrow style marks one kind of exchange, and every label is a real name, message, or count from the capture kit.
1.1An agent from create_agent is a LangGraph graph, so every LangChain agent depends on LangGraph, and LangSmith sits beside the stack.
1.2Plain loop, create_agent, and StateGraph rows match task for task, Claude passes everything in both harnesses, and the deep agent loses tasks only on local models.
1.3Both harnesses passed 30 of 30 tasks on Haiku, and the SDK read 9.3k input tokens for a task against 23.7k for the deep agent.
1.4The framework took 6 to 67 ms per task at the median against seconds of model time, and a deep agent sent 3.6 to 4.3 times the tokens.
1.5The model node runs twice and the tools node once, and the checkpointer saves the state after the input and after each of the four steps.
1.6One plain edge leads into model, and three conditional edges leave model and tools, so the run picks its path at run time.
1.7A traced turn is a tree of runs, with one chain run for each graph node and one leaf for each model call and tool call.
2.1Every write in a superstep gets the same new version, and a node runs only when its trigger channel is newer than the version it last saw.
2.2The nodes returned in two different orders over six runs, and their writes applied as a, then b, in all six, because apply_writes sorts by path.
2.3Both writes are saved before the update raises, so every read replays the conflict until a schema with a reducer reapplies the same saved writes.
2.4In one loaded run, a finished task was not durable for 3.0 to 4.4 ms, and sync waited only for the checkpoint put.
2.5With no wait, the model node that returned last reran in 97 of 100 sync and 95 of 100 async trials, and with 0.2 s in none.
2.6Each call reran the waiting nodes and their model calls from the first line, replayed saved answers by index, and never ran the finished node other again.
2.7updates, messages, and custom are produced while tasks run, values after the update phase, and checkpoints only when the next superstep starts.
2.8The loop that reads reasoning first gets all 60 text deltas at once, 8.8 s after the first send, and the other loops get each within 5 ms.
2.9Plain rows hold the whole list and grow to 99 KB, and DeltaChannel rows stay near 750 bytes except one snapshot per 100 updates.
2.10LangGraph and LangChain took 0.14 to 0.45 percent of the wall time, and a sync SqliteSaver cost the most.
3.1Installing deepagents pulls in langchain, two provider packages, and langsmith, and installing langchain pulls in langgraph, which needs langchain-core.
3.2The imports for create_agent with ChatOpenAI take about 0.8 s warm and 2.6 s with no bytecode, about two and a half times import openai alone.
3.3A known prefix picks the provider, a known name start picks it next, and any other string raises ValueError before a request is sent.
3.4The client default and the middleware each made 3 attempts, and the two layers together made 9, in every run of every persistent failure.
3.5A tool call lives in AIMessage.tool_calls, not in content, and the ToolMessage that answers it repeats its id in tool_call_id.
3.6Bad arguments and an unknown tool name become an error ToolMessage, and an exception inside the tool ends the run unless middleware converts it.
3.7Each model request is the system prompt from the agent plus the messages from the state, and only the model reply goes back into the state.
4.1Tools build the tools node, middleware builds hook nodes and wrappers, and the prompt and response format change each model call without a node of their own.
4.2Each node line of draw_mermaid becomes one node, and each edge line becomes one arrow, solid for --> and dashed for -.->.
4.3An explicit strategy is never changed, and AutoStrategy chooses before each call from the profile or the name, so no failure moves a run to the other.
4.4ProviderStrategy failed only on the union and on 3 enum runs, and all but 2 ToolStrategy failures were on the nested and enum schemas.
4.5On Qwen3 4B both strategies returned no object, the extraction call kept every value the reply held, and on Claude all but free text worked.
4.6Without the selector Claude passed 40 of 40 runs, and with the default selector Qwen3 passed at most 2 of 10 in any cell.
4.7Prompt tokens grew six times from 5 to 100 tools on Claude, and the selector cut them while it doubled the calls and, with caching, the dollars.
4.8The before hooks chain in list order into model, the after_model hooks chain in reverse, and A.after_model chooses between tools, the end, and A.before_model.
4.9Node hooks run A, B, C before the model and C, B, A after it, and wrap hooks nest with A as the outer layer.
4.10Ten built-in classes only wrap the model call or the tool call, eight add graph nodes of their own, and one adds only tools.
4.11A Qwen3 14B grader said satisfied on 14 runs, and 12 of those runs still failed the state check.
4.12Each of the 3 attempts wrote its ledger row before the timeout, so an action whose reply was lost ran 3 times before the model saw an error.
4.13Redact and hash replace the match, mask keeps the last four digits of a card, and block raises before the model gets any call.
4.14A listed tool call at or above 0.5 gets an error ToolMessage and never runs, and the question carries criteria null unless you pass criteria.
5.1The same run yields 3 chunks in updates mode, 4 in values mode, 13 in messages mode, and 23 events from stream_events v3.
5.2v1 changes its shape with the number of modes, v2 always yields type, ns, and data, and v3 adds a method and a sequence number.
5.3Eight of the nine stream APIs deliver the first token about 2 ms after the send, and the loop that reads reasoning first waits 2,663 ms.
5.4A v3 loop that reads reasoning first sees all 80 tokens at once at 4,052 ms, and a text-only loop sees each as sent.
5.5Each turn adds an input checkpoint and then one loop checkpoint per step, and the step numbers keep counting across the turns and the restart.
5.6One connection and a pool of 20 both give 0.22 runs per second at 64 threads with Qwen3 4B, and the aput p99 does not separate them.
5.7The charge is in the ledger from the second kill point on, and the step is durable only after put returns.
5.8Without a key, a kill inside the tool repeated the charge in every mode, and after the tool returned only sync at the next step was safe.
5.9A search for users and ada covers both namespaces under ada, and no prefix that ends at a full label reaches the items of grace.
5.10A constant namespace gave Bob Alice's code in 20 of 20 sessions, and a per-user factory gave it in 0 of 20.
5.11Without summarization a turn takes 5 to 10 minutes once the context fills at turn 88, and with a trigger block medians stay at 4.4 to 9.2 s.
5.12A plain message channel stores 7,289 MB after 5,000 steps, and DeltaChannel stores 81 MB with snapshots every 100 steps and 16 MB every 1,000.
5.13Tuples and sets of tuples come back as lists, dict subclasses as dicts, time zones as fixed offsets, and a plain class does not save.
5.14The crash lost the approved step, so the reviewer approved twice and send_email ran twice, and the key kept the outbox at one email.
6.1Three writes to a key with operator.add join into one list, and two writes to a key with no reducer raise InvalidUpdateError at the end of the step.
6.2The Mermaid text has three conditional edges, from plan and from pick, and no add_edge call made any of them.
6.3Send starts three write_joke tasks in one step, and Command from pick updates best and goes to publish, so retry never runs.
6.4The resume runs workflow from its top, the three double tasks return saved results without running, and only ask_human runs again.
6.5An entrypoint compiles to one node between __start__ and __end__, and its tasks run inside that node with no node of their own.
6.6The resume runs review from its first line, so the line before interrupt runs twice, and write does not run again.
6.7Batched mode answers one list for all calls of a message, and per-call mode answers each call by its interrupt id against a schema.
6.8Each case gave the same tool runs in 3 of 3 runs, and only batched cases ran a tool that no approval allowed.
6.9A replay and an update_state from the checkpoint before b each start a branch beside the first run, and every old checkpoint stays.
6.10get_graph() shows the subgraph as one node named inner, and get_graph(xray=True) opens it into shout and ask_ok inside a box.
6.11The subgraph returns the whole steps list it was given, and operator.add in the parent joins it again, so outer.prepare appears twice.
6.12On one chain task the five patterns used 5 to 7 model calls, and the subagent pattern ran two agents one after the other.
6.13On a three-turn task the single agent made 9 model calls, and the other patterns made 12 to 18.
6.14Every failed attempt, a timeout too, goes to retry_on first, and the error handler runs only after the last attempt, or the run raises.
6.15A plain graph stops at 10007 steps, and each agent step is one model call or one tool call, so 25 steps allow 13 model calls.
7.1Three files become seven chunks and seven vectors once, then each search_docs call asks a retriever that searches the same in-memory store.
7.2A tool error becomes an error ToolMessage and the run goes on, but a slow tool has no timeout and a server crash aborts the run.
7.3A deep agent adds two hook nodes around the usual loop, and its tools node lists add, execute, and eight built-in tools.
7.4At 0.7.38 a deep agent gets seven file tools and a task tool, a files channel in state, and two middleware nodes, with no todo list.
7.5On Qwen3 4B the default deep agent used its own file tools in 18 of 20 runs and failed 17, and FilesystemBackend restored the plain score.
7.6The eval tool did not raise the pass count on any of four models, and it raised the prompt tokens by a factor of 1.8 to 2.6.
7.7With a prompt that asks for eval, Haiku used it in 12 of 39 runs, and the cell cost $0.038 against $0.028 for the same pass count.
7.8create_agent sent the same prompt tokens as a plain loop on every call, and Deep Agents added 2,075 to 2,251 tokens to each call.
7.9At list price a deep agent cost three times the plain loop on Claude, and with prompt caching 1.16 times on Haiku and 1.24 on Sonnet.
7.10Every call of the main agent sent more than 3,600 prompt tokens, and the editor calls sent about half that, with two tools fewer.
7.11One create_agent run of Qwen3 4B is a LangGraph root with 6 child runs, and its two model calls take 3.33 s and 2.79 s of 6.13 s.
7.12A traceable function in a local context keeps its run tree, an agent in the same context sends 14 requests, and enabled=False with collect_runs sends none.
7.13Tracing raised the median time outside the model from 17.7 ms to 26.3 ms, 7.4 ms in pairs, about 1.1 ms for each of seven traced runs.
7.14Every agent run answered in every case, a failing endpoint held the exit for 9.9 to 17.1 seconds, and a hanging one kept the process alive.
7.15With upload_results=False and the kit client, a plain function sends nothing, while a create_agent target sends its seven LangChain runs.
8.1With Qwen3 4B on CPU, throughput stayed at 0.22 runs per second from 4 clients up, with 1 or 10 jobs per worker.
8.2reject refused run B, enqueue ran it after A, interrupt stopped A and lost its unfinished node, and rollback deleted A.
8.3A message is one POST runs/stream with three stream modes, the approval returns in a values event, and Approve is a second POST with command.resume.
8.4In a real run of 1.8 s, create_agent spent 37.6 ms outside the model against 25.1 ms for a plain openai loop, and a hand-built StateGraph 36.7 ms.
8.5At four boundaries our test input passed the default, and one change stopped it: three settings, and a check in your code for the store prefix.
8.6Every call that slipped past a docs rule list was on a dotfile, and rules with dot patterns stopped all 32 attack calls of two real models.
8.7Six of the seven failures raised nothing, and each fix in the right column comes from the section that documents the failure.
9.1Four hook nodes from three middleware sit around model, and ModelCallLimitMiddleware can end the run before or after the model call.
9.2The client read each tool call when its model call ended, and the approval request arrived as one interrupt event that ended the stream.
9.3With a comment line every 15 s, 0 of 200 requests timed out, against 48 sessions lost to read timeouts without it.
9.4Checkpoint rows carry only a thread id, so the owner check in the route and the user in the tool context are the only isolation.
9.5After the kill the approval was pending again, and the key at the tool turned the second approve into a replay with one refund row.
9.6The approved 0-cent proposal wrote a refund row in 6 of 6 runs before the checks and in 0 of 6 after them.
9.7The model.call spans held 60,354 of 76,076 billed input tokens, and the summarizer calls and the replaced replies made up the rest.
9.8The middleware handled each fault the same way on every model, and only the reply to the customer differed.
9.9Qwen3 4B and Qwen3 14B failed different cases of the same suite, and Claude Haiku 5.5 passed all 20 evals.
9.10More uvicorn workers did not raise throughput, because every run waited for the one Ollama server.
R.1At temperature 0 three runs of Qwen3 4B gave identical outcomes on all 30 tasks, and at temperature 0.7 five tasks changed between seeds.
R.2Cells of 99 tasks give intervals of 18 to 19 points, and cells of 30 tasks give intervals up to 34 points.

LangChain (Python): langchain, langchain-core, langgraph, deepagents, langsmith 1.5.0 · c2f4036 · 2026-11-11 · Edition 2026.11