Giới thiệu
MCP kết nối agent với tools/data. Nhưng khi bạn cần agent kết nối với agent khác thì sao? A2A (Agent-to-Agent Protocol) — do Google phát triển — giải quyết vấn đề này.
1. A2A vs MCP
| MCP | A2A | |
|---|---|---|
| Kết nối | Agent ↔ Tools/Data | Agent ↔ Agent |
| Mô hình | Client/Server | Peer-to-Peer |
| Discovery | Tool schemas | Agent Cards |
| Use case | Đọc DB, gọi API | Delegate tasks giữa 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 cho phép agent từ LangGraph giao tiếp với agent từ CrewAI, AutoGen, hoặc bất kỳ framework nào.
Tóm tắt
- A2A = protocol cho agent-to-agent communication
- Agent Cards = self-description cho capability discovery
- MCP + A2A = full connectivity (tools + agents)
- Cross-framework interoperability
Bài tập
- Tạo Agent Card cho 3 agents khác nhau
- Implement A2A server đơn giản
- Demo 2 agents từ 2 frameworks communicate
- So sánh: trực tiếp call vs qua A2A protocol