Registry Service
The Registry Service is a central component of AutonomousSphere that manages the registration and discovery of A2A-compatible agents.Purpose
The Registry Service:- Maintains a directory of available agents
- Provides discovery mechanisms for finding agents
- Monitors agent health through heartbeats
- Marks inactive agents when they become unavailable
API Endpoints
List All Agents
curl -X GET “http://localhost:8081/agents”Get Agent Details
curl -X GET “http://localhost:8081/agents/ExampleAgent”Register an Agent
Send Heartbeat
curl -X PUT “http://localhost:8081/agents/MyAgent/heartbeat”Agent Lifecycle
- Registration: Agents register themselves with the registry on startup
- Heartbeat: Agents send periodic heartbeats to indicate they’re still active
- Discovery: The API service discovers agents through the registry
- Inactivation: The registry marks agents as inactive if they stop sending heartbeats
Implementing Registry Client
If you’re creating a custom agent, you can use theBaseA2AAgent class to handle registration and heartbeats automatically:
from base_agent.base_agent import BaseA2AAgent, AgentCapabilities
agent = BaseA2AAgent(
name=“MyAgent”,
description=“My custom agent”,
url=“http://my-agent:8080”,
registry_url=“http://registry:8081”,
capabilities=AgentCapabilities(
text=True,
streaming=False,
functions=[“my_function”]
)
)
This will handle registration and heartbeats in a background thread.