learn-ai-agents-with-phoebe / Builder session 6 of 10
Learn AI Agents with Phoebe · Builder track · Session 6 of 10

Multi-agent systems

One agent that works beats five that impress. Tonight you learn the official split rule (it is stricter than you think), the only two multi-agent shapes the vendor guides actually name - manager and handoffs - and then you build a real manager crew over Daybreak: an analyst with query tools and a writer with none, exposed to a manager as two tools. About 30 lines of plain Python. You leave knowing exactly when many agents beat one, and how to say no when they do not.

🟠 Hands-on build-along Builder track · practitioners Python · Claude API + Ollama path
0-3 · Welcome 3-18 · Two shapes of many 18-42 · Build-along: a manager crew 42-45 · Q&A
Part 1 · covers OpenAI guide (when to split), Anthropic simplicity principle

Single-agent-first (really) 6 min live

OpenAI's guide is unambiguous: maximize a single agent's capabilities first. Multi-agent is not a maturity badge - it is a cost you pay only when one agent demonstrably cannot carry the task. Anthropic's essay says the same thing in one word: simplicity. Everything you built in b2-b5 was the "maximize" part; tonight you learn when it runs out.

LiveThe two split triggers4 min▶

Per the OpenAI guide, you split one agent into many when - and only when - one of these holds:

  • Complex conditional logic - the instructions have grown so many branching if-this-then-that paths that prompts become unmaintainable and the model starts missing branches.
  • Tool overload - and here is the subtle part: overlap matters more than count. Some agents manage 15+ distinct, clearly separated tools without trouble; others struggle under 10 whose descriptions blur into each other. If the model keeps picking the wrong-but-similar tool, splitting by domain gives each agent a small, unambiguous toolbox.

