返回市场
卓越-A2A

卓越-A2A

作者:ai-boost469 星标更新:2025-10-27

项目介绍

# 技术文档摘要
<div align="center">
  <h1>✨ 非常棒的 A2A(Agent2Agent 协议)✨</h1>

  <img src="assets/banner.png" alt="A2A 细节网络或连接图形" width="100%">

  <p align="center">
    一份精选资源列表,包括与 <strong>Agent2Agent (A2A) 协议</strong> 相关的实现、工具和示例,用于 AI 代理之间的互操作性。
  </p>

  <!-- 保留这些链接。翻译会自动更新 README。 -->
  <p align="center">
    <a href="https://zdoc.app/de/ai-boost/awesome-a2a">德语</a> |
    <a href="https://zdoc.app/en/ai-boost/awesome-a2a">英语</a> |
    <a href="https://zdoc.app/es/ai-boost/awesome-a2a">西班牙语</a> |
    <a href="https://zdoc.app/fr/ai-boost/awesome-a2a">法语</a> |
    <a href="https://zdoc.app/ja/ai-boost/awesome-a2a">日语</a> |
    <a href="https://zdoc.app/ko/ai-boost/awesome-a2a">韩语</a> |
    <a href="https://zdoc.app/pt/ai-boost/awesome-a2a">葡萄牙语</a> |
    <a href="https://zdoc.app/ru/ai-boost/A2A">俄语</a> |
    <a href="https://zdoc.app/zh/ai-boost/awesome-a2a">中文</a>
  </p>

  <p align="center">
    <a href="https://awesome.re"><img src="https://awesome.re/badge.svg" alt="Awesome"></a>
    <a href="https://opensource.org/license/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="MIT 许可证"></a>
    <a href="https://github.com/ai-boost/awesome-a2a"><img src="https://img.shields.io/github/stars/ai-boost/awesome-a2a.svg?style=social&label=Star" alt="GitHub Stars"></a>
    <a href="https://github.com/ai-boost/awesome-a2a"><img src="https://img.shields.io/github/forks/ai-boost/awesome-a2a.svg?style=social&label=Fork" alt="GitHub Forks"></a>
  </p>
</div>

> Agent2Agent (A2A) 协议正在革新 AI 代理之间的通信和协作方式——使不同框架、供应商和平台之间无缝互操作。此仓库收集了最好的资源,帮助开发者构建兼容 A2A 的代理。

## 内容

