Agent Teams

Team Health

Team health monitoring provides real-time and historical metrics on agent team performance — latency percentiles, error rates, token efficiency, and task throughput.

Health metrics

bash
# Get team health metrics (default window: day)
curl "http://localhost:3000/team-health?window=day" \
  -H "Authorization: Bearer ${JWT_TOKEN}"

# Response
{
  "agentCount": 5,
  "latency": { "p50": 320, "p95": 1200, "p99": 2800 },
  "errorRate": 0.03,
  "tokenEfficiency": 4200,
  "goalCompletionRate": 0.82,
  "activeAgents": 4,
  "taskThroughput": 47
}

# Health history (last 100 snapshots)
curl http://localhost:3000/team-health/history \
  -H "Authorization: Bearer ${JWT_TOKEN}"

# Trend analysis
curl http://localhost:3000/team-health/trends \
  -H "Authorization: Bearer ${JWT_TOKEN}"
MetricDescription
latency.p50/p95/p99Latency percentiles in milliseconds
errorRateFraction of requests that resulted in errors (0–1)
tokenEfficiencyAverage tokens per execution
goalCompletionRateFraction of goals completed successfully (0–1)
activeAgentsNumber of agents with recent activity
taskThroughputTotal tasks completed in the window

Time windows

WindowDuration
hourLast 60 minutes
day (default)Last 24 hours
weekLast 7 days

Endpoint reference

MethodEndpointDescription
GET/team-healthCurrent health metrics
GET/team-health/historyLast 100 health snapshots
GET/team-health/trendsLatency, error, and throughput trends