Skip to content

Discovery API

Endpoints for agent registration and capability discovery.

POST /api/v1/discovery/capabilities

Request:

{
"agent_id": "document-processor",
"capability": "document.ocr",
"metadata": {
"supported_formats": ["pdf", "png", "jpg"],
"max_file_size_mb": 50,
"version": "1.0.0"
},
"groups": ["production", "us-east"]
}

Response:

{
"data": {
"id": "cap_xxx",
"agent_id": "document-processor",
"capability": "document.ocr",
"metadata": {...},
"groups": ["production", "us-east"],
"created_at": "2026-01-01T00:00:00Z"
}
}
GET /api/v1/discovery/capabilities?agent_id={agent_id}
GET /api/v1/discovery/capabilities/{capability_id}
DELETE /api/v1/discovery/capabilities/{capability_id}

Remove all capabilities for an agent:

DELETE /api/v1/discovery/agents/{agent_id}
GET /api/v1/discovery/agents?capability={capability}&strategy={strategy}

Query parameters:

  • capability - Capability name to search for
  • strategy - Routing strategy (round_robin, least_loaded, random, etc.)
  • group - Filter by group
  • limit - Max results

Response:

{
"data": {
"agents": [
{
"agent_id": "document-processor-1",
"capability": "document.ocr",
"metadata": {...},
"load": 0.3,
"health": "healthy",
"last_heartbeat": "2026-01-01T12:00:00Z"
}
]
}
}
POST /api/v1/discovery/search

Request:

{
"query": "I need to extract text from PDF documents",
"top_k": 5,
"min_score": 0.6
}

Response:

{
"data": {
"results": [
{
"capability": {
"id": "cap_xxx",
"name": "document.ocr",
"agent_id": "document-processor",
"metadata": {...}
},
"similarity_score": 0.85
}
]
}
}
POST /api/v1/discovery/heartbeat

Request:

{
"agent_id": "document-processor",
"load": 0.3,
"metadata": {
"active_tasks": 5,
"memory_mb": 512
}
}
GET /api/v1/discovery/agents/{agent_id}/health

Response:

{
"data": {
"agent_id": "document-processor",
"status": "healthy",
"load": 0.3,
"last_heartbeat": "2026-01-01T12:00:00Z",
"uptime_seconds": 86400
}
}
GET /api/v1/discovery/groups
GET /api/v1/discovery/groups/{group_name}/agents
StrategyDescription
round_robinCycle through agents
least_loadedPick lowest load agent
randomRandom selection
first_availableFirst healthy agent
weightedWeight-based selection
latencyLowest latency agent
trustHighest trust score