Skip to main content

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:
  1. Maintains a directory of available agents
  2. Provides discovery mechanisms for finding agents
  3. Monitors agent health through heartbeats
  4. 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

curl -X POST "http://localhost:8081/agents" \
     -H "Content-Type: application/json" \
     -d '{
           "name": "MyAgent",
           "url": "http://my-agent:8080",
           "description": "My custom agent",
           "capabilities": {
             "text": true,
             "streaming": false,
             "functions": ["my_function"]
           }
         }'

Send Heartbeat

curl -X PUT “http://localhost:8081/agents/MyAgent/heartbeat

Agent Lifecycle

  1. Registration: Agents register themselves with the registry on startup
  2. Heartbeat: Agents send periodic heartbeats to indicate they’re still active
  3. Discovery: The API service discovers agents through the registry
  4. 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 the BaseA2AAgent 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.