A2A Protocol — Agent-to-Agent Communication Standard
Google's open protocol for AI agents to discover, communicate, and collaborate across frameworks. SDKs for Python, TypeScript, Java, Go, and .NET. 23,000+ stars, Apache 2.0.
先审查再安装
这个资产需要先审查。复制的指令会要求 Agent dry-run、列出写入项,确认后再继续。
npx -y tokrepo@latest install 0c013210-cbd4-4cb8-a5f7-8a77635698b2 --target codex先 dry-run,确认写入项后再运行此命令。
What it is
The A2A (Agent-to-Agent) Protocol is Google's open standard for AI agents to discover each other's capabilities, communicate, and collaborate regardless of the framework they were built with. Each agent publishes an Agent Card describing its skills, and other agents use the protocol to delegate tasks, exchange data, and coordinate multi-agent workflows. SDKs are available for Python, TypeScript, Java, Go, and .NET.
Developers building multi-agent systems where agents from different frameworks need to interoperate benefit from A2A. It solves the problem of vendor lock-in in agent orchestration by providing a shared communication layer.
How it saves time or tokens
Without A2A, connecting agents built on different frameworks requires custom integration code for each pair. A2A standardizes this with a single protocol, reducing the integration work from O(n^2) to O(n). Agents can also discover each other's capabilities dynamically, avoiding the overhead of hardcoded routing logic.
How to use
- Install the A2A SDK for your language
- Create an Agent Card describing your agent's capabilities
- Implement the A2A server interface and connect to other A2A agents
Example
# Python SDK
from a2a import A2AServer, AgentCard, Task
card = AgentCard(
name='code-reviewer',
description='Reviews Python code for bugs and style issues',
skills=['code-review', 'python']
)
class MyAgent(A2AServer):
def handle_task(self, task: Task):
code = task.input['code']
# Review the code...
return {'review': 'LGTM, no issues found'}
agent = MyAgent(card=card)
agent.start(port=8080)
# TypeScript/JavaScript
npm install @a2a-js/sdk
# Go
go get github.com/a2aproject/a2a-go
Related on TokRepo
- Multi-agent frameworks — Compare multi-agent orchestration tools
- AI tools for agents — Browse agent frameworks and protocols
Common pitfalls
- A2A is a communication protocol, not an orchestration framework; you still need logic to decide which agent handles which task
- Agent discovery requires a registry or known endpoints; there is no global agent directory built into the protocol
- Protocol adoption is early; expect breaking changes in the SDK as the specification evolves
常见问题
MCP (Model Context Protocol) connects AI agents to tools and data sources. A2A connects agents to each other. They are complementary: an agent uses MCP to access tools and A2A to collaborate with other agents.
Official SDKs are available for Python, TypeScript/JavaScript, Java, Go, and .NET. The protocol is language-agnostic, so any language that can handle HTTP/JSON can implement it.
An Agent Card is a JSON document that describes an agent's identity, capabilities, and skills. Other agents read the card to discover what tasks the agent can handle. It serves as the agent's public interface definition.
A2A is an open specification with growing adoption. It is suitable for building production multi-agent systems, though the protocol and SDKs are still evolving. Pin your SDK version and monitor for breaking changes.
Not directly through the A2A protocol. You would need to wrap a non-A2A agent with an A2A server interface that translates between the protocols. This is similar to writing an API adapter.
引用来源 (3)
- A2A Protocol GitHub— Google's open protocol for agent-to-agent communication
- A2A Documentation— SDKs for Python, TypeScript, Java, Go, and .NET
- A2A Specification— Agent Card specification for capability discovery
来源与感谢
讨论
相关资产
Google A2A — Agent-to-Agent Communication Protocol
Open protocol by Google for AI agents to discover, authenticate, and communicate with each other. Enables multi-agent systems across different frameworks and providers. 10,000+ stars.
CAMEL — Multi-Agent and Tooling Library
CAMEL is an open-source library for multi-agent systems and tools. Install `camel-ai`, then compose agents, tools, and optional web helpers in Python.
Protocol Buffers — Language-Neutral Data Serialization by Google
Protocol Buffers (protobuf) is Google's language-neutral, platform-neutral mechanism for serializing structured data, used extensively in gRPC and microservice communication.
Protocol Buffers — Language-Neutral Data Serialization by Google
Protocol Buffers (protobuf) is Google's language-neutral, platform-neutral mechanism for serializing structured data. It is smaller, faster, and simpler than XML or JSON for inter-service communication and data storage.