Course Content
Agentic AI Patterns
9 sections · 50 lessons
How can multiple agents collaborate to solve complex real-world tasks?
What you need to know
The topologies
| Topology | How control flows | Good for | Watch out for |
|---|---|---|---|
| Supervisor (orchestrator-workers) | Lead delegates, workers report back | Research, broad analysis | Supervisor becomes a bottleneck |
| Hierarchical | Supervisors of supervisors | Very large tasks | Deep chains lose information |
| Handoff pipeline | Agent A finishes, passes to B | Stages needing different tools | Errors pass downstream |
| Swarm (peer handoff) | Any agent hands control to a peer | Conversational routing, like triage to billing | Ping-pong between agents |
| Debate or voting | Several attempts, judged or voted | High-stakes answers | Cost multiplies |
| Generator-critic | One produces, one reviews | Clear rubric exists | Critic without criteria adds noise |
What makes it work
- Typed contracts between agents: a schema for what a worker returns, not free chat.
- One owner of the final state and the final answer.
- Isolated worker contexts, so each works with a small, focused window, and the supervisor gets summaries.
- Budgets per worker, and a maximum number of handoffs.
- A deterministic merge step.
Cost
Every agent re-reads its own context on every step. Anthropic's engineering write-up on its multi-agent research feature reported such runs using roughly 15 times the tokens of a normal chat. Multi-agent pays off when the task's value justifies that, and when parallel work cuts time a lot.
Agents across organisations: A2A
MCP and A2A fit together: MCP connects an agent to its tools and data; A2A lets it delegate to another agent it cannot see inside.
A real-life example
A manufacturer's procurement system sources 200 industrial pumps.
- A supervisor agent owns the request and the final recommendation.
- Three vendor-research workers run in parallel, one per region. Each reads catalogues and past orders and returns a typed record: vendor, model, unit price, lead time, warranty, source links.
- Two large vendors expose their own quoting agents over A2A. The supervisor reads their Agent Cards, sends a quote task with quantity and delivery date, and receives the quote as an artifact. One vendor's task moves to input-required, asking for the flange specification, which the supervisor supplies from the request.
- A compliance critic checks every candidate against the approved-vendor list and the budget.
- The supervisor merges results with deterministic code: normalised cost per unit including GST and freight, sorted, and the top three sent to the buyer for approval.
Before the split, a single agent took 25 minutes and often ran out of context reading catalogues. The parallel design took 6 minutes and used about 2.5 times the tokens. For a purchase worth Rs 1.8 crore, that was clearly worth it; for office-supply orders the team kept the single agent.
Follow-up questions to expect
- "Supervisor or swarm?" — Supervisor when you need central control, a single plan and a clear owner. Swarm for conversational routing where the current specialist knows best who should take over.
- "How do you stop agents passing work back and forth forever?" — Cap handoffs, detect repeated handoffs between the same pair, and give the supervisor the final say.
- "MCP versus A2A?" — MCP is agent-to-tool: the agent calls functions and reads data. A2A is agent-to-agent: it delegates a task to an independent agent that runs its own reasoning.