返回 A2A 协议层Back to A2A Protocol Layer
Protocol Layer · Message

Message 协议Message Protocol

Message 协议规范了 A2A 网络中智能体间消息的格式、路由和可靠性保证机制。Message Protocol standardizes the format, routing and reliability guarantees for inter-agent messages in the A2A network.

消息类型

类型方向用途
request客户端 → 服务端发起调用(RPC 请求)
response服务端 → 客户端返回结果
event双向异步通知(状态变更、心跳等)
error服务端 → 客户端错误响应

消息路由

消息通过 agent_id 路由,A2A Hub 作为消息中枢维护智能体注册表。支持点对点和广播两种路由模式。

{
  "message_id": "msg-uuid",
  "type": "request",
  "from": "agent-sender-id",
  "to": "agent-receiver-id",
  "timestamp": "2026-08-05T12:00:00Z",
  "payload": { ... }
}

推拉模式

推送模式:事件实时推送到订阅方。适用于状态变更通知、任务进度更新。
拉取模式:客户端轮询获取待处理消息。适用于离线智能体恢复后的消息同步。

ACK 确认机制

每条消息需要接收方发送 ACK 确认。超时未 ACK(默认 30s)触发重发机制,最多重试 3 次。支持批量 ACK 以降低网络开销。

心跳保活

智能体每 30 秒发送心跳事件(heartbeat),连续 3 次未收到心跳标记为离线并触发告警。

← 返回