Agent-to-Agent Communication (A2A)
How do agents actually talk to each other?
If you have a team of agents (last topic), there is an obvious question: how do they pass work between each other? People in a team use email, chat, or just talking. Agents need their own version of that. Agent-to-Agent (A2A) communication is simply the set of rules for how one agent sends a message or result to another agent.
Key points
- A2A = the 'language and channel' agents use to talk to each other.
- Messages are usually structured (clear sender, receiver, content).
- A 'handoff' is when one agent passes the whole task to another.
- Different from MCP: MCP connects agents to TOOLS; A2A connects agents to AGENTS.
The one-line definition
Agent-to-Agent (A2A) communication is how agents exchange messages, results, and tasks with each other in a structured, agreed-upon way, so a team of agents can cooperate without misunderstanding each other.
Note: A2A is the postal system between agents: clear sender, receiver, and a well-formatted message.
Three ways agents pass information
1) DIRECT HANDOFF 2) SHARED MESSAGE BUS ───────────────── ─────────────────────
Agent A Agent A Agent B │ "here, you take it" │ │ ▼ ▼ ▼ Agent B ┌──────────────────┐ (now owns the task) │ MESSAGE BUS │ │ (shared mailbox) │ └────────┬─────────┘ 3) BROADCAST ▼ ──────────── Agent C reads Agent A ──► everyone whatever it needs "status update for all"
What a structured message looks like
Agents should not just dump raw text at each other. They use structured messages, like a form with labelled fields, so the receiver always knows who sent it, what it is about, and what to do. Think of it like an envelope with a clear address, subject line, and contents, instead of a torn note slipped under a door.
- from / to: which agent sent it, which should read it.
- type: is this a request, a result, or an error?
- content: the actual data or task.
A tiny example of a structured A2A message
Here a researcher agent sends its findings to a writer agent. Notice the message is a clear dictionary with labelled fields, not a wall of text. Your coordinator code reads to and delivers it to the right agent.
# A simple structured message one agent sends to another
message = {
"from": "researcher",
"to": "writer",
"type": "result", # request | result | error
"task_id": "report-42",
"content": {
"facts": ["EV batteries last 8-15 years",
"Recycling recovers ~95% of metals"],
},
}
def deliver(message, agents):
receiver = agents[message["to"]] # find the target agent
return receiver.handle(message) # hand the message over
deliver(message, {"writer": writer_agent})
A2A vs MCP (a common point of confusion)
AGENT ◄────── A2A ──────► AGENT (talks to other AGENTS, shares results, hands off tasks) │ │ MCP ▼ ┌───────────┐ ┌───────────┐ ┌───────────┐ │ 🔧 TOOL │ │ 🗄️ DB │ │ 🌐 API │ └───────────┘ └───────────┘ └───────────┘ (MCP connects ONE agent to its TOOLS / data)
RULE OF THUMB: MCP = agent → tools A2A = agent → another agent
Standard protocols: Google's A2A and how it relates to MCP
People building agents kept inventing their own message formats, which made agents from different teams unable to talk. So standard protocols appeared. Google's A2A protocol is an open standard for how independent agents discover each other and exchange tasks and results in a common format, even if they were built by different companies.
Keep these two straight: MCP (Model Context Protocol) is for connecting an agent to its tools and data. A2A is for connecting an agent to other agents. They solve different problems and are often used together.
When do you need a real A2A setup?
| Scenario | Recommendation | Why |
|---|---|---|
| Many agents that frequently exchange partial results | ✅ Use a message bus / protocol | A shared, structured channel keeps the team in sync. |
| Agents built by different teams or systems must cooperate | ✅ Use a standard protocol (e.g., A2A) | A common format lets strangers' agents understand each other. |
| Just two agents handing off once, in your own code | ⚠️ A simple function call is fine | Don't add protocol overhead before you need it. |
| An agent needs a database or web tool | ❌ That's MCP, not A2A | Tool access is a different problem from agent-to-agent talk. |
A2A mistakes beginners make
| Mistake | Consequence | Fix |
|---|---|---|
| Passing raw, unstructured text between agents. | The receiving agent misreads it and the task drifts off course. | Use structured messages with clear from/to/type/content fields. |
| Confusing A2A with MCP. | You reach for the wrong tool and get stuck. | Remember: MCP = agent-to-tools, A2A = agent-to-agent. |
| No clear ownership after a handoff. | Two agents think they own the task, or nobody does. | Make handoffs explicit: one message that transfers ownership to exactly one agent. |
Remember these lines
- A2A is how agents talk to OTHER agents; MCP is how an agent reaches its TOOLS.
- Always use structured messages: from, to, type, content.
- A handoff transfers ownership of the task to exactly one agent.
- Use a standard protocol (like Google's A2A) when agents from different systems must cooperate.
Key takeaways
- A2A communication is the structured way agents exchange messages, results, and tasks.
- Common channels: direct handoff, a shared message bus, and broadcast.
- Structured messages (from/to/type/content) prevent misunderstandings between agents.
- Google's A2A protocol is an open standard so agents from different systems can cooperate.
- MCP connects an agent to tools/data; A2A connects an agent to other agents.
Frequently Asked Questions
What is Agent-to-Agent Communication?
If you have a team of agents (last topic), there is an obvious question: how do they pass work between each other? People in a team use email, chat, or just talking.
How does Agent-to-Agent Communication work?
Agent-to-Agent (A2A) communication is how agents exchange messages, results, and tasks with each other in a structured, agreed-upon way, so a team of agents can cooperate without misunderstanding each other.
What are the key takeaways about Agent-to-Agent Communication?
A2A communication is the structured way agents exchange messages, results, and tasks. Common channels: direct handoff, a shared message bus, and broadcast. Structured messages (from/to/type/content) prevent misunderstandings between agents. Google's A2A protocol is an open standard so agents from different systems can cooperate.
Related topics
Practice this on DevInterviewMaster
Read the full Agent-to-Agent Communication (A2A) breakdown with interactive demos, quizzes, and Hinglish notes.
800+ system-design, LLD, coding, and design-pattern topics. Unlock everything with Pro (₹499, one-time) or Ultimate (₹999, one-time) — lifetime access, no subscription.