Module 2 · Agentic architecture and orchestration · Chapter 4
Coordinator and subagents: hub-and-spoke orchestration that covers the whole topic
Independent exam preparation. Not affiliated with or endorsed by Anthropic.
- One coordinator splits the job, hands pieces to subagents, collects results and decides what next. Subagents never talk to each other.
- A subagent starts blank, seeing only its brief.
- The coordinator owns coverage. Split too narrowly and every subagent can do perfect work while the report stays wrong.
The picture: one hub, many spokes, no side roads.
Orchestrate multi-agent systems with coordinator-subagent patterns (Domain 1, 27 percent). You should be able to:
- Explain why all subagent communication goes through the coordinator.
- State that subagents have isolated context.
- Pick only the subagents a query needs.
- Split scope to avoid duplicate work, and spot a too-narrow split.
- Build a refinement loop: check gaps, send targeted work, resynthesize.
New to the single-agent loop underneath this? Read chapter 3 first.
- The hub-and-spoke picture.
- Why subagents start blank.
- Choosing which subagents to call.
- Splitting the topic.
- The refinement loop, and costs.
- Build and check coverage.
Step 1: One hub, many spokes
Like an airline hub, all flights pass through the middle. Three jobs:
- Decompose. Break the question into pieces covering the topic.
- Delegate. Send each piece to a subagent, with a clear brief.
- Aggregate. Collect results, find gaps, handle errors.
- Only the coordinator hears the buyer's question, so one place tracks the run.
- The coordinator splits the topic: US demand, Canadian demand, lead times. This decides coverage.
- It calls web search and document analysis, each with its own brief. Subagents start blank.
- Findings return to the coordinator, not sideways, so it logs them and handles failures one way.
- The coordinator passes findings to synthesis, its only way to see them.
- The coordinator checks the draft against its list. Canada missing? It sends a targeted search, then synthesizes again.
- Coverage enough? The report subagent writes the final document.
- Direct calls hide errors and data from the coordinator.
Where the picture breaks down:
- The coordinator calls only the subagents needed.
- Real runs may loop between steps 3 and 6.
- A poor plan cannot be repaired by any spoke.
Next: what does a subagent actually know when it starts?
Step 2: Subagents start blank
A subagent is a contractor on day one: fresh context, no share of the coordinator's history. A good brief has:
- The exact piece it owns, and what to leave alone.
- Facts the coordinator already has, such as sources found.
- The output format, so results merge cleanly.
"Look into tent demand" is a weak brief: the subagent picks its own scope and may repeat others. Isolation helps too: long tool output stays in the subagent; only a short result returns. Rule: if the subagent needs it, put it in the brief.
Next: should every question wake every subagent?
Step 3: Call only the subagents the question needs
A coordinator that always runs the full pipeline is a fixed workflow in disguise, and wastes money.
- "List price of the Alder 2 tent?" needs web search only.
- "Summarize these two contracts" needs document analysis only.
- "Full report on tent demand" needs the whole chain.
It may even answer alone. The rules live in its system prompt: what each subagent is for, and when to skip it.
Do this: walk the tree for a price lookup, restart for a broad report, then try "I am not sure".
What to notice: three of four paths skip a subagent, and the unsure path starts small. Prompt rules can be wrong, so test on real questions.
Next: how to slice a broad topic.
Step 4: Split the topic so nothing overlaps and nothing is missing
- Overlap. Three subagents search the same query and fetch the same pages: you pay three times. Fix: a distinct subtopic or source type each.
- Gaps. The pieces are distinct but miss a whole area: the October failure. Fix: the coordinator first writes a checklist of what "the whole topic" means.
For ultralight tents: US demand, Canadian demand, specialty shops, online marketplaces, supplier lead times, price trends. Every task maps to an item, so unowned items show up.
The checklist itself can be too narrow. Have the coordinator consider regions, channels, time frames and source types first.
Next: a good split can still miss. The fix: a loop at the hub.
Step 5: The refinement loop and why all traffic goes through the hub
- Run round one of search and analysis, then synthesize.
- Compare the draft with the checklist and list gaps.
- Send a targeted query per gap (for example, "Canadian specialty-shop sales, last 12 months").
- Synthesize again. Repeat until coverage is enough or the round limit (2 or 3) hits.
Without a limit, a weak gap check can loop forever and burn money. Why must all traffic pass through the hub?
- Observability. One log, every request and result.
- Consistent errors. One policy: timeouts, empty results.
- Controlled flow. The hub decides who gets what.
The coordinator owns the plan. A subagent searches what it is told to search. The report subagent sees only the findings it is given, so it cannot know Canada was left out. The fix: a broader checklist and a gap check at the hub.
Next: numbers: what selective calling and a second round cost.
Step 6: Worked example with real numbers
All numbers made up. Price: $3 per million input tokens, $15 per million output tokens.
Full pipeline run:
- Coordinator, 8,000 in, 1,000 out: 0.024 + 0.015 = $0.039.
- Web search, 30,000 in and 3,000 out: 0.090 + 0.045 = $0.135.
- Document analysis, 20,000 in and 2,000 out: 0.060 + 0.030 = $0.090.
- Synthesis, 12,000 in and 2,500 out: 0.036 + 0.0375 = $0.0735.
- Report, 6,000 in and 3,000 out: 0.018 + 0.045 = $0.063.
- Total: $0.4005, about $0.40.
Simple price lookup: coordinator $0.039 + web search (10,000 in, 1,000 out) $0.045 = $0.084. The full chain costs $0.4005 / $0.084, about 4.8 times more. At 200 lookups a month: $80.10 against $16.80, saving $63.30.
Overlap: three searches at 12 pages each: 36 fetches, 21 unique, 15 duplicate. About 42% wasted.
Refinement round for the Canada gap: gap check $0.039 + three searches at $0.045 = $0.135 + second synthesis $0.0735 = $0.2475, about $0.25.
So: an extra round, about $0.25. October's miss: $64,000.
0.4005 / 0.084 is about 4.8, so about 5 times. Always-on pipelines multiply cost on easy questions, and add wait time too.
Next: two short cases, then the lab.
Step 7: Two cases and the mix-ups to avoid
Mix-ups to avoid
- "Subagents see what the coordinator saw." No, only their brief.
- "Let subagents message each other." It hides errors and flow from the one component that can manage them.
- "If every subagent succeeds, the report is complete." No. Completeness is the coordinator's job.
- "Always run every subagent." About 5 times the cost on simple questions.
- "More rounds are always better." Cap and log them.
Next: build it.
Step 8: Hands-on lab
Lab: The Step 6 worked example, as a model you can drive. This lab runs in your browser and needs JavaScript enabled.
Chapter quiz
Five scenario questions. Score 70% or more to pass.
Review this chapter in 5 minutes
Watch the whole chapter recapped: hub and spoke orchestration, blank subagents, gap free splits and the refinement loop.
- Hub and spoke. The coordinator decomposes, delegates, aggregates. Subagents never call each other.
- Central routing. One log, one error policy, control over what each subagent sees.
- Isolated context. A subagent sees only its brief.
- Dynamic selection. Full chain $0.40 against $0.084 for a lookup: about 5 times more.
- Partition scope. Distinct subtopics per subagent. Same query three times wasted about 42% of fetches.
- Refinement loop. Check gaps, send targeted queries, synthesize again, cap rounds. One round: about $0.25.
Decision rule: never researched? Fix the plan and gap check. Brief misused? Fix the brief.
Review
Glossary
- Coordinator
- The agent that plans, delegates, merges.
- Subagent
- A worker agent for one bounded task.
- Hub-and-spoke
- All messages pass through one hub.
- Isolated context
- A subagent's fresh memory, no coordinator history.
- Brief
- The task text written for a subagent.
- Decomposition
- Splitting a big question into tasks.
- Aggregation
- Combining several subagents' results.
- Dynamic selection
- Choosing subagents based on the question.
- Partitioning
- Each subagent gets a distinct slice of scope.
- Coverage gap
- A required subtopic no finding addresses.
- Refinement loop
- Check gaps, send targeted work, resynthesize.
- Observability
- Seeing and replaying what happened.
Next: "Spawn subagents and pass context: the Task tool, AgentDefinition and parallel calls".