Skip to content

Get agent performance metrics

GET
/api/agent-communication/agents/{agent_id}/metrics

Retrieve performance metrics for a single registered agent.

Maps the hub’s :class:AgentMetrics (request counts, response times, percentage success rate) onto :class:AgentMetricsResponse (decimal success rate 0.0-1.0 and a derived performance score). When the agent has no recorded metrics yet, returns a zeroed response with success_rate reflecting current availability.

Path Parameters:

  • agent_id: Unique identifier of the target agent

Returns:

  • Schema-conformant :class:AgentMetricsResponse (see schema for field semantics)

Raises:

  • HTTPException 404: If agent_id is not registered with the hub
  • HTTPException 503: If the communication hub is unavailable
agent_id
required
Agent Id
string

Successful Response

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
""

Validation Error

HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object