Skip to main content

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

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:
Response:
Response:

Task States

The A2A protocol defines specific states for the task lifecycle:

Authentication

The protocol supports different authentication methods:

Tips and Best Practices

  • Use UUID v4 for all required IDs (messageId, id, etc.)
  • Maintain consistency in IDs for proper tracking
  • Always save the returned contextId for continuous conversations
  • Send the contextId in all subsequent messages of the same conversation
  • Use Base64 without header in the bytes field
  • Always specify the correct mimeType
  • Consider the maximum size supported by the server
  • Handle ping events (: ping) appropriately
  • Close the EventSource connection when final: true
  • Implement reconnection handling for robustness
  • Configure CORS on the server (Access-Control-Allow-Origin: *) for browser testing
  • Use appropriate headers for production

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.