A2A Agent System — Core Components
Overview
The A2A (Agent-to-Agent) protocol allows different agents to discover, communicate with, and collaborate with each other, creating a decentralized network of intelligent agents.
Core Components
| Component | Description | |-----------|-------------| | AgentRegistry | Registry controller responsible for registration, deregistration, discovery, queries, heartbeats, and cleanup | | AgentCard | Agent metadata including identity, capabilities, skills, and security | | MulticastDiscovery | UDP multicast-based local network discovery implementation | | RegistryStore | SQLite-based persistent registry storage | | A2AServer | HTTP/JSON service implementing the A2A protocol | | A2AClient | HTTP client for communicating with other agents | | TaskStore | Persistent storage for tasks, messages, and artifacts |
Architecture Design
The system adopts a layered "controller + storage + discovery service" architecture:
- Controller layer: AgentRegistry aggregates storage and discovery
- Storage layer: SQLite persistence
- Discovery layer: UDP multicast automatic discovery
- Service layer: HTTP endpoints and cross-agent communication
A2A vs MCP
| Protocol | Positioning | Use Case | |----------|-------------|----------| | MCP | Agent ↔ Tools/Resources | Connecting AI to external tools and data sources | | A2A | Agent ↔ Agent | Dynamic collaboration and communication between agents |
--- *Source: Stratagem.php A2A implementation*