Why multiple agents?
- Focus — short, specific instructions are followed more reliably.
- Modularity — test, swap or upgrade one specialist without touching the others.
- Least privilege — give each agent only the tools it needs.
- Parallelism — independent specialists can run at the same time.
The trade-off: more model calls (cost/latency) and the need to coordinate. That's what orchestration solves.
Designing specialised agents
Give every agent a name, a one-line description (other agents and orchestrators read it) and narrow instructions that say what not to do.
1research = Agent(client=client, name="ResearchAgent",2 description="Collects relevant facts, market context and data points.",3 instructions="You gather facts. Return 5-7 bullet points of evidence. No recommendations.")45analysis = Agent(client=client, name="AnalysisAgent",6 description="Evaluates evidence and extracts insights, risks and opportunities.",7 instructions="Output: Key insights (3), Risks (2), Opportunities (2).")89recommendation = Agent(client=client, name="RecommendationAgent",10 description="Turns insights into prioritised, actionable recommendations.",11 instructions="Write 3 prioritised recommendations, each with owner, KPI and 30/60/90-day step.")
Delegation: agents as tools
agent.as_tool() wraps an agent as a function another agent can call. The Coordinator decides when and with what input to call each specialist — the LLM does the routing.
1coordinator = Agent(2 client=client,3 name="Coordinator",4 instructions="1) call ResearchAgent, 2) pass its output to AnalysisAgent, "5 "3) pass insights to RecommendationAgent, 4) consolidate a final brief.",6 tools=[research.as_tool(), analysis.as_tool(), recommendation.as_tool()],7)8print((await coordinator.run("Churn rose from 3% to 5%. What should we do?")).text)
Sequential vs. concurrent
Sequential — each agent builds on the previous output (Research → Analysis → Recommendation). Total time ≈ sum of steps.
Concurrent — independent agents work on the same input at once (Finance ‖ Operations ‖ Risk) and results are aggregated. Total time ≈ slowest agent.
Sequential
≈ 8.7s
Concurrent
≈ 3.4s
Orchestration patterns at a glance
MAF ships these as builders in agent_framework.orchestrations — you'll use them in Module 6.
Sequential
SequentialBuilder
Pipeline; each agent builds on the last
Concurrent
ConcurrentBuilder
Fan-out in parallel, aggregate results
Handoff
HandoffBuilder
Agents transfer control dynamically
Group chat
GroupChatBuilder
Manager picks next speaker in shared chat
Magentic
MagenticBuilder
Planner with task ledger, re-plans on stalls
Key takeaways
One job per agent: name + description + narrow instructions.
agent.as_tool() enables LLM-driven delegation (agent-to-agent).
Sequential for dependent steps, concurrent for independent perspectives.
More agents = more calls: design for cost and latency.
Hands-on activity
Build a multi-agent business assistant: Research → Analysis → Recommendation
- 1Sandbox → Multi-Agent Studio. Pick the “Churn spike” scenario.
- 2Run in Sequential mode and watch each node light up. Read each agent's output.
- 3Switch to Concurrent mode and compare the timeline chart — which is faster? Which is better?
- 4Edit the Analysis agent's instructions (e.g. add a SWOT) and re-run.
Reference solution — labs/ex5_multi_agent.py (verified on agent-framework-core 1.26)
1"""Exercise 5 — Specialised agents + a coordinator that delegates (Module 5)."""23import asyncio45from agent_framework import Agent6from common import make_client78client = make_client()910research = Agent(11 client=client,12 name="ResearchAgent",13 description="Collects relevant facts, market context and data points for a business question.",14 instructions="You gather facts. Return 5-7 bullet points of evidence. No recommendations.",15)1617analysis = Agent(18 client=client,19 name="AnalysisAgent",20 description="Evaluates evidence and extracts key insights, risks and opportunities.",21 instructions="You analyse evidence. Output: Key insights (3), Risks (2), Opportunities (2).",22)2324recommendation = Agent(25 client=client,26 name="RecommendationAgent",27 description="Turns insights into prioritised, actionable business recommendations.",28 instructions="You write 3 prioritised recommendations, each with owner, KPI and 30/60/90-day step.",29)3031# Agent-to-agent: wrap specialists as tools the coordinator can call (delegation)32coordinator = Agent(33 client=client,34 name="Coordinator",35 instructions=(36 "You coordinate a team. For any business request: "37 "1) call ResearchAgent, 2) pass its output to AnalysisAgent, "38 "3) pass the insights to RecommendationAgent, then 4) consolidate a final brief "39 "with sections: Summary, Insights, Recommendations."40 ),41 tools=[research.as_tool(), analysis.as_tool(), recommendation.as_tool()],42)434445async def main() -> None:46 request = "Our SaaS churn rose from 3% to 5% this quarter. What should we do?"47 result = await coordinator.run(request)48 print(result.text)495051if __name__ == "__main__":52 asyncio.run(main())
Check your understanding
Q1.How does a coordinator agent call a specialist agent in MAF?
Q2.Finance, Ops and Risk each review the same proposal independently. Best execution mode?
Q3.Why give each agent a `description`?