hexr.a2a provides typed, authenticated communication between agents running on Hexr. Each agent-to-agent connection uses mutual TLS via SPIFFE identities on both sides — your agent proves who it is, and the remote agent does the same. The A2AClient handles task lifecycle (submission, polling, cancellation) and returns structured results with typed artifacts. On the receiving side, enabling a2a=True on @hexr_agent starts a bridge that routes incoming messages to your function automatically.
Quick start
Sending a message
Receiving messages (A2A bridge)
When you seta2a=True on @hexr_agent, the bridge is started automatically. Your function is called when another agent sends a message:
A2AClient
Methods
Fetch the remote agent’s Agent Card. Cached for Returns:
card_cache_ttl seconds.AgentCardSend a message to the remote agent. Blocks until the task reaches a terminal state (Returns:
completed, failed, or canceled).TaskPoll a task’s current state without blocking.
Request cooperative cancellation. The remote agent should check for cancellation and stop gracefully.
Data models
Message
Messages carry one or more parts, each with a different content type:Task states
Tasks follow a linear lifecycle.INPUT_REQUIRED is a special state where the remote agent needs more information:
AgentCard
Patterns
Fan-out / fan-in (orchestrator)
Call multiple specialized agents in parallel and synthesize their results:Pipeline (sequential)
Pass results from one agent to the next in a chain:Discovery
Agents are discovered via Kubernetes DNS and Agent Cards. The URL format follows a consistent convention:Task guarantees
Hexr A2A provides the following reliability guarantees for task lifecycle:- Idempotent submission — duplicate task submissions are safe; the same task ID is returned
- Automatic cleanup — completed tasks expire after 24 hours by default
- Cooperative cancellation — long-running agents should check for cancellation and stop gracefully