Cheat sheets / Assistant metrics and SQL

Download PDFMarkdown

Assistant metrics and SQL

Define metrics precisely and query them consistently.

Data and BIProductQA

Definitions

MetricDefinition
ContainmentShare not escalated to a person
ResolutionGoal met, by confirmation or no repeat contact
Repeat contactSame user and topic within 7 days
Fallback rateShare of turns hitting not-understood or not-found
GroundednessShare of sampled answers supported by sources
Latencyp50 and p95, not averages
Cost per resolvedAll costs, including humans, divided by resolved conversations

Log at minimum

  • conversation_id, turn_id, hashed user id, timestamp
  • channel, language, market
  • route, confidence, topic
  • model, prompt and knowledge-base versions
  • retrieval ids and scores; tool calls and status
  • latency parts, tokens, costs
  • outcome, escalation reason, feedback, guardrail triggers

Cost per resolved (SQL)

SELECT route,
  SUM(model_cost + tool_cost + retrieval_cost + human_minutes * 0.75)
   / NULLIF(SUM(CASE WHEN resolved THEN 1 ELSE 0 END), 0) AS cost_per_resolved
FROM conversations
GROUP BY route;

Dashboard rules

  • Segment by language, channel, topic and complexity
  • Show distributions and sample sizes
  • Mark release dates
  • Every chart links to an owner and an action