Skip to content

Get Enhanced Agents

GET
/api/agents/enhanced

Retrieve enhanced agent information with comprehensive performance metrics.

Returns detailed agent roster with performance analytics, model information, system status, and operational metrics. Combines agent discovery with real-time performance data for comprehensive system monitoring and optimization.

Args: request: FastAPI Request object containing app.state with backend service background_tasks: FastAPI BackgroundTasks for async analytics logging

Returns: EnhancedAgentResponse: Enhanced agent data containing: - agents: List of AgentInfo objects with name, status, model, metrics - performance_metrics: AgentPerformanceMetricsData with system-wide metrics - system_status: SystemStatusInfo with health indicators

Raises: HTTPException 500: For unexpected errors during data retrieval HTTPException 503: If backend service is unavailable

Successful Response

EnhancedAgentResponse

Enhanced agent information response model.

Provides comprehensive system-wide agent information including individual agent details, aggregated performance metrics, and overall system status. Used for system-wide agent monitoring and health dashboards.

Fields: agents: List of all agents with their basic information performance_metrics: Aggregated performance metrics across all agents system_status: Overall system health and status information

Used By: - GET /api/agents endpoint (enhanced mode) - System-wide agent monitoring dashboard - Performance analytics aggregation - Health check endpoints

object
agents
required
Agents
Array<object>
AgentInfo

Basic agent information model.

Provides essential information about a single divine agent including name, status, model configuration, and optional performance metrics. Simplified model used in enhanced agent response lists.

Fields: name: Agent name status: Current operational status model: AI model being used metrics: Optional detailed performance metrics

Used By: - EnhancedAgentResponse for agent lists - Agent status dashboards - Quick agent overview displays

object
name
required
Name
string
status
required
Status
string
model
required
Model
string
metrics
Any of:
AgentMetricsResponse

Agent performance metrics response model.

Provides comprehensive performance metrics for a single agent including request statistics, success rates, response times, and operational status. Used for agent performance monitoring and analytics endpoints.

Fields:

  • agent_id: Unique agent identifier (e.g., “HAWKEN”, “LAGAN”)
  • agent_name: Human-readable agent name
  • total_requests: Total number of requests processed lifetime
  • successful_requests: Number of successfully completed requests
  • failed_requests: Number of failed requests
  • avg_response_time: Average response time in seconds
  • success_rate: Success rate as decimal (0.0-1.0, e.g., 0.98 = 98%)
  • performance_score: Overall performance score (0.0-1.0, higher is better)
  • status: Current operational status (online, offline, busy, error)
  • capabilities: List of agent capabilities and specializations
  • last_used: ISO 8601 timestamp of last usage
  • last_activity: ISO 8601 timestamp of last activity
  • model_used: AI model being used (e.g., “gpt-4”, “llama3”)
  • specialization: Agent specialization area

Usage: GET /api/agent-communication/agents/{agent_id}/metrics returns this response model.

JSON Example:

{
  "agentId": "hawken",
  "agentName": "HAWKEN",
  "totalRequests": 1542,
  "successfulRequests": 1510,
  "failedRequests": 32,
  "avgResponseTime": 1.2,
  "successRate": 0.98,
  "performanceScore": 0.95,
  "status": "online",
  "capabilities": ["creative_writing", "storytelling"],
  "lastUsed": "2025-01-31T10:30:00Z",
  "lastActivity": "2025-01-31T10:30:00Z",
  "modelUsed": "llama3",
  "specialization": "creative_writing"
}
object
agentId
Agentid

ID of the agent being reported on

string
""
agentName
Agentname

Agent name

string
""
totalRequests
Totalrequests

Total number of requests processed

integer
0
successfulRequests
Successfulrequests

Number of successfully completed requests

integer
0
failedRequests
Failedrequests

Number of failed requests

integer
0
avgResponseTime
Avgresponsetime

Average response time in seconds

number
0
successRate
Successrate

Success rate (0.0-1.0)

number
0 <= 1
performanceScore
Performancescore

Performance score (0.0-1.0)

number
0 <= 1
status
Status

Current operational status (online, offline, busy, error)

string
default: offline
capabilities
Capabilities

List of agent capabilities and specializations

Array<string>
lastUsed
Any of:
string
lastActivity
Any of:
string
modelUsed
Modelused

AI model being used

string
""
specialization
Specialization

Agent specialization area

string
""
performanceMetrics
required
AgentPerformanceMetricsData

Comprehensive agent performance metrics data.

Tracks individual agent performance including request counts, response times, success rates, and resource utilization for monitoring and optimization.

Fields: total_requests: Total requests handled by agent successful_requests: Number of successful requests failed_requests: Number of failed requests avg_response_time_ms: Average response time in milliseconds success_rate: Success rate as percentage (0.0-100.0) last_active: ISO timestamp of last activity current_load: Current workload level (0.0-1.0)

Used By: - AllAgentMetricsResponse.metrics - EnhancedAgentResponse.performance_metrics - Agent dashboards and monitoring

object
totalRequests
Any of:
integer
successfulRequests
Any of:
integer
failedRequests
Any of:
integer
avgResponseTimeMs
Any of:
number
successRate
Any of:
number
<= 100
lastActive
Any of:
string
currentLoad
Any of:
number
<= 1
errorRate
Any of:
number
<= 100
uptimeSeconds
Any of:
number
memoryUsageMb
Any of:
number
cpuUsagePercent
Any of:
number
<= 100
systemStatus
required
SystemStatusInfo

Overall system status information.

Provides high-level system health and operational status for dashboard display and system monitoring.

Fields: status: Overall system status (healthy, degraded, unhealthy) active_agents: Number of active agents total_agents: Total registered agents healthy_agents: Number of healthy agents degraded_agents: Number of degraded agents failed_agents: Number of failed agents overall_health_score: System-wide health score (0-100) last_updated: ISO timestamp of last status update

Used By: - EnhancedAgentResponse.system_status - System dashboards - Health monitoring

object
status
required
Status

Overall system status

string
activeAgents
Any of:
integer
totalAgents
Any of:
integer
healthyAgents
Any of:
integer
degradedAgents
Any of:
integer
failedAgents
Any of:
integer
overallHealthScore
Any of:
number
<= 100
lastUpdated
Any of:
string