Overview
The Agent-to-Agent Protocol (A2A) is Routa’s external federation interface. It exposes internal Routa agents as A2A-compatible tasks, enabling cross-platform agent communication and discovery. Key Purpose: Allow external AI systems to discover, communicate with, and coordinate with Routa agents using a standardized protocol. Built on: @a2a-js/sdkWhen to Use A2A
Use A2A when you need to:- Expose Routa agents to external AI platforms
- Enable cross-platform coordination between different AI systems
- Implement agent discovery for external clients
- Provide a standardized interface for agent communication
- Integrate with A2A-compatible tools and platforms
Architecture
A2A implementation bridges Routa’s internal agent model to the A2A protocol:Key Concepts
A2A Task Model
Routa agents are exposed as A2A “tasks” with the following structure:State Mapping
Routa agent statuses are mapped to A2A task states:Role to Skill Mapping
Routa agent roles are exposed as A2A skill identifiers:A2A Messages
Messages in A2A tasks represent communication between users and agents:A2A Artifacts
Artifacts represent outputs produced by agents:JSON-RPC Interface
A2A communication happens via JSON-RPC over HTTP:Create Task
Method:task/create
Request:
Get Task Status
Method:task/get
Request:
List Tasks
Method:task/list
Request:
Cancel Task
Method:task/cancel
Request:
Example Usage
Creating an A2A Task
Registering an Existing Agent as A2A Task
Updating Task from Agent Status
HTTP Endpoint Integration
Session Registry
A2A sessions are tracked separately from ACP sessions:Best Practices
Always Link Tasks to Agents
Always Link Tasks to Agents
A2A tasks should always be linked to backing Routa agents for state synchronization:
Use Artifacts for Rich Outputs
Use Artifacts for Rich Outputs
When agents complete work, create artifacts with structured data:
Handle Terminal States Properly
Handle Terminal States Properly
Terminal states (
completed, failed, canceled) cannot be changed:Implement Task Discovery
Implement Task Discovery
Expose a discovery endpoint for external clients to find available skills:
Related Protocols
- MCP (Model Context Protocol) — Internal coordination tools
- ACP (Agent Client Protocol) — Agent process management
API Reference
Task Bridge
Map Routa agents to A2A tasks
Session Registry
Manage A2A session lifecycle
Executor
Execute A2A protocol operations
JSON-RPC API
JSON-RPC method reference