Get Communication Stats
GET /api/agents/metrics/communication-stats
Get comprehensive communication statistics for the agent system.
Retrieves detailed statistics about inter-agent communications including message counts, active consultations, handoffs, and response times.
Returns:
total_messages: Total messages sent through systemactive_consultations: Currently active consultation requestscompleted_handoffs: Successfully completed handoffsfailed_communications: Failed communication attemptsaverage_response_time_ms: Average agent response timeagent_communication_matrix: Matrix of agent-to-agent communication counts
Raises:
- HTTPException 503: If communication hub unavailable
- HTTPException 500: For unexpected errors
Example Response:
{
"total_messages": 1542,
"active_consultations": 5,
"completed_handoffs": 23,
"failed_communications": 2,
"average_response_time_ms": 145.3,
"agent_communication_matrix": {
"HAWKEN": {"LAGAN": 23, "ORCHESTRATOR": 45},
"LAGAN": {"HAWKEN": 45}
}
}Responses
Section titled “ Responses ”Successful Response
Communication statistics response model.
Provides comprehensive statistics about inter-agent communications including message counts, active conversations, consultation metrics, and system health. Used for communication monitoring and analytics.
Fields:
total_messages: Total messages sent through system (non-negative integer)active_consultations: Currently active consultation requests (non-negative integer)completed_handoffs: Successfully completed handoffs (non-negative integer)failed_communications: Failed communication attempts (non-negative integer)average_response_time_ms: Average agent response time in milliseconds (non-negative float)agent_communication_matrix: Matrix of agent-to-agent communication counts
Usage: GET /api/agent-communication/communications/stats returns this response model.
JSON Example:
{
"totalMessages": 1542,
"activeConsultations": 5,
"completedHandoffs": 23,
"failedCommunications": 2,
"averageResponseTimeMs": 145.3,
"agentCommunicationMatrix": {
"HAWKEN": {"LAGAN": 45, "ORCHESTRATOR": 23},
"LAGAN": {"HAWKEN": 45}
}
}object
Total messages sent through system
Currently active consultation requests
Successfully completed handoffs
Failed communication attempts
Average agent response time in ms
Matrix of agent-to-agent communication counts