Introduction
MCP connects the agent to tools/data. But what about when you need the agent to connect to another agent? A2A (Agent-to-Agent Protocol) — developed by Google — solves this problem.
1. A2A vs MCP
| MCP | A2A | |
|---|---|---|
| Connect | Agent ↔ Tools/Data | Agent ↔ Agent |
| Model | Client/Server | Peer-to-Peer |
| Discovery | Tool schemas | Agent Cards |
| Use cases | Read DB, call API | Delegate tasks between agents |
2. Agent Cards
{
"name": "Research Agent",
"description": "Tìm kiếm và tổng hợp thông tin",
"capabilities": ["web_search", "summarize", "translate"],
"endpoint": "https://research-agent.example.com/a2a",
"input_schema": {...},
"output_schema": {...}
}
3. Cross-Framework Communication
A2A allows agents from LangGraph to communicate with agents from CrewAI, AutoGen, or any other framework.
Summary
- A2A = protocol for agent-to-agent communication
- Agent Cards = self-description for capability discovery
- MCP + A2A = full connectivity (tools + agents)
- Cross-framework interoperability
Exercises
- Create Agent Cards for 3 different agents
- Implement simple A2A server
- Demo 2 agents from 2 frameworks communicate
- Comparison: direct call vs via A2A protocol