MAF AcademyLearnCapstoneSandbox
MAF Academy · Microsoft Agent Framework hands-on workshop · labs verified on agent-framework-core 1.26
← All modules
MODULE 5 OF 8 12 minutes

Building Multi-Agent Applications

Small, specialised agents with clear jobs beat one giant prompt.

1.Introduction to multi-agent architecture
2.Understanding agent collaboration and delegation
3.Designing specialised agents for different responsibilities
4.Creating multiple agents using Microsoft Agent Framework
5.Agent-to-agent communication
6.Understanding sequential and concurrent execution
7.Introduction to agent orchestration patterns

On this page

Why multiple agents?Designing specialised agentsDelegation: agents as toolsSequential vs. concurrentOrchestration patterns at a glanceKey takeawaysHands-on activityQuiz
1Architecture

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.

👤 Business requestCoordinatorplans · delegates · mergesResearch AgentCollects & analyses informationAnalysis AgentIdentifies key insightsRecommendation AgentActionable recommendations
Coordinator delegates to specialists (agent.as_tool()) and consolidates their outputs.
2Design

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.

ex5_multi_agent.py
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.")
4
5analysis = 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).")
8
9recommendation = 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.")
3Agent-to-agent

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.

coordinator delegates
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)
4Execution

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

Research
Analysis
Recommend

Concurrent

≈ 3.4s

Finance
Operations
Risk
Aggregate
Illustrative timings. Sequential ≈ sum of steps (each builds on the last); concurrent ≈ slowest branch.
5Patterns

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

ledger

Magentic

MagenticBuilder

Planner with task ledger, re-plans on stalls

Key takeaways

01

One job per agent: name + description + narrow instructions.

02

agent.as_tool() enables LLM-driven delegation (agent-to-agent).

03

Sequential for dependent steps, concurrent for independent perspectives.

04

More agents = more calls: design for cost and latency.

Hands-on activity

Build a multi-agent business assistant: Research → Analysis → Recommendation

  1. 1Sandbox → Multi-Agent Studio. Pick the “Churn spike” scenario.
  2. 2Run in Sequential mode and watch each node light up. Read each agent's output.
  3. 3Switch to Concurrent mode and compare the timeline chart — which is faster? Which is better?
  4. 4Edit the Analysis agent's instructions (e.g. add a SWOT) and re-run.
Open Multi-Agent Studio Exercise 5 in Code Lab

Reference solution — labs/ex5_multi_agent.py (verified on agent-framework-core 1.26)

ex5_multi_agent.py
1"""Exercise 5 — Specialised agents + a coordinator that delegates (Module 5)."""
2
3import asyncio
4
5from agent_framework import Agent
6from common import make_client
7
8client = make_client()
9
10research = 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)
16
17analysis = 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)
23
24recommendation = 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)
30
31# 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)
43
44
45async 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)
49
50
51if __name__ == "__main__":
52 asyncio.run(main())

Check your understanding

0/3

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`?

M4 · MemoryM6 · Workflows