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

# Agent-to-Agent communication with the A2A Protocol

> Use the Agent-to-Agent (A2A) protocol to let AI agents discover each other, share agent cards, and exchange JSON-RPC messages across frameworks.

Agents can collaborate to perform complex tasks by communicating with each other.
A2A Protocol (Agent-to-Agent) solves the problem of Agents not being able to communicate with each other because each Agent has its own unique API.

<Card img="https://a2a-protocol.org/latest/assets/a2a-actors.png">
  Source: [A2A Protocol](https://a2a-protocol.org)
</Card>

The **A2A Protocol** defines standard specifications for Agent communication and message formatting, enabling seamless interoperability between different AI agents.

## Highlights

* Agents can self-discover each other via an **Agent Card**.
* Supports both immediate responses and long-running tasks.
* Defines security and authentication mechanisms.
* Multiple transport protocols supported: `JSON-RPC`, `gRPC`, and `HTTP + REST`.

## Key Concepts

The A2A protocol is comprehensive, and we will cover the most important concepts here.

### Agent Discovery: The Agent Card

Every Agent **must** expose an Agent Card, a JSON object that describes the Agent's identity, capabilities, skills, service endpoint URL, and how clients should authenticate and interact with it.

It is recommended to expose the Agent Card at the endpoint `https://{server_url}/.well-known/agent-card.json`

### Protocol Methods

1. `message/send`
2. `message/stream`
3. `tasks/get`
4. `tasks/list`

## A2A with Agentor

Agentor provides built-in A2A support, making it effortless to create agents that can discover, communicate, and collaborate with other A2A-compatible agents.

### Key Features

* **Agent Discovery**: Automatic agent card generation at `/.well-known/agent-card.json` describing agent capabilities, skills, and endpoints
* **Standard Communication**: JSON-RPC based messaging with support for both streaming and non-streaming responses
* **Rich Interactions**: Built-in support for tasks, status updates, and artifact sharing between agents

The following example shows how to create an Agent and serve it as an A2A-compatible Agent.

```python theme={null}
from agentor import Agentor

agent = Agentor(
    name="Weather Agent",
    model="gpt-5",
    tools=["get_weather"],
)

# Serve agent with A2A protocol enabled automatically
agent.serve(port=8000)
# Agent card available at: http://localhost:8000/.well-known/agent-card.json
```

Any agent served with `agent.serve()` automatically becomes A2A-compatible with standardized endpoints for message sending, streaming, and task management.
