Google's Agent2Agent (A2A) Protocol: A Deep Dive With Real-World Examples


AI agents are transforming the way modern software systems operate—automating tasks, making decisions, and interacting with users autonomously. But as enterprises increasingly adopt agent-based architectures, a fundamental problem arises: how do diverse AI agents, built using different frameworks, communicate and collaborate seamlessly?
Enter Google’s Agent2Agent (A2A) — an open, vendor-neutral protocol designed to enable interoperability between autonomous AI agents, regardless of the platforms they’re built on. In this post, we’ll unpack A2A’s principles, architecture, and real-world applications, and compare it with Google’s Model Context Protocol (MCP) to understand when each shines.
🔍 What Is Agent2Agent (A2A)?
Agent2Agent (A2A) is an open protocol developed by Google to support collaboration between black-box AI agents. These agents may vary in purpose, implementation, or deployment environment—but A2A provides the structure they need to discover one another, share tasks, and exchange information.
A2A Enables Agents to:
Discover each other dynamically
Exchange structured tasks and responses
Stream intermediate results or updates
Engage in multi-turn conversations
Operate across modalities (e.g., text, image, audio, structured data)
By abstracting how agents talk to each other, A2A eliminates the tight coupling usually seen in integrated systems. It's particularly useful when agents don’t share memory or tools and must operate independently.
Agent2Agent Protocol Design Principles
The A2A protocol is built around five core principles that emphasize modularity, security, and real-world usability:
1. Agentic by Design
Agents function as autonomous black boxes. They don’t share memory or execution plans. Each agent receives tasks and responds using its own internal logic.
2. Open Standards
A2A leverages existing web protocols for maximum interoperability:
HTTP for transport
JSON-RPC 2.0 for messaging
SSE (Server-Sent Events) for streaming responses
3. Secure by Default
Authentication follows OpenAPI-compatible security schemes, ensuring enterprise-grade protection.
4. Supports Long-Running & Human-in-the-Loop Tasks
Agents can:
Request additional input from users
Pause execution
Stream updates or logs
Handle asynchronous push notifications via secure webhooks
5. Modality-Agnostic
A2A supports diverse content types:
Text
Images
PDFs
Audio/video
Structured formats like JSON or HTML
This flexibility makes it suitable for agents operating across different verticals—from legal tech to IT automation.
How Does A2A Work?
A2A defines a structured lifecycle for communication between agents. Here's how it works, step-by-step:
Core Actors
User: Triggers the task (e.g., “Fix my laptop”).
Client Agent: Formulates the task and sends it to another agent.
Remote Agent: Executes the task and provides results.
Agent Discovery via Agent Cards
Agents advertise themselves using an Agent Card, a standardized JSON file (typically hosted at /.well-known/agent.json
). The card includes:
Agent name, version, host URL
Supported input/output formats
Skills and use-case tags
Auth method
Example payloads
This card enables automated discovery via DNS, registries, or catalogs.
Core Communication Units
Task: The atomic unit of work. Includes state (
submitted
,working
,input-required
,completed
).Messages: Used for conversation (e.g., clarifications).
Artifacts: Immutable results (e.g., PDFs, CSVs, JSON blobs).
Parts: Self-contained data blocks inside messages/artifacts (can be binary, text, or structured).
🔁 Task Lifecycle
Client Agent sends task using JSON-RPC.
Remote Agent begins execution, possibly requesting input or streaming updates.
Task transitions:
submitted
→working
→input-required
→completed
Streaming/async results are sent via SSE or push webhook.
Artifacts can be fetched at the end for final output.
A2A Workflow Example: IT Helpdesk Ticket Resolution
Let’s explore a real-world enterprise use case to see A2A in action:
Scenario: User submits a ticket
"My laptop isn’t turning on after the last update."
Step-by-step Breakdown:
Client Agent receives the task and sends a structured Task object to:
Hardware Diagnostic Agent
Runs hardware checks
Returns log artifacts
If hardware is OK:
Escalates to Software Rollback Agent
Analyzes OS logs
Attempts rollback
If rollback fails:
Invokes Device Replacement Agent
Schedules a new device delivery
Streams confirmation and tracking link
Throughout this process:
Agent Cards enable dynamic discovery
Tasks encapsulate work and messages
Artifacts include logs, rollback summaries, etc.
✅ What makes this a pure A2A flow?
No API tools or OCR involved
Communication is peer-to-peer between opaque agents
Native support for async, streaming, and modality-rich interactions
🔄 A2A vs MCP: When to Use What?
While A2A powers peer-to-peer agent collaboration, the Model Context Protocol (MCP) focuses on tool integration and function calling.
Feature | A2A | MCP |
Goal | Agent collaboration | Tool/function interoperability |
Communication | Natural language, tasks, artifacts | Structured API/tool invocations |
Suitable For | Peer agents working independently | Calling tools like OCR, APIs |
Example | Diagnostic agents working together | Calling a credit score API |
Example: Loan Approval Workflow
Step 1: MCP (Tool Interoperability)
LoanProcessor agent uses MCP to:
Fetch credit score
Retrieve bank history
Validate documents via OCR
Step 2: A2A (Agent Collaboration)
Collaborates with:
RiskAssessmentAgent
ComplianceAgent
DisbursementAgent
Here, MCP handles structured functions, while A2A handles agent coordination and negotiation.
Conclusion
Google’s Agent2Agent protocol is a powerful step toward modular, scalable, and interoperable multi-agent systems. With built-in support for secure discovery, streaming, modality-agnostic content exchange, and asynchronous workflows, A2A unlocks new possibilities for agent-based enterprise automation.
Whether you're using LangGraph, CrewAI, Google ADK, or your own framework, A2A helps your agents communicate as intelligent peers—not just as passive API consumers.
Further Reading
Subscribe to my newsletter
Read articles from Deepak Prasad directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
