Chapter 4.5 designed a coordinator and specialists. LangGraph gives that design an explicit execution shape.
Each specialist can be its own graph:
A specialist graph can be built and tested by itself, then added to the larger graph as one node.
This gives the team:
book_flight, whichever specialist proposes it.Specialists do not always need the same visibility.
| State choice | Meaning | Good fit |
|---|---|---|
| Shared state | Specialist reads and updates fields in the team's state. | Budget and final candidates |
| Private state | Specialist keeps its working notes inside its subgraph. | Raw search pages and discarded options |
| Summary return | Specialist exposes only a small result to the coordinator. | Top three fares with prices and times |
Private state keeps the top-level record smaller and reduces accidental coupling.
A handoff sends the next agent both:
The hotel agent starts with the correct remaining budget because the route and update travel together.
Conceptually, the handoff result looks like this:
return Command(
goto="hotel_agent",
update={"budget_left": 45_100},
)
The exact API depends on the installed LangGraph version. The design idea stays the same: routing and state change are one decision.
Some work is discovered only at run time.
Suppose the calendar contains three client meetings. The coordinator creates one branch per meeting:
The number of branches is not fixed in advance. It depends on how many meetings are found.
All branches can run at the same time because they are independent. Reducers merge their returned updates safely.
| Pattern | Shape | Paris example |
|---|---|---|
| Handoff | One agent passes control to another. | Flights settles cost, then hotel uses the remaining budget. |
| Fan-out | One node creates several parallel branches. | One meeting-planning branch per client. |
Use a handoff when the next specialist depends on the first result. Use fan-out when subtasks are independent.
Build each specialist as a tested subgraph, use handoffs for dependent work, and fan out independent runtime tasks in parallel.