Skip to content

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 system
  • active_consultations: Currently active consultation requests
  • completed_handoffs: Successfully completed handoffs
  • failed_communications: Failed communication attempts
  • average_response_time_ms: Average agent response time
  • agent_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}
    }
}

Successful Response

CommunicationStatsResponse

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
totalMessages
required
Totalmessages

Total messages sent through system

integer
activeConsultations
required
Activeconsultations

Currently active consultation requests

integer
completedHandoffs
required
Completedhandoffs

Successfully completed handoffs

integer
failedCommunications
required
Failedcommunications

Failed communication attempts

integer
averageResponseTimeMs
required
Averageresponsetimems

Average agent response time in ms

number
agentCommunicationMatrix
required
Agentcommunicationmatrix

Matrix of agent-to-agent communication counts

object
key
additional properties
object
key
additional properties
integer