A2A Protocol (Agent-to-Agent)

A2A (Agent-to-Agent Protocol) is an open standard protocol designed to enable AI agents from different vendors, built with different frameworks, to communicate and collaborate with each other directly.

CN: A2A(Agent-to-Agent Protocol,智能体间协议)是一个开放标准协议,旨在让来自不同供应商、使用不同框架构建的 AI 智能体能够直接相互通信和协作。

Core Content of A2A

Core Actors

角色 (Role)ENCN
A2A Client (Client Agent)An application, service, or AI agent that initiates communication and delegates tasks to remote agents.发起通信并将任务委托给远程智能体的应用程序、服务或 AI 智能体。
A2A Server (Remote Agent)An AI agent that exposes an HTTP endpoint, receives requests, processes tasks, and returns results.暴露 HTTP 端点、接收请求、处理任务并返回结果的 AI 智能体。

Agent Card

A JSON metadata document, typically at /.well-known/agent.json, that describes an A2A Server.

CN: 一个 JSON 元数据文档,通常在 /.well-known/agent.json 路径,描述 A2A 服务器。

EN: It contains: agent identity (name, description), endpoint URL, version, supported capabilities (streaming, push notifications), skills offered, input/output modalities, and authentication requirements.

CN: 它包含:智能体身份(名称、描述)、端点 URL、版本、支持的能力(流式、推送通知)、提供的技能、输入/输出模态和认证要求。

EN: Think of it as an agent’s business card that tells other agents: “This is who I am, what I can do, and how to talk to me.”

CN: 把它想象成 智能体的名片,告诉其他智能体:”我是谁,我能做什么,以及如何与我对话。

Task

The unit of work in A2A. When a client delegates to an A2A agent, it sends a task containing the user request and context.

CN: A2A 中的工作单元。当客户端委托给 A2A 智能体时,它发送一个包含用户请求和上下文的任务。

EN: Each task has a unique ID and progresses through a lifecycle: submitted → working → input-required → completed → failed.

CN: 每个任务有唯一 ID,并通过生命周期推进:submitted → working → input-required → completed → failed

EN: Tasks are stateful and can involve multiple exchanges between client and server.

CN: 任务是 有状态的,可以涉及客户端和服务器之间的多次交换。

Message & Part

Message represents a single turn of communication. It has a role (“user” or “agent”) and contains one or more Parts.

CN: Message 代表单轮通信。它有 role(”user” 或 “agent”)并包含一个或多个 Part

EN: Part is the fundamental unit of content — can be TextPart (plain text) or FilePart (file, as base64 or URI).

CN: Part 是内容的基本单元——可以是 TextPart(纯文本)或 FilePart(文件,base64 或 URI)。

Context ID

Maintains session continuity across agent boundaries. When a user’s session spans multiple turns, the context ID links each delegated task to the same ongoing conversation.

CN: 跨智能体边界维持会话连续性。当用户的会话跨越多个轮次时,上下文 ID 将每个委托的任务与同一正在进行的对话相关联。

A2A vs MCP: Key Differences

This is the most important concept to understand. MCP and A2A are complementary, not competing.

CN: 这是最重要的概念。MCP 和 A2A 是互补的,不是竞争的。

维度 (Dimension)MCP (Model Context Protocol)A2A (Agent-to-Agent)
EN: PurposeConnects LLM to tools and data sourcesConnects agents to other agents
CN: 用途连接 LLM 到工具和数据源连接智能体到其他智能体
EN: DirectionAgent down to toolsAgent out to other agents
CN: 方向智能体 向下 连工具智能体 向外 连其他智能体
EN: ControlOrchestrator controls tool selection and result synthesisExternal agent uses its own reasoning; tools are opaque to orchestrator
CN: 控制编排器控制工具选择和结果合成外部智能体使用自己的推理;工具对编排器不透明
EN: Analogy“How an agent uses its hands and tools”“How agents talk to each other”
CN: 比喻“智能体如何使用手和工具”“智能体之间如何对话”

Key Takeaways

要点 (Point)ENCN
A2A 定义A2A is an open standard for agent-to-agent communicationA2A 是智能体间通信的开放标准
A2A vs MCPMCP = agent to tools; A2A = agent to agents (complementary)MCP = 智能体到工具;A2A = 智能体到智能体(互补)
核心组件Core components: Agent Card, Task, Message, Part, Context ID核心组件:智能体名片、任务、消息、部件、上下文 ID
Agent CardAgent Card is a JSON at /.well-known/agent.json describing agent capabilities智能体名片是 /.well-known/agent.json 的 JSON,描述智能体能力
Task 生命周期Task lifecycle: submitted → working → input-required → completed → failed任务生命周期:submitted → working → input-required → completed → failed
不透明性Remote agent is “opaque” — client doesn’t see its internal tools/logic远程智能体是”不透明的”——客户端看不到其内部工具/逻辑
传输协议A2A uses HTTP(S) with JSON-RPC 2.0A2A 使用 HTTP(S) + JSON-RPC 2.0
现实应用Many systems will use both MCP (inside agents) and A2A (between agents)许多系统会同时使用 MCP(智能体内)和 A2A(智能体间)