====== A2A Protocol ====== **Agent-to-Agent (A2A)** is an open-source communication protocol developed by **Google**, launched at Google Cloud Next '25 in April 2025. A2A enables secure, interoperable communication between AI agents from different vendors, frameworks, and cloud environments. It complements Anthropic's [[mcp|Model Context Protocol (MCP)]] by addressing inter-agent networking rather than tool/data integration. Over 50 companies have adopted A2A, including PayPal, Salesforce, and Atlassian. ===== Architecture ===== A2A uses a **client-server model** built on HTTP, Server-Sent Events (SSE), and JSON-RPC — standard web protocols that integrate with existing IT infrastructure. Key architectural layers include: * **Application Layer** — User interfaces (Gradio, Google ADK) that interface with a host agent for orchestration * **A2A Protocol Layer** — Standardized messaging, discovery, and task management * **Integration Layer** — MCP for tool/context access, semantic indexing for data retrieval * **Orchestration Layer** — Multi-agent workflow coordination Agents act as both **A2A Clients** (initiating tasks) and **A2A Servers** (processing incoming tasks), enabling bidirectional communication. ===== How It Works ===== A2A follows a four-step communication flow: **1. Agent Discovery**: Clients fetch an **Agent Card** — a metadata JSON file hosted at ''/.well-known/agent.json'' — that describes the agent's capabilities, endpoints, and preferences. This enables automatic discovery and matching of suitable agents. **2. Task Initiation**: The client submits a **Task Object** (structured JSON with objectives, inputs, and parameters) to the remote agent's server endpoint. **3. Messaging and Status Updates**: Agents exchange **messages** containing "parts" (text, images, or UI negotiations). The protocol supports push notifications, streaming for real-time progress, and status tracking (pending, working, completed). **4. Result Delivery**: The server returns **artifacts** in multi-format outputs. Long-running tasks are supported with human-in-the-loop feedback capabilities. ===== Relationship to MCP ===== A2A and MCP are complementary protocols that serve different purposes in the agent ecosystem: ^ Aspect ^ A2A (Google) ^ MCP (Anthropic) ^ | Primary Focus | Inter-agent communication | Single-agent tool/context integration | | Scope | Multi-agent networking across vendors | Plugins for data/tools within one agent | | Analogy | Networking layer | Plugin system | | Use Case | Large-scale collaborative workflows | Enhancing individual agent capabilities | | Launched | April 2025 | November 2024 | | Adoption | 50+ companies | Widespread across LLM providers | In practice, they are used together: A2A handles inter-agent communication while MCP handles each agent's connection to enterprise tools and data sources. ===== Key Features ===== * **Standards-Based**: Built on HTTP, SSE, and JSON-RPC for easy adoption * **Secure by Default**: Enterprise-grade authentication (OAuth, OpenAPI parity) * **Long-Running Tasks**: Real-time updates and notifications for tasks spanning hours or days * **Modality Agnostic**: Supports text, audio, video streaming, and UI negotiation (iframes, forms) * **Framework Agnostic**: Works across any agent framework or cloud platform * **Scalable**: Plug-and-play cross-platform interoperability ===== Agent Card Example ===== # Fetching an Agent Card for discovery import httpx async def discover_agent(base_url: str) -> dict: async with httpx.AsyncClient() as client: response = await client.get(f'{base_url}/.well-known/agent.json') card = response.json() # Card contains: name, description, capabilities, endpoints print(f'Agent: {card["name"]}') print(f'Capabilities: {card["capabilities"]}') return card # Sending a task to a discovered agent async def send_task(agent_url: str, task: dict) -> dict: payload = { "jsonrpc": "2.0", "method": "tasks/send", "params": task, "id": "1" } async with httpx.AsyncClient() as client: response = await client.post(agent_url, json=payload) return response.json() ===== References ===== * [[https://developers.googleblog.com/en/a2a-a-new-era-of-agent-interoperability/|Google Developers Blog — A2A: A New Era of Agent Interoperability]] * [[https://github.com/google/a2a|A2A Protocol GitHub Repository]] * [[https://cloud.google.com/blog/topics/developers-practitioners/building-connected-agents-with-mcp-and-a2a|Google Cloud — Building Connected Agents with MCP and A2A]] * [[https://developers.googleblog.com/developers-guide-to-ai-agent-protocols/|Google Developers Guide to AI Agent Protocols]] ===== See Also ===== * [[mcp|Model Context Protocol (MCP)]] — Anthropic's tool integration protocol * [[multi_agent_systems]] — Multi-agent system architectures * [[claude_agent_sdk]] — Anthropic Claude Agent SDK * [[openai_agents_sdk]] — OpenAI Agents SDK