Predicate Ventures

LangGraph Multi Agent: Production Patterns

·5 min read·langgraphmulti-agentagent-engineeringllm-orchestrationevaluation

Multi-agent systems fail in ways single prompts never do, and LangGraph gives you the control surface to manage those failures.

Blake Aber · Predicate Ventures


Most multi-agent demos work because the demo author knew the happy path. Production systems meet inputs the author never imagined, and that gap is where agent engineering actually lives.

LangGraph exists because agent control flow is a graph, not a chain. Nodes do work, edges decide what happens next, and state carries context between them. Once you accept that framing, the hard questions become concrete: who owns state, where do you evaluate, and what happens when a node returns garbage.

Orchestration as a State Machine

A LangGraph application is a directed graph with a shared state object. Each node reads state, does something, and returns a partial update. The framework merges updates and routes to the next node based on conditional edges.

This matters because it forces you to name your state explicitly. In a chain, state is implicit in the prompt history. In a graph, you declare a schema and every node agrees on it.

The common multi-agent topologies map cleanly onto this model.

Supervisor

A supervisor node reads the current state and decides which worker agent runs next. Workers return results, control flows back to the supervisor, and the loop continues until the supervisor emits a finish signal.

This pattern concentrates routing logic in one place. The cost is that the supervisor becomes a bottleneck and a single point of failure. If its routing prompt degrades, the whole system degrades.

Network

Agents call each other directly without a central router. This suits problems where specialists genuinely need to hand off peer to peer, but it multiplies the number of edges you have to reason about.

Most teams overestimate how often they need a network. Start with a supervisor and add direct edges only when you can name the specific handoff that requires them.

Hierarchy

Supervisors manage sub-graphs that are themselves supervised. This scales organizationally but compounds latency, since each layer adds a routing decision before any real work happens.

State and Memory

The state schema is the contract. Keep it small and typed. A bloated state object is the fastest way to confuse both the model and the engineer reading the trace three weeks later.

Separate two kinds of memory. Short-term memory is the state within a single run. Long-term memory persists across runs and usually lives in an external store you query from a node, not in the graph state itself.

Checkpointing is where LangGraph earns its place. Persisting state after each node lets you resume a failed run, inspect intermediate values, and implement human-in-the-loop pauses without rebuilding context from scratch.

Use checkpoints deliberately. They are not free, and writing state on every node adds storage and latency you should measure.

Evaluation

You cannot improve what you cannot measure, and multi-agent systems resist naive measurement because the output depends on a chain of decisions.

Evaluate at two levels. Component evaluation tests a single node in isolation: given this state, does the node return a correct update. Trajectory evaluation tests the whole path: given this input, did the graph reach an acceptable final state through an acceptable sequence of steps.

Component tests are cheap and catch regressions. Trajectory tests are expensive and catch the emergent failures that only appear when nodes interact.

Build a dataset of real traces, not synthetic ones. The inputs that break production are rarely the inputs you would invent at a desk. Replay them against new versions before you ship.

Score trajectories on more than final correctness. Track step count, tool-call accuracy, and how often the supervisor routes to a dead end. A system that reaches the right answer after twelve detours is a system about to blow its budget.

Guardrails

Guardrails belong at the edges of the graph and between nodes. Validate inputs before they enter state. Validate tool arguments before they execute. Validate outputs before they leave the system.

Structured output is your first guardrail. When a node must return a routing decision, constrain it to a fixed set of values and reject anything outside that set. A supervisor that can only emit known worker names cannot route to a nonexistent agent.

Add a loop limit. Cyclic graphs can run forever when two agents hand work back and forth. Set a maximum step count and treat hitting it as a failure to investigate, not a condition to ignore.

For actions with side effects, insert a human approval node. The checkpoint pauses the graph, a person reviews the pending action, and the run resumes or aborts based on that decision.

Cost and Failure Modes

Multi-agent systems are expensive by construction. Every routing decision is a model call, and the supervisor pattern means you pay for coordination on top of the work itself.

Three failure modes recur.

First, routing loops. The supervisor keeps selecting the same worker because the state never signals completion. The fix is an explicit done condition in state, not a cleverer prompt.

Second, context bloat. Each handoff appends to the running context until the model drowns in its own history. Summarize between stages and drop state fields that later nodes do not read.

Third, silent degradation. One worker starts returning lower-quality output, the supervisor accepts it, and the final result slips below threshold without any error firing. Only trajectory evaluation on real traces catches this.

Control cost the same way you control failures. Route to the smallest model that handles each node. Reserve the expensive model for the supervisor and the nodes that genuinely need it.

Where This Leaves You

LangGraph does not make multi-agent systems reliable. It gives you the control surface to make them reliable: explicit state, inspectable trajectories, checkpoints you can resume, and edges you can constrain.

The teams that succeed treat agents as software with a probabilistic core. They write schemas, build evaluation datasets from production, cap loops, and measure cost per run. The demo is the easy part. The graph is where the engineering starts.