After this lesson you'll know
- When to use multi-agent vs single-agent (the decision framework)
- Four multi-agent topologies (supervisor, pipeline, debate, swarm)
- Inter-agent communication patterns
- How the CCA exam evaluates multi-agent design decisions
When to Use Multiple Agents
The exam's most common trap: candidates choose multi-agent when single-agent is sufficient. Multi-agent adds complexity. You need to justify that complexity.
Decision Framework
USE SINGLE AGENT when:
β Task is sequential (step 1 β step 2 β step 3)
β One domain of expertise needed
β Shared context is critical (all steps need same information)
β Simple error recovery (retry the failed step)
USE MULTI-AGENT when:
β Tasks are parallelizable (independent work items)
β Different domains of expertise needed (legal + technical + creative)
β Adversarial review required (one agent checks another's work)
β Scale demands it (100 items to process simultaneously)
β Isolation required (one agent's failure shouldn't crash others)
Four Multi-Agent Topologies
1. Supervisor Pattern
ββββββββββββ
βSUPERVISORβ β orchestrates, delegates, reviews
ββββββ¬ββββββ
βββββββΌββββββ
βΌ βΌ βΌ
ββββββββββββββββββββββββ
βWorkerββWorkerββWorkerβ β specialized agents
β A ββ B ββ C β
ββββββββββββββββββββββββ
USE WHEN: Clear hierarchy. Workers have different specializations.
Supervisor maintains global context and quality.
EXAM EXAMPLE: Code review system
- Supervisor: assigns files to reviewers, aggregates feedback
- Worker A: security review
- Worker B: performance review
- Worker C: style/consistency review
2. Pipeline Pattern
ββββββββ ββββββββ ββββββββ ββββββββ
βAgent βββββΆβAgent βββββΆβAgent βββββΆβAgent β
β 1 β β 2 β β 3 β β 4 β
ββββββββ ββββββββ ββββββββ ββββββββ
Research β Draft β Review β Publish
USE WHEN: Sequential processing where each stage transforms output.
Each agent adds value to the previous agent's output.
EXAM EXAMPLE: Content pipeline
- Agent 1: Research topic (web search, data gathering)
- Agent 2: Write draft (content generation)
- Agent 3: Review and edit (quality check)
- Agent 4: Format and publish (deployment)
3. Debate Pattern
ββββββββ ββββββββ
βAgent ββββββββββΆβAgent β
β A β debate β B β
ββββ¬ββββ ββββ¬ββββ
β β
ββββββββββ¬βββββββββ
βΌ
ββββββββββββ
β JUDGE β β picks best argument
ββββββββββββ
USE WHEN: High-stakes decisions where you want adversarial thinking.
Reduces bias by forcing opposing viewpoints.
EXAM EXAMPLE: Investment analysis
- Agent A: argues FOR the investment (bull case)
- Agent B: argues AGAINST (bear case)
- Judge: weighs both arguments, makes decision
4. Swarm Pattern
ββββββββ ββββββββ ββββββββ ββββββββ
βAgent β βAgent β βAgent β βAgent β
β 1 β β 2 β β 3 β β N β
ββββ¬ββββ ββββ¬ββββ ββββ¬ββββ ββββ¬ββββ
β β β β
ββββββββββ΄βββββββββ΄βββββββββ
β
βββββββββββ
β SHARED β β shared state/message bus
β STATE β
βββββββββββ
USE WHEN: Many identical tasks, homogeneous agents, scale-out.
Each agent works independently on its portion.
EXAM EXAMPLE: Processing 1000 support tickets
- N identical agents each handle a subset
- Shared state tracks which tickets are claimed
- No coordination needed beyond "claim" mechanism
Inter-Agent Communication
How agents talk to each other matters. The exam tests three communication patterns:
Direct Message Passing
# Agent A sends result directly to Agent B
result_a = await agent_a.run(task)
result_b = await agent_b.run(result_a.output) # pipeline
Pros: Simple, clear data flow. Cons: Tight coupling.
Shared Memory (Blackboard)
# Agents read/write to shared state
brain.write("research_findings", agent_research.output)
# Later...
findings = brain.read("research_findings")
draft = await agent_writer.run(findings)
Pros: Loose coupling, agents don't know about each other. Cons: Coordination complexity.
Event Bus
# Agents publish/subscribe to events
@on_event("research_complete")
async def handle_research(event):
await agent_writer.run(event.data)
Pros: Fully decoupled, scalable. Cons: Harder to debug, eventual consistency.
Exam Scenario Practice
Scenario
You're building a system to process incoming legal documents. The system must: (1) classify the document type, (2) extract key entities, (3) check for compliance issues, (4) generate a summary. Documents arrive at ~100/hour. Processing each takes 30 seconds. Which multi-agent topology is most appropriate?
A) Single agent processing sequentially
B) Supervisor with 4 specialized workers
C) Pipeline: classify β extract β compliance β summarize
D) Swarm of identical agents with shared queue
Answer: C (Pipeline).
Why: The steps are sequential (each depends on the previous), each step is a different specialization, and the throughput requirement (100/hr at 30s each = 1-2 concurrent needed) doesn't require massive parallelism. Pipeline gives clear data flow with stage-specific error handling.
Why not D: Swarm is for identical parallel work. These steps are sequential and specialized. Why not B: Supervisor adds coordination overhead for what is fundamentally a pipeline. Why not A: At 100/hr, a single agent processing at 30s/doc is borderline β pipeline allows stage-level parallelism if needed.
Key Takeaways
- Don't over-architect. Single agent with tools beats multi-agent for most problems.
- Match topology to problem. Supervisor for hierarchy, pipeline for stages, debate for decisions, swarm for scale.
- Communication pattern matters. Shared memory (brain) for persistence. Direct passing for pipelines. Events for loose coupling.
- The exam tests judgment. "Why this pattern?" is more important than "what does this pattern do?"
Quick Check
1A startup needs to process 10 customer emails per day. Each email needs: read β classify β respond. Which architecture?