*   [🤔 什么是 A2A?(简要介绍)](#-什么是-a2a-简要介绍)
*   [💡 核心原则](#-核心原则)
*   [⚙️ A2A 如何工作?(高层次概述)](#️-a2a如何工作高层次概述)
*   [🚀 开始使用 A2A](#-开始使用-a2a)
*   [🏛️ 官方资源](#️-官方资源)
*   [📜 规范及核心概念](#-规范--核心概念)
*   [⚙️ 实现及库](#️-实现--库)
    *   [官方示例](#官方示例)
    *   [框架集成(官方示例)](#框架集成官方示例)
    *   [社区实现](#社区实现)
        *   [SDK 及库(按语言分类)](#sdk--库按语言分类)
        *   [框架](#框架)
        *   [平台及集成解决方案](#平台--集成解决方案)
*   [🛠️ 工具及实用程序](#️-工具--实用程序)
*   [📚 教程及文章](#-教程--文章)
*   [🎬 演示及示例](#-演示--示例)
*   [🔗 相关协议及概念](#-相关协议--概念)
*   [💬 社区](#-社区)
*   [贡献](#贡献)

---

## 🤔 什么是 A2A?(简要介绍)

A2A(Agent2Agent)是来自 Google 及其合作伙伴的一个**开放协议**,允许来自不同供应商/框架的**AI 代理**进行**安全通信**和**任务协作**。它旨在打破孤立的代理系统之间的壁垒,使得跨应用自动化更加复杂。

**⭐ 官方网站:** [a2aproject.github.io/A2A](https://a2aproject.github.io/A2A) | **⭐ 官方 GitHub:** [github.com/a2aproject/A2A](https://github.com/a2aproject/A2A) | 🌐 **多语言文档(英文/中文/日文):** [agent2agent.ren](https://agent2agent.ren)

## 💡 核心原则

*   **简单:** 使用现有标准(HTTP、JSON-RPC、SSE)。
*   **企业就绪:** 关注认证、安全性、隐私、监控。
*   **异步优先:** 处理长时间运行的任务及人机交互。
*   **模态无关:** 支持文本、文件、表单、流等。
*   **不透明执行:** 代理交互时无需共享内部逻辑/工具。

## ⚙️ A2A 如何工作?(高层次概述)

1.  **发现:** 代理发布一个描述能力、端点和认证需求的 `Agent Card`(JSON)。
2.  **通信:** 一个 `客户端` 代理通过 HTTP/JSON-RPC 2.0 向 `远程代理(服务器)` 发送一个包含 `消息` 和 `部分` 的 `任务` 请求。
3.  **执行及响应:** 服务器处理任务,更新其 `状态`。它以最终状态和任何生成的 `工件`(结果,也包含 `部分`)作为响应。
4.  **更新:** 对于长时间任务,服务器可以选择通过 Server-Sent Events (SSE) 流式传输 `TaskStatusUpdateEvent` 或 `TaskArtifactUpdateEvent`,或者使用推送通知。

*详情参见[官方技术文档](https://a2aproject.github.io/A2A/#/documentation)。*

---

## 🚀 开始使用 A2A

新接触 A2A?这里有一个建议路径:

1.  **理解基础:** 阅读上面的部分([什么是 A2A?](#-什么是-a2a-简要介绍),[核心原则](#-核心原则),[它是如何工作的](#️-a2a如何工作高层次概述))。查看 📰 [公告博客文章](https://developers.googleblog.com/en/a2a-a-new-era-of-agent-interoperability/)。
2.  **探索核心概念:** 深入阅读 📖 [官方技术文档](https://a2aproject.github.io/A2A/#/documentation),重点关注 `Agent Card`、`任务`、`消息`、`部分` 和 `工件`。
3.  **观看演示:** 观看 🎥 [官方演示视频](https://storage.googleapis.com/gweb-developer-goog-blog-assets/original_videos/A2A_demo_v4.mp4) 并探索代码,如 🌐 [多代理 Web 应用演示](https://github.com/a2aproject/A2A/tree/v0.2.1/demo)。
4.  **运行示例:** 克隆 [官方示例仓库](https://github.com/a2aproject/a2a-samples) 并按照说明运行一个客户端(如 CLI)和一个示例代理(例如 LangGraph 或 Genkit 代理)。
5.  **审查代码:** 查看官方示例中的 `common`(Python)或 `server`/`client`(JS/TS)库,了解 A2A 通信是如何实现的。
6.  **尝试构建:** 修改一个示例或使用一个库来创建自己的基本 A2A 代理或客户端。

---

## 🏛️ 官方资源

*   📄 [A2A 协议网站](https://a2aproject.github.io/A2A) - 主要文档站点。
*   💻 [google/A2A GitHub 仓库](https://github.com/a2aproject/A2A) - 规范、文档和官方示例的源代码。
*   📰 [Google 开发者博客文章](https://developers.googleblog.com/en/a2a-a-new-era-of-agent-interoperability/) - 解释动机和合作伙伴的公告博客文章。

## 📜 规范及核心概念

*(参见[它是如何工作的?](#️-a2a如何工作高层次概述)上方的总结)*

*   📖 [A2A 技术文档](https://a2aproject.github.io/A2A/#/documentation) - **(详细信息)** 对参与者、传输、认证、核心对象(任务、工件、消息、部分)、Agent Card 等的详细解释。
*   📄 [JSON 规范](https://github.com/a2aproject/A2A/tree/main/specification/json) - A2A 结构的原始 JSON 模式定义。
*   💡 [核心原则(文档)](https://a2aproject.github.io/A2A/#/documentation?id=key-principles) - 官方文档中核心原则部分的链接。
*   🃏 [Agent Card 规范(文档)](https://a2aproject.github.io/A2A/#/documentation?id=agent-card) - 官方文档中 Agent Card 部分的链接。
*   🗺️ [代理发现(主题)](https://a2aproject.github.io/A2A/#/topics/agent_discovery.md) - 讨论客户端如何找到代理卡。
*   🔔 [推送通知(主题)](https://a2aproject.github.io/A2A/#/topics/push_notifications.md) - 推送通知机制的细节。
*   🛡️ [企业就绪(主题)](https://a2aproject.github.io/A2A/#/topics/enterprise_ready.md) - 讨论安全、认证、隐私方面的问题。

## ⚙️ 实现及库

#### 官方示例

*这些展示了基本的 A2A 客户端/服务器通信。*

| 语言          | 示例名称                | 一句话描述                                         | GitHub URL                                                                                                                                                                              |
| ------------- | ----------------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 🔷 **TypeScript** | Genkit SDK Core            | TS SDK + CLI,构建前端和后端的共享代码      | [https://github.com/a2aproject/a2a-samples/tree/main/samples/js](https://github.com/a2aproject/a2a-samples/tree/main/samples/js)                                                        |
|               | Movie Recommendation Agent | 使用 Genkit 构建的电影推荐对话代理  | [https://github.com/a2aproject/a2a-samples/tree/main/samples/js/src/agents/movie-agent](https://github.com/a2aproject/a2a-samples/tree/main/samples/js/src/agents/movie-agent)                                |
|               | TypeScript Client          | 用 TS 编写的纯前端调用示例                     | [https://github.com/a2aproject/a2a-samples/tree/main/samples/js/client](https://github.com/a2aproject/a2a-samples/tree/main/samples/js/client)                                          |
|               | Node Express Server        | 使用 Node/Express 实现的 A2A HTTP 服务               | [https://github.com/a2aproject/a2a-samples/tree/main/samples/js/server](https://github.com/a2aproject/a2a-samples/tree/main/samples/js/server)                                          |
| ☕ **Java**        | Custom Client              | 带有流监听器的 Java 客户端                          | [https://github.com/a2aproject/a2a-samples/tree/main/samples/java/custom_java_impl/client](https://github.com/a2aproject/a2a-samples/tree/main/samples/java/custom_java_impl/client)    |
|               | Data Models                | 完整的一组 POJO 数据模型                             | [https://github.com/a2aproject/a2a-samples/tree/main/samples/java/custom_java_impl/model](https://github.com/a2aproject/a2a-samples/tree/main/samples/java/custom_java_impl/model)      |
|               | Custom Server              | Spring Boot A2A 服务器实现                        | [https://github.com/a2aproject/a2a-samples/tree/main/samples/java/custom_java_impl/server](https://github.com/a2aproject/a2a-samples/tree/main/samples/java/custom_java_impl/server)    |
|               | Dice Agent (Multi-Transport) | 支持多种传输协议的代理              | [https://github.com/a2aproject/a2a-samples/tree/main/samples/java/agents/dice_agent_multi_transport](https://github.com/a2aproject/a2a-samples/tree/main/samples/java/agents/dice_agent_multi_transport) |
|               | Magic 8-Ball (Security)    | 专注于安全的代理,带有 OAuth2                           | [https://github.com/a2aproject/a2a-samples/tree/main/samples/java/agents/magic_8_ball_security](https://github.com/a2aproject/a2a-samples/tree/main/samples/java/agents/magic_8_ball_security) |
|               | Content Writer Agent       | 内容生成代理                                     | [https://github.com/a2aproject/a2a-samples/tree/main/samples/java/agents/content_writer](https://github.com/a2aproject/a2a-samples/tree/main/samples/java/agents/content_writer)        |
|               | Content Editor Agent       | 内容编辑代理                                        | [https://github.com/a2aproject/a2a-samples/tree/main/samples/java/agents/content_editor](https://github.com/a2aproject/a2a-samples/tree/main/samples/java/agents/content_editor)        |
|               | Weather MCP Agent          | 集成 MCP 的天气代理                           | [https://github.com/a2aproject/a2a-samples/tree/main/samples/java/agents/weather_mcp](https://github.com/a2aproject/a2a-samples/tree/main/samples/java/agents/weather_mcp)              |
| 💠 **.NET**       | Basic A2A Demo             | 回声和计算器服务器示例                          | [https://github.com/a2aproject/a2a-samples/tree/main/samples/dotnet/BasicA2ADemo](https://github.com/a2aproject/a2a-samples/tree/main/samples/dotnet/BasicA2ADemo)                      |
|               | CLI Demo                   | 命令行客户端和服务器示例                          | [https://github.com/a2aproject/a2a-samples/tree/main/samples/dotnet/A2ACliDemo](https://github.com/a2aproject/a2a-samples/tree/main/samples/dotnet/A2ACliDemo)                          |
|               | Semantic Kernel Demo       | 与 Semantic Kernel 集成                             | [https://github.com/a2aproject/a2a-samples/tree/main/samples/dotnet/A2ASemanticKernelDemo](https://github.com/a2aproject/a2a-samples/tree/main/samples/dotnet/A2ASemanticKernelDemo)    |
| 🐍 **Python**     | CLI Host                   | 与 A2A 代理交互的命令行界面       | [https://github.com/a2aproject/a2a-samples/tree/main/samples/python/hosts/cli](https://github.com/a2aproject/a2a-samples/tree/main/samples/python/hosts/cli)                                        |
|               | Hello World                | 推荐的首次运行“Hello World”模板                 | [https://github.com/a2aproject/a2a-samples/tree/main/samples/python/agents/helloworld](https://github.com/a2aproject/a2a-samples/tree/main/samples/python/agents/helloworld)                          |
|               | LangGraph Agent            | 使用 LangGraph 来编排多轮对话            | [https://github.com/a2aproject/a2a-samples/tree/main/samples/python/agents/langgraph](https://github.com/a2aproject/a2a-samples/tree/main/samples/python/agents/langgraph)                            |
|               | CrewAI Agent               | 展示 CrewAI 的多角色协作            | [https://github.com/a2aproject/a2a-samples/tree/main/samples/python/agents/crewai](https://github.com/a2aproject/a2a-samples/tree/main/samples/python/agents/crewai)                                  |
|               | Semantic Kernel Agent      | 使用 Semantic Kernel 编排工具                      | [https://github.com/a2aproject/a2a-samples/tree/main/samples/python/agents/semantickernel](https://github.com/a2aproject/a2a-samples/tree/main/samples/python/agents/semantickernel)                  |
|               | AG2 Agent                  | 最小的 AG2 互调示例                              | [https://github.com/a2aproject/a2a-samples/tree/main/samples/python/agents/ag2](https://github.com/a2aproject/a2a-samples/tree/main/samples/python/agents/ag2)                                        |
|               | ADK Expense Reimbursement  | 多轮费用报销,带表单                  | [https://github.com/a2aproject/a2a-samples/tree/main/samples/python/agents/adk_expense_reimbursement](https://github.com/a2aproject/a2a-samples/tree/main/samples/python/agents/adk_expense_reimbursement) |
|               | Birthday Planner (ADK)     | 使用 ADK 的多步骤生日派对策划者                   | [https://github.com/a2aproject/a2a-samples/tree/main/samples/python/agents/birthday_planner_adk](https://github.com/a2aproject/a2a-samples/tree/main/samples/python/agents/birthday_planner_adk)    |
|               | Azure AI Foundry Agent     | 使用 Azure AI Foundry SDK 的示例                           | [https://github.com/a2aproject/a2a-samples/tree/main/samples/python/agents/azureaifoundry