How to Evaluate an AI Chatbot: Accuracy, Grounding, Safety, and Cost Metrics
A production-ready AI chatbot needs more than fluent answers. This framework shows how to build a repeatable test set, score answer quality and grounding, check safety and escalation behavior, measure response time, and estimate cost per resolved interaction before and after launch.
Overview
Evaluating an AI chatbot is a quality-assurance process, not a one-time demonstration. A convincing conversation can hide weak document retrieval, unsupported claims, poor handling of ambiguous questions, or an expensive path to resolution. The goal is to measure whether the chatbot performs reliably for the tasks it is intended to handle.
Use four evaluation dimensions:
- Answer quality: Is the response correct, relevant, complete, and easy to act on?
- Grounding: Does the answer rely on approved knowledge, retrieved documents, or clearly identified system data rather than invention?
- Safety and control: Does the chatbot refuse unsuitable requests, protect sensitive information, resist prompt injection, and escalate when necessary?
- Operational performance: Does it meet acceptable response-time, resolution, availability, and cost targets?
These dimensions should be tested together. A highly accurate answer that takes too long, exposes restricted information, or fails to hand off a sensitive case is not production-ready. For a document chatbot or RAG chatbot, review the retrieval layer separately from the final response. The AI knowledge base audit checklist can help identify missing, outdated, or conflicting source content before model testing begins.
How to estimate
Start with a representative evaluation set rather than a collection of unusually simple questions. Include real or carefully anonymized user requests from the chatbot's main use cases. Label each test case with its intended answer, approved source, risk level, and expected action.
A practical test-set template contains these fields:
- Question: The exact user prompt, including spelling variations where relevant.
- Category: For example, account help, product information, internal policy, troubleshooting, lead qualification, or unsupported request.
- Expected behavior: Answer, ask a clarifying question, refuse, or escalate.
- Reference answer: The minimum facts a correct response must contain.
- Approved source: The document, URL, database field, or policy that supports the answer.
- Risk level: Low, medium, or high according to the potential impact of an error.
Score each response using a consistent rubric. A simple four-level scale works well:
- 3 — Pass: Correct, relevant, grounded, and complete enough for the user to proceed.
- 2 — Minor issue: Mostly useful, but missing a noncritical detail, using awkward wording, or requiring a small clarification.
- 1 — Major issue: Partly wrong, poorly grounded, incomplete in a consequential way, or unable to complete the intended task.
- 0 — Fail: Fabricated, materially incorrect, unsafe, privacy-sensitive, or incorrectly handled when escalation was required.
Calculate a weighted quality score rather than relying only on an average. For example:
Weighted score = sum of (case score × case weight) ÷ sum of case weights
Give high-risk cases greater weight, or define separate pass requirements for them. A chatbot may be acceptable for low-risk FAQ questions while remaining unsuitable for billing, security, compliance, or account-access workflows.
Track additional metrics beside the score:
- Grounded-answer rate: The share of answers supported by an approved source.
- Unsupported-claim rate: The share of answers containing claims that cannot be verified from available context.
- Retrieval hit rate: How often the necessary source appears in retrieved context.
- Correct escalation rate: How often the chatbot hands off cases that require a person.
- False escalation rate: How often it transfers cases that it could have handled correctly.
- Latency: Time to first token and time to complete response, measured separately.
- Cost per interaction and resolution: Usage cost divided by conversations and successfully resolved conversations.
For implementation details such as logs, webhooks, streaming, and monitoring, see the AI chatbot API integration guide. Keep evaluation inputs and outputs versioned so a model, prompt, retrieval, or knowledge-base change can be compared with the previous release.
Inputs and assumptions
Your results are only as useful as the assumptions behind them. Record the following inputs in the evaluation worksheet:
- Conversation volume: Expected conversations per day or month.
- Average turns: The typical number of user and assistant messages in one conversation.
- Resolution definition: For example, the user receives a verified answer without human intervention, or the request reaches the correct support queue.
- Human-handling cost: Use your internal fully loaded estimate or a clearly labeled planning assumption.
- Escalation rate: The percentage of conversations transferred to a human.
- Model and retrieval usage: Input and output tokens, embedding activity, search operations, storage, and any external API calls.
- Quality target: The minimum acceptable score for each risk category, not just one overall average.
Cost calculations should use your actual provider pricing and infrastructure configuration at the time of review. Avoid presenting a generic price as a forecast. A basic planning formula is:
Monthly chatbot cost = model usage + retrieval and storage + platform charges + monitoring + human escalation cost
Then calculate:
Cost per resolution = total monthly chatbot cost ÷ resolved conversations
For a business case, compare that figure with the cost of handling the same volume without automation. Include unsuccessful conversations, repeat contacts, and escalations; otherwise, the estimate may reward a chatbot for deflecting users without actually solving their problem.
Safety testing deserves its own test group. Add requests for confidential information, instructions that conflict with system rules, attempts to override the assistant, ambiguous high-impact questions, and requests outside the chatbot's scope. The prompt injection testing checklist provides a useful starting point. Also define the exact fallback language and handoff behavior in advance using an escalation workflow.
Worked examples
Suppose a support team creates 40 test cases: 24 common questions, 8 edge cases, and 8 high-risk cases. It scores common questions with a weight of 1, edge cases with a weight of 2, and high-risk cases with a weight of 3. The team should report the weighted result alongside separate results for each category. A strong overall score should not conceal repeated failures in the high-risk group.
Next, the team reviews grounding. In 30 cases, the required source was retrieved. In 27 of those cases, the final answer correctly used the source. The retrieval hit rate is 30 ÷ 40, or 75%, while the grounded-answer rate based on the full test set is 27 ÷ 40, or 67.5%. Those figures point to two different problems: retrieval may be missing relevant documents, and some retrieved context may still be ignored or misinterpreted.
For cost, assume a planning period produces 10,000 conversations. If 6,000 are resolved by the chatbot, the cost per resolution is the total cost of serving those conversations divided by 6,000. Test alternative assumptions for conversation length, escalation rate, and model usage. A low-volume estimate can look attractive until long conversations or repeated retries increase usage.
Finally, inspect failures manually. Record whether each failure came from the knowledge base, retrieval settings, prompt instructions, tool integration, model behavior, or an incorrect business rule. This diagnosis is more actionable than simply labeling the response a hallucination. The hallucination troubleshooting workflow can support that review.
When to recalculate
Re-run the evaluation before launch, after changing the model or system prompt, after modifying retrieval settings, and whenever documents, policies, product data, or connected tools change. A knowledge-base update can improve one answer while introducing contradictions elsewhere.
Run a smaller regression suite for every release and a broader review on a regular schedule. Include newly observed user questions and every serious production failure. Review cost assumptions when provider pricing, token usage, traffic, or infrastructure changes. Review quality thresholds when the chatbot expands into a higher-risk workflow.
Keep a dated evaluation record containing the test-set version, chatbot configuration, scores, cost assumptions, known failures, and release decision. The AI chatbot regression testing checklist can help turn this into a repeatable release gate. Recalculate after major platform releases and review the rubric at least quarterly, or sooner when business risk or usage changes. The aim is not to find one permanent score; it is to maintain evidence that the chatbot remains accurate, grounded, safe, responsive, and economically sensible.