Chuyển đến nội dung chính

Lesson 13: Agent-to-Agent (A2A) Protocol — Agents talk to each other

Google A2A Protocol: Agent Cards, capability discovery, task lifecycle, inter-agent communication. Compare A2A vs MCP. Demo two agents from two different frameworks collaborating.

🧠 AI & ML — Lesson 12 Lesson 13: Agent-to-Agent (A2A) Protocol — Agents talk to each other

Build AI Agents: From Zero to Production

Part 5: MCP, A2A & Multi-Agent Systems

xdev.asia

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

MCPA2A
ConnectAgent ↔ Tools/DataAgent ↔ Agent
ModelClient/ServerPeer-to-Peer
DiscoveryTool schemasAgent Cards
Use casesRead DB, call APIDelegate 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

  1. Create Agent Cards for 3 different agents
  2. Implement simple A2A server
  3. Demo 2 agents from 2 frameworks communicate
  4. Comparison: direct call vs via A2A protocol