A2A
Turning an agent into a network service other agents can call with the A2A protocol.
What it demonstrates
DevUI put a human in front of your agent; A2A (Agent-to-Agent) lets another agent — in a different process, team, or company — call yours over a standard protocol. It works both directions: you can CONSUME a remote agent as if it were local with A2AAgent(name=..., url=...), or EXPOSE your local agent by wrapping it in A2AExecutor(agent) and mounting that on an ASGI server. Your agent becomes a network service speaking a common language.
One real excerpt
from agent_framework.a2a import A2AAgent, A2AExecutor
# CONSUME: talk to someone else's agent as though it were local.
remote = A2AAgent(name="remote-weather", url="http://localhost:9000")
# result = await remote.run("What is the weather in Pune?")
# EXPOSE: wrap your local Agent so an ASGI server can publish it over A2A.
executor = A2AExecutor(build_agent())
The gotcha
A2A ships separately as agent-framework-a2a, so import agent_framework.a2a fails on a bare install — run uv sync --extra hosting. Constructing an A2AAgent(url=...) does not make a network call; nothing round-trips unless a server is actually listening at that URL, so the demo shows the shape, not a live call. Exposing an agent is only half the job: A2AExecutor(agent) is the server-side adapter, and you still have to mount it on an ASGI server (uvicorn) to get a callable A2A URL.
Azure / MAF mapping
The local agent being exposed is a plain Agent over FoundryChatClient (project_endpoint + model + AzureCliCredential). A2A wraps that agent without touching its brain — the same Foundry-backed agent can serve a human via DevUI or another agent via A2A, unchanged.
Run it
uv run tutorial/04-hosting/02_a2a.py — needs Foundry creds (az login) and the hosting extra. Worked if it prints the constructed A2AAgent line and the wrapped A2AExecutor line.
Next: Durable Extension