# 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. ## Install Save in your project root: ## Quick Use ```python # Install pip install a2a-sdk # Create an A2A server (your agent becomes discoverable) from a2a import A2AServer, AgentCard card = AgentCard( name="code-reviewer", description="Reviews code for bugs and best practices", capabilities=["code_review", "security_audit"], endpoint="https://my-agent.example.com/a2a", ) server = A2AServer(agent_card=card) @server.on_task async def handle_task(task): # Another agent sent you a task code = task.input["code"] review = await review_code(code) return {"review": review, "score": 8} server.run(port=8080) ``` --- ## Intro Google A2A (Agent-to-Agent) is an open protocol for AI agents to discover, authenticate, and communicate with each other with 10,000+ GitHub stars. While MCP connects agents to tools, A2A connects agents to other agents — enabling multi-agent systems where a coding agent can delegate security review to a specialist agent, or a research agent can request data from an analytics agent. The protocol defines Agent Cards (discovery), task delegation, streaming responses, and authentication. Best for teams building multi-agent systems that need to interoperate across frameworks. Works with: any language, any agent framework. Setup time: under 5 minutes. --- ## How A2A Works ### The Problem MCP connects agents to tools. But what about agent-to-agent communication? ``` Without A2A: Agent A (LangGraph) -- cannot talk to -- Agent B (CrewAI) With A2A: Agent A (any framework) <-- A2A Protocol --> Agent B (any framework) ``` ### Agent Cards (Discovery) Every A2A agent publishes an Agent Card at `/.well-known/agent.json`: ```json { "name": "security-auditor", "description": "Scans code for security vulnerabilities", "capabilities": ["security_audit", "dependency_scan", "owasp_check"], "endpoint": "https://security-agent.example.com/a2a", "authentication": { "type": "bearer" } } ``` Other agents discover capabilities by fetching Agent Cards. ### Task Delegation ```python from a2a import A2AClient client = A2AClient("https://security-agent.example.com/a2a") # Send a task to the security agent result = await client.send_task({ "type": "security_audit", "input": {"code": "...", "language": "python"} }) # result: {"vulnerabilities": [...], "risk_score": "low"} ``` ### Streaming Responses ```python async for chunk in client.stream_task({"type": "code_review", "input": {...}}): print(chunk) # Real-time updates from the remote agent ``` ### Multi-Agent Architecture ``` Orchestrator Agent |-- A2A --> Code Writer Agent (writes code) |-- A2A --> Security Agent (reviews for vulnerabilities) |-- A2A --> Test Agent (generates and runs tests) |-- A2A --> Deploy Agent (deploys to production) ``` ### A2A vs MCP | Protocol | Connects | Direction | |----------|----------|-----------| | MCP | Agent <-> Tool | Agent calls tools | | A2A | Agent <-> Agent | Agents collaborate | They are complementary: - MCP: Agent uses a GitHub tool to create a PR - A2A: Agent asks another agent to review the PR ### Key Stats - 10,000+ GitHub stars - By Google DeepMind - Agent discovery via Agent Cards - Task delegation with streaming - Framework-agnostic ### FAQ **Q: What is A2A?** A: An open protocol by Google for AI agents to discover and communicate with each other, enabling multi-agent systems across different frameworks. **Q: Is A2A free?** A: Yes, open protocol and SDK under Apache 2.0. **Q: A2A vs MCP?** A: MCP connects agents to tools. A2A connects agents to other agents. Use both together for full agent ecosystems. --- ## Source & Thanks > Created by [Google](https://github.com/google). Licensed under Apache 2.0. > > [A2A](https://github.com/google/A2A) — stars 10,000+ Thanks to Google for standardizing how agents talk to each other. --- ## 快速使用 ```python pip install a2a-sdk ``` ```python from a2a import A2AClient client = A2AClient("https://security-agent.example.com/a2a") result = await client.send_task({"type": "security_audit", "input": {"code": "..."}}) ``` --- ## 简介 Google A2A(Agent-to-Agent)是一个开放协议,GitHub 10,000+ stars。让不同框架的 AI Agent 相互发现、认证和通信。MCP 连接 Agent 和工具,A2A 连接 Agent 和 Agent。适合构建需要跨框架互操作的多 Agent 系统。 --- ## 来源与感谢 > Created by [Google](https://github.com/google). Licensed under Apache 2.0. > > [A2A](https://github.com/google/A2A) — stars 10,000+ --- Source: https://tokrepo.com/en/workflows/165627cf-cebe-47d3-9293-f75353499fd9 Author: AI Open Source