Part III — Graphs in Production

A graph that makes good decisions on your laptop is not yet something anyone can depend on. This part is about closing that distance: nodes that fail and retry without corrupting state, the graph served over HTTP, the async door and what overlapping waits is worth, a tracer you build yourself so you can see where time and tokens go, external tools reached over MCP, and the storage machinery beneath checkpoints laid open. On top of that we build the stages of a retrieval-augmented generation pipeline, one chapter each — chunking, reranking, query rewriting, versioned indexes, a golden layer, and an evaluation harness that fails the build when a score falls below the bar you set — and shows you the case-by-case regressions an average can still hide.

This is also where the book slows down to look inside. Several chapters are as much about why LangGraph behaves the way it does as about what to type — the internals and hard-won gotchas that turn “it works on my machine” into “it works.”

What this part will do

Finish this part and you can build a minimal running model of each production mechanism: a graph that survives a failing node, answers over HTTP, reports where its time went, reaches a tool in another process, and refuses to ship when a quality score misses its threshold. That is a real skill and it is not a system you can put in front of users. The hardening this part deliberately leaves out is the subject of its closing chapter, Before You Ship (33  Before You Ship): authentication, rate limits, secret handling, tool sandboxing, cost ceilings, and everything about deployment beyond the one mechanism 30  Versioning & Blue-Green demonstrates on a local cluster. That chapter also covers the other thing a green evaluation does not prove — which path a run took to reach its answer. Read it early if you are tempted to deploy something from these chapters.

Two halves, and why the second is there. Chapters 19 to 24 are about the graph as a thing that runs for other people: how it fails and retries without corrupting state (21  Error Handling), how it answers over HTTP and survives a client that goes away (22  Serving over HTTP), how you see where its time and tokens went (24  Observability), how it reaches a tool in another process (25  MCP: External Tools), and what the checkpointer actually writes to disk (26  Inside Persistence). Then the book changes subject — or seems to. Chapters 25 to 30 build a retrieval pipeline, one stage per chapter, and the reason is not that this is a RAG book. It is that a RAG pipeline is the hardest ordinary thing to run: it has an index that changes under you (30  Versioning & Blue-Green puts persistence and blue-green serving under real load), a quality that drifts without any code changing (32  Evaluation Harness gives observability a number to regress on), and a model in the loop whose judgement you have to check rather than trust (31  The Golden Layer, Metric 2: answer quality, judged by a model). Read the second half as the first half’s integration test. If retrieval is not your problem, read Chapters 25 to 30 for the mechanisms they exercise and go on to 33  Before You Ship, which is where every seam is named.

One chapter, one mechanism. Each of these builds the smallest graph that shows its own thing.

flowchart LR
    A["Ch21<br/>HTTP endpoint"]:::demo
    B["Ch22<br/>tracer"]:::demo
    C["Ch23<br/>MCP client"]:::demo
    D["Ch24<br/>checkpoint internals"]:::demo
    E["Ch25–30<br/>RAG pipeline<br/>+ ship checks"]:::demo
    classDef demo fill:#fff,stroke:#333,stroke-width:1px;

One setup note before you dive in. Part III leans on more packages than Parts I and II did — FastAPI and Uvicorn to serve the graph over HTTP, mcp and langchain-mcp-adapters for external tools, Chroma (chromadb, langchain-chroma) with langchain-text-splitters for the RAG pipeline. Install them as a set from the companion repo’s requirements.txt rather than one at a time. That keeps their versions consistent with the langchain-core the rest of the book pins: installing the latest of any one package can quietly drag core past the version Chapter 0 checked for.

pip install -r requirements.txt

With the set installed, the imports in each chapter just work when you reach them.