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
Responses
Section titled “ Responses ”Successful Response
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
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
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 nametotal_requests: Total number of requests processed lifetimesuccessful_requests: Number of successfully completed requestsfailed_requests: Number of failed requestsavg_response_time: Average response time in secondssuccess_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 specializationslast_used: ISO 8601 timestamp of last usagelast_activity: ISO 8601 timestamp of last activitymodel_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
ID of the agent being reported on
Agent name
Total number of requests processed
Number of successfully completed requests
Number of failed requests
Average response time in seconds
Success rate (0.0-1.0)
Performance score (0.0-1.0)
Current operational status (online, offline, busy, error)
List of agent capabilities and specializations
AI model being used
Agent specialization area
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
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
Overall system status