Exercise - Develop a multi-agent solution
Unit 9 of 10 · Module 14: Orchestrate a multi-agent solution using the Microsoft Agent Framework
Read this lesson
The plan
In this lab, you'll build a three-agent pipeline that handles customer feedback, using sequential orchestration. You'll need VS Code, Python, Git, and an Azure subscription, and it takes about thirty minutes. A summarizer agent squeezes the feedback into one neutral sentence. A classifier labels it Positive, Negative, or Feature request. And an action agent suggests the next step. In VS Code, use the Foundry Toolkit to create a project and deploy a gpt-5 model, then clone the lab repository, install the packages, and put your project endpoint and model name in the dot env file.
The code
Open agents.py. It already has instructions for all three agents. Add the imports: Message, the Foundry chat client, SequentialBuilder, and the Azure CLI credential. Create the chat client with your endpoint and model, then create the three agents with as_agent, each with a name and its instructions. The feedback is ready to go: a daily dashboard user who finds the bright screen harsh late at night, and would love a dark mode. Build the workflow with SequentialBuilder, the three agents in order, and output_from set to all, so you see every agent's answer. Run it, call get_outputs, and print each agent's name and message.
Run it
Sign in with az login, then run the script. You should see the summary, the label Feature request, and a suggested action, like logging it for the product backlog. Try the other feedback too, a glowing review of customer support, and it should come out Positive. When you're done, delete the model deployment and the resource group. Practice first in the Coding exercise, where the pipeline runs against a simulated Foundry project.
Facts from Microsoft's documentation: Workflow orchestrations in Agent Framework; Sequential orchestration (CC BY 4.0), rewritten in Loop's own words and examples. Narration, animation, and quiz by Loop. The coding lab is based on Microsoft's lab files for the agent exercises (MicrosoftLearning/mslearn-ai-agents, MIT License; notice). Microsoft, Azure, and Microsoft Foundry are trademarks of Microsoft. Loop is independent and not affiliated with or endorsed by Microsoft.