Module 5: Multi-Agent & MCP Standards · 2h
01 · UNDERSTAND
Day 24 Theory — Multi-Agent Systems: Only When One Agent Is Not Enough
What “multi-agent” should mean
A multi-agent system contains multiple agent runtimes or agent-like specialists with distinct responsibilities and communication boundaries.
It should not simply mean “we gave three names to three prompts.”
Why multiple agents can help
Possible reasons include:
- strong domain specialization,
- different tool/permission sets,
- independent ownership boundaries,
- parallel investigation,
- reusable specialist services.
For example, a security specialist may have different tools and approval rules from a general support agent.
The coordination cost
Every additional agent creates new questions:
- who owns the task,
- who can call whom,
- how context is shared,
- how loops terminate,
- how failures propagate,
- how permissions are isolated,
- how cost is attributed.
Multi-agent designs can be less reliable than a well-structured single agent if these boundaries are unclear.
Handoffs versus delegation
A handoff transfers active responsibility.
A delegation/tool call asks a specialist for a bounded result while the caller remains responsible.
These patterns produce different state and UX semantics.
Shared context is not automatically safe
Giving every agent the full conversation and every tool is convenient but destroys isolation.
Prefer least-privilege context and capability sharing.
Prevent circular delegation
Agent A can hand to B, B to C, and C back to A.
Use bounded handoff/turn limits and explicit ownership rules.
Service Desk connection
Today we decide where specialization genuinely helps the Service Desk and where it would merely add orchestration cost.
The principle is:
Use multiple agents only when specialization or ownership boundaries justify the extra coordination, security and observability complexity.
02 · APPLY
Lesson Overview
This is the applied companion for Day 24. Read DAY_24_THEORY.md first for the beginner-first teaching of Multi-Agent Systems: Only When One Agent Is Not Enough. Then use the real service-desk-day-24/ project to trace, run, debug, and explain the concept.
Service Desk Alignment
Day 24 adds Multi-Agent Systems: Only When One Agent Is Not Enough to the running Service Desk. Start with shared_state.py, tools.py, benchmark.py, supervisor.py, mock_model.py, specialists.py, then follow imports and tests to identify the actual runtime path.
Why This Topic Matters
The theory chapter explains why Multi-Agent Systems: Only When One Agent Is Not Enough is needed. Here the goal is evidence: identify where the capability is implemented, what observable behavior changes, and how the repository proves both success and failure behavior.
System Architecture
This is a repository surface map, not a claim that modules call each other in the displayed order. The modules are ranked by relevance to today's theory.
graph LR
T[Day 24: Multi-Agent Systems - Only When One Agent Is Not Enough]
T --> M1[shared_state.py]
T --> M2[tools.py]
T --> M3[benchmark.py]
T --> M4[supervisor.py]
T --> M5[mock_model.py]
T --> M6[specialists.py]
T --> M7[single_agent.py]
T --> M8[models.py]
Follow imports and tests to discover the actual runtime flow.
Repository Implementation Map
Use the real Day 24 repository, not a fabricated sample, to connect theory to implementation.
Theory concepts to locate:
- What “multi-agent” should mean
- Why multiple agents can help
- The coordination cost
- Handoffs versus delegation
Most relevant implementation modules first:
service_desk/shared_state.pyservice_desk/tools.pyservice_desk/benchmark.pyservice_desk/supervisor.pyservice_desk/mock_model.pyservice_desk/specialists.pyservice_desk/single_agent.pyservice_desk/models.py
Follow imports/calls from the relevant module and confirm behavior in tests. Record input → mechanism → observable output/state → failure evidence.
Code Walkthrough & Mechanics
Read shared_state.py, tools.py, benchmark.py, supervisor.py, mock_model.py, specialists.py, single_agent.py, models.py with these theory sections beside you:
- What “multi-agent” should mean — locate its implementation and evidence.
- Why multiple agents can help — locate its implementation and evidence.
- The coordination cost — locate its implementation and evidence.
- Handoffs versus delegation — locate its implementation and evidence.
- Shared context is not automatically safe — locate its implementation and evidence.
For each concept identify the real function/class/protocol boundary, its input/state, its observable result, and the assertion in tests/test_multi_agent.py that proves the behavior. If a concept has no implementation or evidence, record that as a gap rather than inventing one.
Common Mistakes & Debugging Guidance
Use the theory—not generic timeout or .env advice—to decide what can fail today.
Failure lens: revisit Handoffs versus delegation, Shared context is not automatically safe.
- Reproduce the smallest case that violates one of those expectations.
- Trace the real Day 24 modules until you find the first incorrect state/output/decision.
- Use
tests/test_multi_agent.pyas executable evidence. - Add a regression test if the failure is not already represented.
- Fix the smallest responsible boundary and rerun the relevant test before the full suite.
Your debugging explanation must name the topic-specific invariant that failed, not merely say “an exception occurred.”
Practical Lab Instructions
- Summarize these theory ideas before opening the implementation:
- What “multi-agent” should mean
- Why multiple agents can help
- The coordination cost
- Handoffs versus delegation
- Inspect the most relevant real Day 24 modules first:
service_desk/shared_state.pyservice_desk/tools.pyservice_desk/benchmark.pyservice_desk/supervisor.pyservice_desk/mock_model.pyservice_desk/specialists.pyservice_desk/single_agent.pyservice_desk/models.py
- Inspect the automated evidence:
tests/test_multi_agent.py
- Establish the baseline:
cd service-desk-day-24 PYTHONPATH=. pytest tests/test_multi_agent.py -q - Trace one theory concept through the actual nested modules and tests.
- Run one success case and record input → mechanism → observable result.
- Exercise one topic-specific failure/boundary case and name the invariant that protects the system.
- Re-run the relevant tests and explain theory → implementation → evidence.
Done when: another student can reproduce your trace without relying on an invented sample.
Key Takeaways
- Be able to explain What “multi-agent” should mean and point to its implementation/evidence in Day 24.
- Be able to explain Why multiple agents can help and point to its implementation/evidence in Day 24.
- Be able to explain The coordination cost and point to its implementation/evidence in Day 24.
Knowledge Check & Scenario Questions
- Concept: Using What “multi-agent” should mean, explain the engineering problem Day 24 is solving without naming a framework as the answer.
- Mechanism: How does Why multiple agents can help appear in the real project? Start from
service_desk/shared_state.pyand name the observable state/output/event that changes. - Failure: For The coordination cost, describe one incorrect implementation or boundary condition and the evidence you would expect in
tests/test_multi_agent.py. - Design review: Which assumption in today's design would you verify before reusing this implementation in a different production system?
Official References
- LangGraph Multi-Agent Workflows: https://langchain-ai.github.io/langgraph/concepts/multi_agent/
- Building Effective Agents (Anthropic): https://www.anthropic.com/research/building-effective-agents
03 · EXPLAIN
Interview checkpoint
Explain one design decision from this lesson, the alternative you rejected, and the failure mode or evidence that justified your choice.