A2A Protocol
How AI Agents Talk to Each Other
Understand Google's Agent-to-Agent (A2A) protocol - the open standard for AI agents to discover each other, negotiate capabilities, and collaborate on complex tasks. The HTTP of the agent world.
What is the A2A Protocol?
The Language AI Agents Use to Collaborate
A2A Explained Simply:
The Agent-to-Agent (A2A) protocol, created by Google, is an open standard that enables AI agents built by different companies, using different frameworks, to discover each other, communicate, and collaborate on tasks. Without A2A, agents from different vendors are isolated islands. With A2A, they become a connected network.
Think about email. Before email standards (SMTP), every messaging system was proprietary - CompuServe users could only message CompuServe users. SMTP made it so anyone can email anyone, regardless of provider. A2A does the same for AI agents.
Real-World Analogy - Zomato + Swiggy Delivery Partners:
Imagine if delivery partners could only work for ONE platform. A Zomato delivery person cannot pick up a Swiggy order. That is how agents work today - a LangChain agent cannot collaborate with an AutoGen agent. A2A is like creating a universal delivery standard - any partner can accept orders from any platform, using a common communication protocol.
MCP vs A2A - Complementary Protocols:
| Aspect | MCP | A2A |
|---|---|---|
| Purpose | Agent connects to Tools | Agent talks to Agent |
| Analogy | USB-C (device to accessory) | HTTP (server to server) |
| Direction | Agent -> Tool (one way) | Agent <-> Agent (bidirectional) |
| Created by | Anthropic | |
| Use case | Give agent access to tools/data | Agents collaborate on complex tasks |
They are complementary, NOT competing. A well-designed system uses BOTH: MCP for tool access, A2A for agent collaboration.
Note: A2A complements MCP. MCP connects agents to tools (like USB connects devices to peripherals). A2A connects agents to other agents (like HTTP connects servers to servers).
Core Concepts - Agent Cards, Tasks & Messages
The Building Blocks of Agent-to-Agent Communication
1. Agent Card - The Agent Resume:
Every A2A agent publishes an Agent Card at a well-known URL (like /.well-known/agent.json). This is a machine-readable description of what the agent can do, what inputs it accepts, and how to communicate with it. Think of it as a LinkedIn profile for AI agents.
// Example Agent Card
{
"name": "Travel Planner Agent",
"description": "Plans trips, books flights and hotels,
creates itineraries based on preferences and budget",
"url": "https://travel-agent.example.com/a2a",
"capabilities": {
"streaming": true,
"pushNotifications": true
},
"skills": [
{
"id": "plan_trip",
"name": "Trip Planning",
"description": "Creates a complete travel itinerary"
},
{
"id": "book_flight",
"name": "Flight Booking",
"description": "Searches and books flights"
}
]
}2. Tasks - The Unit of Work:
When one agent asks another to do something, it creates a Task. A task has a lifecycle: submitted, working, input-required, completed, failed, canceled. The requesting agent can track progress and provide additional input if needed.
Task Lifecycle:
SUBMITTED -> WORKING -> COMPLETED
| |
+-> INPUT_REQUIRED (needs more info)
| |
+-> FAILED
+-> CANCELED3. Messages & Parts - The Conversation:
Within a task, agents exchange Messages containing Parts (text, files, structured data). This enables rich, multi-turn conversations between agents - not just simple request/response.
Note: Agent Cards are the foundation of discoverability. Without them, agents cannot find each other. Think of it as DNS for AI agents - you need to know the address before you can communicate.
How A2A Communication Works
The Step-by-Step Flow of Agent Collaboration
Complete A2A Interaction Flow:
1. DISCOVERY
Client Agent fetches Agent Card from:
https://travel-agent.example.com/.well-known/agent.json
Reads capabilities, skills, endpoint URL
2. TASK CREATION
Client Agent sends task to Remote Agent:
"Plan a 5-day trip to Goa for 2 people, budget 50K"
Remote Agent accepts, returns task ID
3. PROCESSING
Remote Agent works on the task
May stream partial results (day 1 planned...day 2...)
May ask for more input ("Prefer beach or heritage?")
4. COLLABORATION (Optional)
Remote Agent might delegate to OTHER agents:
- Flight Agent: search and book flights
- Hotel Agent: find accommodations
- Activity Agent: suggest things to do
5. COMPLETION
Remote Agent returns final result:
Complete itinerary with flights, hotels, activities
Task status: COMPLETEDCommunication Patterns:
- Request-Response: Simple one-shot task. Agent sends request, gets complete response.
- Streaming: Agent sends request, gets partial results as they are generated. Good for long-running tasks.
- Multi-Turn: Agent and remote agent have a back-and-forth conversation. Remote agent asks clarifying questions before completing.
- Push Notifications: Remote agent notifies client when a long-running task completes, without the client polling.
Key Design Principle - Opaque Agents:
A2A treats agents as opaque - the client agent does not need to know what LLM, framework, or architecture the remote agent uses. It could be a LangChain agent, a custom Python script, or even a team of human operators behind an API. All that matters is that it speaks the A2A protocol.
Note: A2A is framework-agnostic and model-agnostic. A GPT-4 agent can collaborate with a Claude agent can collaborate with a Gemini agent. The protocol does not care about internals.
A2A in Practice - Enterprise Scenarios
Real-World Multi-Agent Workflows
Scenario 1: Enterprise Customer Support
Customer: "I want to return my order and get a refund"
[Customer Support Agent] (Main orchestrator)
|-- Discovers Order Management Agent via Agent Card
|-- Creates task: "Process return for order #12345"
|
[Order Management Agent]
|-- Validates order is eligible for return
|-- Creates sub-task to Logistics Agent
|
[Logistics Agent]
|-- Schedules pickup for returned item
|-- Returns pickup date and tracking
|
|-- Creates sub-task to Payment Agent
|
[Payment Agent]
|-- Processes refund to original payment method
|-- Returns refund confirmation
|
Final Response: "Return initiated. Pickup on March 5.
Refund of Rs 2,499 within 5-7 days."Scenario 2: Hiring Pipeline
[HR Manager Agent] (Orchestrator)
|
+-- [Resume Screening Agent]
| Screens 500 resumes, shortlists 50
|
+-- [Interview Scheduler Agent]
| Coordinates calendars, sends invites
|
+-- [Technical Assessment Agent]
| Generates coding challenges, evaluates submissions
|
+-- [Background Check Agent]
Runs verification in parallel
All agents are from different vendors,
built with different frameworks,
but communicate via A2A protocol.Key Benefit - Vendor Independence:
With A2A, your enterprise is not locked into one AI vendor. You can use the best agent for each task regardless of who built it. Switch out the resume screening agent for a better one without changing the rest of the pipeline. This is the power of open protocols.
Note: A2A enables a marketplace of specialized agents. Instead of building one monolithic AI system, compose the best agents for each task into a powerful workflow.
Challenges & Considerations
What to Watch Out For with A2A
Challenge 1: Trust and Security
When agents from different organizations collaborate, trust becomes critical. How do you verify that the remote agent is who it claims to be? How do you ensure it does not leak sensitive data? A2A defines authentication mechanisms (OAuth 2.0, API keys) but implementing them correctly is your responsibility.
Challenge 2: Error Propagation
In a chain of agents (A -> B -> C -> D), if agent C fails, how does that cascade? A2A defines task failure states, but designing graceful degradation and retry logic across multiple agents is complex. One failing agent should not bring down the entire workflow.
Challenge 3: The Protocol is Still Young
A2A was released in 2025 and is still early in adoption. The specification may change, tooling is limited, and production deployments are rare. It is important to learn and experiment, but be cautious about betting critical systems on it today.
Challenge 4: Orchestration Complexity
As more agents join a workflow, orchestration becomes harder. Who decides which agent to call? How do you handle conflicting results from two agents? How do you optimize for cost when each agent call costs money? These are open problems in multi-agent systems.
Note: A2A is powerful but early-stage. Learn it, experiment with it, but do not build mission-critical production systems on it until the ecosystem matures.
Interview Questions
Q: What is A2A and how does it differ from MCP?
A2A (Agent-to-Agent) is Google's open protocol for agents to communicate with other agents. MCP (by Anthropic) connects agents to tools. They are complementary: MCP is like USB (device to accessory), A2A is like HTTP (server to server). Use MCP to give agents access to tools/data, use A2A to let agents delegate tasks to specialized agents. A well-designed system uses both.
Q: What is an Agent Card and why is it important?
An Agent Card is a machine-readable description published at a well-known URL (/.well-known/agent.json). It describes the agent's name, capabilities, skills, and communication endpoint. It is the foundation of discoverability - without it, agents cannot find or understand each other. Think of it as a LinkedIn profile or business card for AI agents.
Q: What does it mean that A2A agents are "opaque"?
Opaque means the client agent does not need to know the internal implementation of the remote agent. It could be powered by GPT-4, Claude, Gemini, or even human operators. It could use LangChain, AutoGen, or custom code. The A2A protocol only cares about the external interface (Agent Card, tasks, messages), not the internals. This enables true vendor independence.
Q: What are the main communication patterns in A2A?
Four patterns: (1) Request-Response - simple one-shot task. (2) Streaming - partial results sent as they are generated. (3) Multi-Turn - back-and-forth conversation where agent asks clarifying questions. (4) Push Notifications - agent notifies when a long-running task completes. The pattern used depends on task complexity and latency requirements.
Q: What are the key challenges with A2A adoption?
Major challenges: (1) Trust and security between agents from different organizations. (2) Error propagation in multi-agent chains. (3) Early-stage ecosystem with limited tooling. (4) Orchestration complexity as more agents join workflows. (5) Cost optimization when each agent call costs money. The protocol is promising but still maturing.
Frequently Asked Questions
What is A2A Protocol?
Understand Google's Agent-to-Agent (A2A) protocol - the open standard for AI agents to discover each other, negotiate capabilities, and collaborate on complex tasks. The HTTP of the agent world.
How does A2A Protocol work?
The Language AI Agents Use to Collaborate A2A Explained Simply: The Agent-to-Agent (A2A) protocol, created by Google, is an open standard that enables AI agents built by different companies, using different frameworks, to discover each other, communicate, and collaborate on tasks. Without A2A, agents from different…
Related topics
Practice this on DevInterviewMaster
Read the full A2A Protocol 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.