Neither trigger firing? Stay single. A bigger toolbox, better tool docs (b2's ACI craft), or a plan step (b5) is almost always the cheaper fix.

Real world

The org chart nobody can debug. Teams routinely jump to multi-agent for status - "we run a six-agent system" sounds better in a steering deck than "we run one good loop". What they inherit is N debugging surfaces: every agent boundary is a place where context gets lost, handoffs misfire, and no single trace shows the whole task. When something breaks, you now debug an organization, not a program. Split for a trigger, never for a slide.

Self-studyHow this rhymes with everything you already built2 min read▶

You have heard this melody before. b1: try a workflow before an agent. b3: the five workflow patterns hand over autonomy one notch at a time. b5: add planning only when one-shot answers fall short. Multi-agent is the same dial turned one more notch - and the same discipline applies: escalate deliberately, with a named reason. Your homework tonight literally asks you to write that reason down in one sentence before you are allowed to go multi.

Part 2 · covers OpenAI guide (multi-agent taxonomy), OpenAI SDK, Claude Agent SDK subagents

Manager vs handoffs - the two shapes 9 min live

The OpenAI guide names exactly two multi-agent patterns, and its SDK maps them 1:1 to primitives. Manager pattern: agents as tools - a central manager delegates via tool calls and synthesizes the results, staying the single point of user contact. Decentralized pattern: peer handoffs - one agent transfers execution plus the conversation state to another (triage → specialist), and the new agent takes over. Learn the two shapes and every framework's multi-agent story becomes familiar.

USER one contact point MANAGER agent decomposes · delegates synthesizes one answer ANALYST (a tool) query tools · numbers WRITER (a tool) no tools · prose next specialist slot homework: subscriptions tool call out result back Specialists never talk to the user. The manager is the single point of contact and owns the final answer. Each specialist is an agent exposed as a tool: OpenAI SDK "agents as tools"; Claude Agent SDK ships subagents.
🔍 Click to zoom - the manager pattern: agents as tools behind one synthesizing manager
USER "fix my invoice" TRIAGE agent classifies the request, then steps aside BILLING specialist now owns execution and the conversation HANDOFF WHAT TRANSFERS in a handoff execution + the conversation state so far - the specialist picks up mid-conversation, not from zero specialist replies to the user directly Decentralized pattern: peers transfer work among themselves; no central synthesizer (OpenAI guide). Maps 1:1 to the OpenAI SDK "handoff" primitive - just as manager maps to "agents as tools".
🔍 Click to zoom - the decentralized pattern: a handoff transfers execution plus conversation state
LiveWhy multi wins, when it wins3 min▶

When a split trigger genuinely fires, many agents buy you three things one agent cannot:

  • Context isolation - each specialist gets a clean context window for its sub-task instead of wading through everything the whole job has accumulated. This is b4's lesson wearing a new coat: protect the context, protect the agent.
  • Parallelism - independent sub-tasks (the analyst pulling June numbers, another specialist pulling ticket themes) can run at the same time instead of in sequence.
  • Separation of permissions - the writer has no tools at all, so it cannot touch data; only the analyst can query, and nobody here can send email. Smaller toolboxes per agent mean smaller blast radius - which is exactly where b7's guardrails pick up.
Self-studyWhere the two shapes live in the SDKs3 min read▶

The taxonomy is not abstract - it ships as primitives you can import:

  • OpenAI Agents SDK - its named primitives include Agents, Handoffs, Guardrails, Sessions, Tracing. "Agents as tools" gives you the manager pattern; "handoffs" gives you the decentralized one. Guide and SDK map 1:1.
  • Claude Agent SDK - ships subagents as a primitive alongside built-in tools, hooks, MCP, permissions, sessions, skills and plugins. A subagent is the manager shape: a specialist the parent invokes and whose result it synthesizes.
  • LangGraph - subgraphs let you nest one graph inside another, which is how it expresses specialist crews. Positioning lesson in b9.
  • crewAI - the "Practical Multi AI Agents" short course builds whole crews this way; same two shapes underneath.
Build-along

The Daybreak review crew ★ 24 min · everyone builds

The founder wants the June monthly review written. That is two different skills: pulling correct numbers (needs the query tools) and writing clean prose (needs none). Perfect manager-pattern shape: an analyst agent and a writer agent, each a plain Python function, exposed to a manager as two tools. The manager is just b2's loop - the only new idea is that behind two of the tool names sits another agent.

Define the two specialists as functions. The analyst reuses your b2 loop with the Daybreak query tools; the writer is a single messages.create call with no tools at all.

Describe each specialist to the manager as a tool - ask_analyst and ask_writer - with honest descriptions. Tool docs are the ACI (b2); a manager routing between agents lives or dies by them.

Run it on "Write the June 2026 monthly review." Watch the manager decompose: it calls ask_analyst first, the analyst runs query_sales("2026-06") and reports June completed revenue of $168, then the manager hands that brief to ask_writer and synthesizes the final review.

Confirm the separation of permissions: the writer never saw a database, the analyst never wrote prose, and only the manager spoke to the user.

LiveThe whole crew in ~30 lines10 min▶
# the Daybreak review crew - manager pattern
import anthropic
client = anthropic.Anthropic()

def analyst(task: str) -> str:
    """Specialist 1: has the Daybreak query tools (your b2 loop, reused)."""
    return run_loop(                     # the tool loop you built in b2
        system="You are Daybreak's analyst. Report tool-verified numbers only.",
        tools=DAYBREAK_TOOLS,            # query_sales · top_products · subscription_status
        user=task)

def writer(brief: str) -> str:
    """Specialist 2: no tools - turns the analyst's brief into prose."""
    msg = client.messages.create(
        model="claude-opus-5", max_tokens=1024,
        system="You write Daybreak's monthly reviews. Use only numbers from the brief.",
        messages=[{"role": "user", "content": brief}])
    return msg.content[0].text

CREW = {"ask_analyst": analyst, "ask_writer": writer}
MANAGER_TOOLS = [
    {"name": "ask_analyst",
     "description": "Delegate a numbers question. Returns tool-verified Daybreak figures.",
     "input_schema": {"type": "object",
                      "properties": {"task": {"type": "string"}}, "required": ["task"]}},
    {"name": "ask_writer",
     "description": "Delegate prose. Give it every number it needs - it has no tools.",
     "input_schema": {"type": "object",
                      "properties": {"brief": {"type": "string"}}, "required": ["brief"]}},
]

# the manager is just b2's loop - two of its "tools" happen to be agents
messages = [{"role": "user", "content": "Write the June 2026 monthly review."}]
while True:
    r = client.messages.create(
        model="claude-opus-5", max_tokens=2048,
        system="You are the Daybreak review manager. Delegate, then synthesize one answer.",
        tools=MANAGER_TOOLS, messages=messages)
    if r.stop_reason != "tool_use":
        break                            # no more delegation - the review is done
    messages.append({"role": "assistant", "content": r.content})
    messages.append({"role": "user", "content": [
        {"type": "tool_result", "tool_use_id": b.id,
         "content": CREW[b.name](**b.input)}   # the "tool" runs a whole agent
        for b in r.content if b.type == "tool_use"]})
print(r.content[0].text)

Read the last comment twice: the "tool" runs a whole agent. That single line is the entire manager pattern. Everything else on this page you already built in b2.

Self-studyContrast: b3's chaining did this same job3 min read▶

Honesty check: "write the June review" can also be done with b3's prompt chaining workflow - step 1 query, step 2 write, in fixed order, no manager deciding anything. For this exact task the fixed pipeline is cheaper, fully predictable, and easier to test - when the fixed pipeline is enough, prefer it. The manager earns its keep only when the decomposition varies per request: "compare June to May and only interview the analyst twice if something looks off" is where a fixed chain starts sprouting the conditional logic that triggers the split. Same discipline as b1: autonomy is bought, not free.

Naming the shapes in the wild Orchestrator-workers (b3) at the agent level IS the manager pattern - the orchestrator became an agent and the workers became agents-as-tools. When a vendor demo says "supervisor", "crew", or "subagents", ask one question: does one agent synthesize (manager) or does control transfer (handoff)? There is no third shape in the official guides.
Homework

Try it yourself - this week ◐ 30-40 min total

Source material

Official sources covered

Certificates, videos, and graded assessments stay on the official sites - this page teaches the working core. Tonight covers:

✓OpenAI "A Practical Guide to Building Agents" - multi-agent sectionManager vs decentralized taxonomy · single-agent-first rule · the two split triggers
✓OpenAI Agents SDK - handoffs + agents-as-toolsThe two patterns as importable primitives, mapped 1:1 to the guide
◐Claude Agent SDK - subagentsSubagents as a shipped primitive; full SDK positioning lands in b9
◐DLAI "Practical Multi AI Agents" (crewAI)Crews at scale - same two shapes underneath; framework tour in b9
◐DeepLearning.AI "Agentic AI" (Ng) - Module 5Multi-agent communication as the fourth pattern of the agentic canon
◐LangGraph - subgraphsHow graph frameworks express specialist crews; positioning in b9
Check yourself

Three questions before you go 🎯 ◐ 90 seconds

1 · The OpenAI guide names exactly two multi-agent shapes. Which pair?

Manager: a central agent delegates via tool calls, synthesizes, and stays the single point of user contact. Decentralized: peers hand work to each other. Every vendor framework's multi-agent story is one of these two.

2 · In the decentralized pattern, what exactly does a handoff transfer?

A handoff transfers execution AND conversation state (triage → specialist). That is what separates it from the manager pattern, where control never leaves the manager and specialists only see the sub-task they were delegated.

3 · When does the OpenAI guide say to split one agent into many?

Maximize a single agent first. Split on unmaintainable branching logic or on overlapping, confusable tools - some agents handle 15+ distinct tools fine while others struggle under 10 overlapping ones. Raw tool count is not the trigger.

Builder session 6 cheat sheet · pin this

The ruleMaximize a single agent's capabilities first (OpenAI guide). Multi-agent is a cost, not a badge.
Split triggersComplex conditional logic · tool overload - overlap matters more than count (15+ distinct fine; 10 overlapping can fail).
Manager patternAgents as tools. Central manager delegates via tool calls, synthesizes, single point of user contact.
Decentralized patternPeer handoffs transfer execution + conversation state (triage → specialist). New agent takes over.
SDK mappingOpenAI SDK: agents-as-tools + handoffs, 1:1 with the guide. Claude Agent SDK: subagents as a primitive.
Why multi winsContext isolation (clean window per specialist, b4) · parallelism · separation of permissions (b7).
The crew buildAnalyst (query tools) + writer (no tools) behind a manager - b2's loop where two tools run whole agents.
Honesty checkIf a fixed pipeline (b3 chaining) does the job, prefer it. Write the one-sentence split justification first.