Use Magentic orchestration
Unit 8 of 10 · Module 14: Orchestrate a multi-agent solution using the Microsoft Agent Framework
Read this lesson
The expedition leader
An expedition leader doesn't know the exact route up an unclimbed mountain. So they keep a ledger: what we know, the plan, who does what. They check progress each day, and when the team gets stuck, they rethink the plan. Magentic orchestration, based on Microsoft's Magentic-One research, works like that. A manager agent coordinates a team of specialist agents. It breaks the problem down, picks who acts next based on how things are going, and keeps a task ledger of goals, sub-goals, and the plan. The way the problem gets solved is written down as carefully as the answer itself.
When it fits, and when it doesn't
Use it for complex, open-ended problems with no set path, where you need several specialists, where a written plan is worth having, maybe for a person to review before work starts, or where agents use tools that change real systems. Avoid it when the path is fixed, when you don't need a plan, when a lighter pattern would do, when speed matters most, or when the task is likely to go round in circles.
In code
In code, create the specialists, like a researcher and a coder with a code interpreter tool, and a manager agent. Pass them to MagenticBuilder, with limits: a maximum number of rounds, how many stalls are allowed before replanning, and how many resets in total. Stream the run. As well as each agent's output, you'll see orchestrator events when the plan is created, when it's replanned, and each time the progress ledger is updated. The ledger asks: is the request done, are we looping, are we making progress, who's next, and what should they do? The final output is the manager's summary. Set enable plan review, and the workflow pauses so a person can approve or revise the plan before anyone starts.
Facts from Microsoft's documentation: Workflow orchestrations in Agent Framework; Magentic orchestration (CC BY 4.0), rewritten in Loop's own words and examples. Narration, animation, and quiz by Loop. Microsoft, Azure, and Microsoft Foundry are trademarks of Microsoft. Loop is independent and not affiliated with or endorsed by Microsoft.