> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agno.com/llms.txt
> Use this file to discover all available pages before exploring further.

# A2A

> Expose Agno agents via the A2A protocol

<Badge icon="code-branch" color="orange">
  <Tooltip tip="Introduced in v2.1.2" cta="View release notes" href="https://github.com/agno-agi/agno/releases/tag/v2.1.2">v2.1.2</Tooltip>
</Badge>

Google's [Agent-to-Agent Protocol (A2A)](https://a2a-protocol.org/latest/topics/what-is-a2a/) provides a standard way for agents to communicate with each other.

Agno integrates with A2A, enabling Agno agents and teams to be exposed in an A2A-compatible format.

The `A2A` interface works with the [AgentOS](/agent-os/introduction) runtime to provide this functionality.

## Setup

Set `a2a_interface=True` when creating an `AgentOS` instance:

```python a2a_agentos.py theme={null}
from agno.agent import Agent
from agno.os import AgentOS
from agno.os.interfaces.a2a import A2A

agent = Agent(name="My Agno Agent",id="my_agent")

agent_os = AgentOS(
    agents=[agent],
    a2a_interface=True,
)
app = agent_os.get_app()

if __name__ == "__main__":
    agent_os.serve(app="a2a:app", reload=True)
```

By default, all agents, teams, and workflows in the AgentOS are exposed via A2A.

Specific agents, teams, and workflows can be exposed by initializing the interface explicitly:

```python a2a-interface-initialization.py theme={null}
from agno.agent import Agent
from agno.os import AgentOS
from agno.os.interfaces.a2a import A2A

agent = Agent(name="My Agno Agent",id="my_agent")

# Initialize the A2A interface specifying the agents to expose
a2a = A2A(agents=[agent])

agent_os = AgentOS(
    agents=[agent],
    interfaces=[a2a], # Pass the A2A interface to the AgentOS using the `interfaces` parameter
)
app = agent_os.get_app()

if __name__ == "__main__":
    agent_os.serve(app="a2a-interface-initialization:app", reload=True)
```

## A2A Endpoints

For each available agent, team and workflow, the following A2A-compatible endpoints will be available:

### Agents

* `/a2a/agents/{id}/.well-known/agent-card.json`:
  Returns the [Agent Card](https://a2a-protocol.org/v0.3.0/topics/agent-discovery/#1-well-known-uri) describing the agent in A2A format.
  See [API reference](/reference-api/schema/a2a/get-agent-card).

* `/a2a/agents/{id}/v1/message:stream`:
  Runs the agent, streaming the responses as events in A2A format.
  See [API reference](/reference-api/schema/a2a/stream-message-agent) and [A2A protocol docs](https://a2a-protocol.org/v0.3.0/specification/#356-method-mapping-reference-table).

* `/a2a/agents/{id}/v1/message:send`:
  Runs the agen, returning the response in A2A format (non-streaming).
  See [A2A protocol docs](https://a2a-protocol.org/v0.3.0/specification/#356-method-mapping-reference-table).

### Teams

* `/a2a/teams/{id}/.well-known/agent-card.json`:
  Returns the Team Card describing the Team in A2A format. See [API reference](/reference-api/schema/a2a/get-agent-card).

* `/a2a/teams/{id}/v1/message:stream`:
  Runs the team, streaming the responses as events in A2A format. See [API reference](/reference-api/schema/a2a/stream-message-agent) and [A2A protocol docs](https://a2a-protocol.org/v0.3.0/specification/#356-method-mapping-reference-table).

* `/a2a/teams/{id}/v1/message:send`:
  Runs the team, returning the response in A2A format (non-streaming). See [API reference](/reference-api/schema/a2a/run-message-agent).

### Workflows

* `/a2a/workflows/{id}/.well-known/agent-card.json`:
  Returns the Workflow Card describing the Workflow in A2A format. See [API reference](/reference-api/schema/a2a/get-agent-card).

* `/a2a/workflows/{id}/v1/message:stream`:
  Runs the workflow, streaming the responses as events in A2A format. See [API reference](/reference-api/schema/a2a/stream-message-agent) and [A2A protocol docs](https://a2a-protocol.org/v0.3.0/specification/#356-method-mapping-reference-table).

* `/a2a/workflows/{id}/v1/message:send`:
  Runs the workflow, returning the response in A2A format (non-streaming). See [API reference](/reference-api/schema/a2a/run-message-agent).

<Note>
  A2A clients expect a server to expose only a single agent.
  To use your Agno A2A interface with those clients, simply use `/a2a/agents/{id}/` (or `/a2a/teams/{id}/`, `/a2a/workflows/{id}/`) as the base url.
</Note>

## Connecting to A2A Servers

Agno provides two ways to connect to A2A-compatible servers:

### Using A2AClient

For direct A2A protocol access:

```python theme={null}
from agno.client.a2a import A2AClient

client = A2AClient("http://localhost:7003/a2a/agents/my-agent")
result = await client.send_message(message="Hello!")
```

See [A2A Client](/agent-os/client/a2a-client) for full documentation.

### Using RemoteAgent

For a higher-level agent interface:

```python theme={null}
from agno.agent import RemoteAgent

agent = RemoteAgent(
    base_url="http://localhost:7003",
    agent_id="my-agent",
    protocol="a2a",
)
response = await agent.arun("Hello!")
```

See [RemoteAgent Reference](/reference/agents/remote-agent) for full documentation.

## Developer Resources

* [AgentOS Reference](/reference/agent-os/agent-os)
* [A2A Client Documentation](/agent-os/client/a2a-client)
* [A2A Protocol Documentation](https://a2a-protocol.org/latest/)
* [Examples](/agent-os/usage/interfaces/a2a/basic)
