A2A Protocol
Integrate agents using the Agent-to-Agent protocol for standardized communication between AI agents
Overview
The Agent-to-Agent Protocol (A2A) is a standardized protocol developed by Google to enable structured communication between independent AI agents. Using JSON-RPC 2.0 over HTTP/HTTPS, A2A facilitates interoperability between different agent systems, allowing them to work together efficiently.
Official Protocol: A2A is maintained by Google and is available at google.github.io/A2A. The source code can be found in the GitHub repository.
Key Features
JSON-RPC 2.0
Protocol based on JSON-RPC 2.0 for structured and standardized communication
Multi-turn
Native support for multi-turn conversations using contextId
File Upload
File transfer via Base64 with support for different MIME types
Streaming
Asynchronous communication via Server-Sent Events (SSE) for real-time responses
Quick Overview
Key Point | Summary |
---|---|
Objective | Standardize conversation between AI agents (regardless of vendor) using JSON-RPC 2.0 |
Base format | Each call is a JSON object with jsonrpc:"2.0" , id , method and params |
Main methods | message/send • message/stream • tasks/get • tasks/cancel • tasks/pushNotificationConfig/{set|get} • tasks/resubscribe • agent/authenticatedExtendedCard |
Required IDs | messageId (UUID v4) within each message and id /taskId /callId to track request and task |
First-class features | Multi-turn conversations (contextId ) • File upload (parts[] type file with Base64 + MIME) • Push notifications via pushNotificationConfig • Authentication via x-api-key or Authorization: Bearer |
Task lifecycle | submitted → working → completed / failed / canceled , reported in result.status.state |
Protocol Methods
message/send (Synchronous HTTP)
The main method for sending messages synchronously.
message/stream (Asynchronous SSE)
For real-time communication with streaming responses.
Implementation Examples
cURL
JavaScript / Fetch
Python
File Upload
The A2A protocol supports file upload through the file
type in parts
:
Base64 Format: Files must be encoded in Base64 without the data:mime/type;base64,
header.
Only the pure Base64 content should be included in the bytes
field.
Multi-turn Conversations
To maintain context between multiple messages, use the contextId
:
Task States
The A2A protocol defines specific states for the task lifecycle:
State | Description |
---|---|
submitted | Task has been received and is in the queue |
working | Task is being processed |
completed | Task completed successfully |
failed | Task failed during processing |
canceled | Task was canceled by the user |
Authentication
The protocol supports different authentication methods:
Tips and Best Practices
Additional Resources
Official Specification
Complete A2A protocol documentation maintained by Google
GitHub Repository
Source code, examples and issues for the A2A project
Quick Start Guide
Set up your first agent in less than 2 minutes
Agent Types
Explore different types of agents compatible with A2A
With the A2A protocol, you can quickly integrate any agent or front-end application into the Evo AI ecosystem, ensuring interoperability and standardized communication between different AI agent systems.