Build multi-agent solutions with the Agent Framework

Level ▰▰▰▱▱ L300 (L100 beginner → L500 expert)

A single agent is useful. A team of agents — each one focused, and able to hand work to the others — is how you build real operations. In this lab you’ll build up a Tailwind Traders multi-agent system with the Microsoft Agent Framework (MAF), starting from one tool-using agent and growing to a set of remote agents that call each other over a protocol.

Anton
Meet Anton, your AI guide.
You’ll spot Ask Anton tips throughout this lab. Want more interactive, hands-on help? Chat with Anton in the Ask Anton app.

About the Ask Anton app Ask Anton is a generative AI agent that can answer questions about AI concepts and Microsoft Foundry technologies. It's available in two versions at https://aka.ms/choose-anton:
  • Azure-based: Best experience (requires an Azure subscription and deployment of a model in a Foundry project).
  • Browser-based: Use a small language model in your browser (reduced functionality - may be slow or work only in "basic" mode in older/lower-spec devices).
Ask Anton is not a supported Microsoft product or a component of Microsoft Learn or AI Skills Navigator.
What is the Microsoft Agent Framework?

The Microsoft Agent Framework (MAF) is a higher-level SDK for building agents on Microsoft Foundry. You decorate a plain Python function with @tool (the schema is generated for you) and call await agent.run(...), which runs the entire tool-calling loop automatically. It also gives you building blocks for multi-agent solutions — orchestrations that run several agents together — so you don’t have to wire the plumbing by hand.

Learn more →

Your scenario: you work at Tailwind Traders, an outdoor-gear retailer that also runs guided trips. Across this lab you’ll build the automation behind Tailwind Traders operations — starting with a single agent that files trip-expense claims, then a pipeline of agents that triage customer feedback, and finally a set of specialist trip-planning agents that live in separate processes and collaborate over a protocol.

You’ll start with the Core task that gets you to a working, tool-using agent as quickly as possible. From there, a set of Optional tasks lets you go deeper into multi-agent patterns.

Note: Some of the technologies used in this exercise are in preview or in active development. You may experience some unexpected behavior, warnings, or errors.

What you’ll learn

By completing the Core task of this exercise, you’ll be able to:

  • Build an agent with a custom tool using the Microsoft Agent Framework — decorate a Python function with @tool, hand it to an Agent, and let agent.run() drive the tool-calling loop.

The Optional tasks let you additionally:

  • Orchestrate multiple agents in a sequence, passing work from one specialist agent to the next and collecting every agent’s output.
  • Connect remote agents that run in separate processes and call each other using the Agent-to-Agent (A2A) protocol, coordinated by a routing agent.
  • Classify and route support tickets by turning one agent’s structured output into conditional routing in your own code.

How this lab is organized

This lab is modular. Each task is written to be completed on its own, starting fresh — so you can pick a single task and do just that one. Every task also shares one starter folder, one virtual environment, and one .env, so if you’d rather work straight through, you can.

  1. Start with Getting started — create your Microsoft Foundry project (in the portal or with one azd up command), get the starter code, and set up your .env. Every task begins from here; if you’re doing the whole lab in one sitting, you only need to do this once.
  2. Do any task. Each task lists the setup it needs so you can start it independently. If you’re moving straight from the previous task, a short “Continuing from a previous task?” note at the top lets you skip the repeated setup and keep going.

Lab at a glance

Complete the Core task first (about 30 minutes) — it ends with a working, tool-using agent. Then expand any Optional tasks that interest you. The full lab, including all optional tasks, takes about 2 hours.

Section Task Level Time
Core Task 1 – Build an agent with a tool ▰▰▰▱▱ L300 ~30 min
Optional Task 2 – Orchestrate multiple agents in sequence ▰▰▰▱▱ L300 ~30 min
Optional Task 3 – Connect remote agents with A2A ▰▰▰▰▱ L400 ~30 min
Optional Task 4 – Classify and route a support ticket ▰▰▰▱▱ L300 ~30 min

Choosing your path — pick the tasks that fit the time you have:

  • Core only (~30 min): do Task 1.
  • Core + one pattern (~1h): add Task 2 (sequential orchestration) or Task 4 (classify + route).
  • Everything (~2h): add Task 2, Task 3 (remote agents with A2A), and Task 4.

One framework, growing from one agent to many

Every task in this lab is built on the Microsoft Agent Framework, so the shape of the code stays familiar as the solutions get more ambitious:

  • In Task 1, you build a single agent. You describe a tool with @tool, attach it to an Agent backed by a FoundryChatClient, and call agent.run(...) — the framework runs the tool-calling loop for you.
  • In Task 2, you keep the same client but create several agents and hand them to a SequentialBuilder orchestration, which runs them in order and collects each one’s output.
  • In Task 3, you split the agents across separate processes and let a routing agent discover and call them using the A2A protocol — the same collaboration idea, now over the network.
  • In Task 4, you come back to a single agent — but its structured output (a JSON classification) drives conditional routing in your code, escalating or auto-handling each support ticket.

Seeing the single-agent mechanics first is what makes the multi-agent patterns meaningful later.

Summary

Across this lab you:

  • Built an agent with a custom tool using the Microsoft Agent Framework.
  • (Optionally) orchestrated several agents in a sequence to triage work step by step.
  • (Optionally) connected remote agents across processes with the A2A protocol, routed by a coordinating agent.
  • (Optionally) turned an agent’s structured classification into conditional routing in code.

Together these show how the Agent Framework scales from a single focused agent to a coordinated team of them.

Clean up

If you’re finished, delete the resources you created to avoid unnecessary Azure costs.

  1. In the Azure portal, navigate to the resource group that contains your Foundry resource.
  2. On the toolbar, select Delete resource group, enter the resource group name, and confirm.

If you provisioned with azd, run azd down instead to remove everything it created.