Orchestrate a multi-agent solution using the Microsoft Agent Framework | AI-103 | Episode 14
A single agent can handle one task well; multi-agent orchestration coordinates specialized agents to solve larger tasks together. The Microsoft Agent Framework provides orchestration patterns that can be implemented directly in application code.
Know which orchestration pattern fits which execution flow:
| Pattern | Execution model | Best fit |
|---|---|---|
| Sequential | A → B → C | Fixed pipeline; each output feeds the next agent |
| Concurrent | A → B/C/D → merge | Independent work that can run in parallel |
| Handoff | A → dynamically chosen specialist | Routing/delegation based on the request |
| Group Chat | Manager selects agents iteratively | Collaborative reasoning with shared conversation context |
| Magnetic | Orchestrator dynamically plans execution | Complex tasks where the path is not known upfront |
Key distinction: Sequential and concurrent workflows have largely predictable structures. Handoff, group chat, and especially magnetic orchestration introduce increasingly dynamic agent selection and execution.
A simple sequential workflow illustrates the core programming model:
# 1. Define specialized agents
summarizer = chat_client.as_agent(...)
classifier = chat_client.as_agent(...)
action = chat_client.as_agent(...)
# 2. Define their execution order
workflow = SequentialBuilder(
participants=[summarizer, classifier, action]
).build()
# 3. Run the orchestration
await workflow.run(user_input)
Here, the summarizer → classifier → action order is explicit, and each agent runs in turn.
Remember: first define the agents and their capabilities, then select an orchestration pattern matching the required execution and collaboration model.
Comments