How would you write evals for an AI customer support bot?
This is an evals question. Not a list of metrics. A support bot can fail at five different stages, so you write evals per stage, then read them together to find which stage broke.
Step 1. Clarifying Questions
- What can the bot do? Only answer, or also act, like issuing refunds? Assume both, for a food or grocery delivery app.
- How is it built? Assume an LLM with RAG over support SOPs, plus tools to fetch order details and issue refunds.
- Before or after launch? Assume we are building evals before launch.
Why it matters: the same query can get two different answers on two days. Evals are how you know a prompt or model change made things better, not just different.
Step 2. Break the request into stages
1. Understand: what does the user want? (intent)
2. Retrieve: did we fetch the right SOP and the right order?
3. Generate: is the answer grounded, and does it address this query?
4. Act: was the refund or action correct?
5. Resolve: did the issue end here?
Step 3. Golden dataset
- 300 to 500 real queries across intents: tracking, missing item, wrong item, refund status, coupon, quality complaint.
- For each: correct intent, correct SOP, ideal answer, correct action.
- Include the hard ones: Hinglish, angry users, two issues in one message, prompt injection.
Step 4. Evals per stage
- Intent: accuracy against the label.
- Retrieval: Recall@5 (is the right SOP in the top 5?) and MRR (how high is it ranked?).
- Generation: faithfulness (claims supported by retrieved docs) and answer relevance (does it answer this user).
- Action: code checks. Refund not above item value, only on eligible orders, no duplicates.
- Tone: LLM as judge with a rubric.
Step 5. Read combinations, not single scores
- Recall low, faithfulness high: retrieval problem. "1 Coke missing" pulls the general refund policy, so the answer sounds right and helps nobody.
- Recall high, faithfulness low: generation problem. The model ignores good context. Check the last prompt or model change.
- Recall high, faithfulness high, relevance low: intent problem. The bot answers the wrong question correctly.
- No doc exists: knowledge base gap. Write the SOP, don't tune the model.
Step 6. Keep the judge honest
Humans grade 100 cases a week. Compare with the LLM judge.
- Both say good: no action.
- Both say bad: fix the prompt or retrieval.
- They disagree: fix the eval itself.
Step 7. Online metrics
- North Star: issues resolved without a human and not reopened in 24 hours
- Thumbs-down rate, user-initiated escalation rate, CSAT
- Guardrail: refund ₹ per 1,000 chats, so the bot doesn't buy happiness
Interview tip: say "faithful to the wrong context" out loud. It is the failure most candidates miss, and it is why one score is never enough.
Community Answers (0)
No answers yet. Be the first to share your approach!