Browse the docs

Build on Microsoft Agent Framework

When to build a single agent or a multi-agent workflow on Microsoft Agent Framework, which versions to pin, and how either one reaches AMC.

Before you startPython 3.11 or later, a Microsoft Foundry project with a deployed chat model, and the Azure CLI.View as Markdown

In this build path the framework does the reasoning. Microsoft Agent Framework for Python runs the model loop, calls your tools and MCP servers, and streams the result. You deploy the agent or workflow to Microsoft Foundry as a hosted agent, and AMC runs it over the Foundry Responses protocol.

If you want a Claude skill to do the reasoning and only use Agent Framework as the host, this is the wrong path. See Choose a build path.

Agent or workflow

You needBuild
One model turn with tools does the whole jobA single agent: one Agent, served directly.
Several agents or functions that hand work to each otherA workflow: executors connected by edges with WorkflowBuilder.
Each stage shown as its own step in AMCA workflow. Every executor reports as a step. A single agent reports as one step.
A deterministic check between model callsA workflow with a plain Python executor in the middle.
Parallel branches joined at the endA workflow with fan-out and fan-in edges.
A pause for a person mid-runA workflow that calls ctx.request_info(...).
A run that survives the serving process stoppingA workflow. Process-loss recovery (resilient_background) is workflow-only.

How it reaches AMC

  1. Build an Agent or a Workflow with FoundryChatClient-backed agents.
  2. Write a main.py that wraps it in ResponsesHostServer. It serves /responses and a health probe on port 8088. A workflow is wrapped with workflow.as_agent(name=...) first.
  3. Deploy the folder to Foundry as a hosted agent version and route traffic to it.
  4. Register it in AMC. AMC calls it over the Responses protocol by its agent name.
  5. While it runs, AMC reads steps, tokens, model, failures and human-input requests from the stream.

The hosted Responses stream flattens a workflow into one agent stream, and its run-level usage block is always empty. So the agent or workflow reports what AMC needs itself, on informational function_call markers. Harden an agent or workflow for AMC has the code. The general rules every agent meets are in the integration contract and how agents connect.

Versions this section targets

Agent Framework's Python API has changed across releases. The skills this section is based on verify their APIs against agent-framework 1.11.0. Process-loss recovery needs the newer core 1.19.0 line. Pin exact versions in a container image, and don't install with --pre, which pulls pre-releases over the stable line.

PackageSingle agentWorkflow with recoveryProvides
agent-framework-core1.11.01.19.0Agent, Executor, WorkflowBuilder, Content, Message. 1.19 adds the checkpoint allow-list.
agent-framework-foundry1.10.11.13.1FoundryChatClient, FoundryAgent, to_prompt_agent
agent-framework-foundry-hosting1.0.0a2607091.0.0b260918ResponsesHostServer, CheckpointStoreProvider
azure-ai-agentserver-responsesPulled in by hosting>=2.2.0b1,<3ResponsesServerOptions
azure-ai-projects>=2.3.0>=2.3.0Deploy and invoke hosted agents
azure-identity>=1.19.0>=1.19.0DefaultAzureCredential

Older examples you will find

Many published examples use an earlier SDK surface. Map them to the 1.11.0 surface like this:

Older examples1.11.0
from agent_framework.azure import AzureAIAgentsProviderNot present. Use from agent_framework.foundry import FoundryChatClient for a local agent, or FoundryAgent to connect to an existing hosted agent.
provider.create_agent(...)Agent(client=FoundryChatClient(...), ...). To publish a persistent prompt agent, AIProjectClient.agents.create_version(name, definition=to_prompt_agent(agent)).
provider.get_agent(agent_id)FoundryAgent(project_endpoint=..., agent_name=..., credential=...). It connects to an existing agent and never creates one. Omit agent_version for the latest.
Get-or-create by nameAIProjectClient.agents.get(name), and on ResourceNotFoundError call agents.create_version(name, definition=...).
agent.run_stream(...)agent.run(..., stream=True), an async iterator of AgentResponseUpdate.
Reading usage with getattrAgentResponse.usage_details is a dict. Read input_token_count, output_token_count and total_token_count with .get.

In this section

Last updated 2026-10-21