Evaluation measures whether an AI system behaves well against defined criteria. A chatbot can pass initial tests yet give subtly wrong answers after deployment, or work for most users while underperforming for particular groups. Define what success means before building, then keep measuring as models, data, and usage change. section 1.4.3 section 11.6.6
Use complementary methods rather than relying on one score:
- Compare outputs with known answers using reference-based metrics such as ROUGE and BLEU. section 1.4.3
- Use an LLM as a judge for quality, relevance, and faithfulness; add human review where automated measures are insufficient. section 1.4.3
- Red-team the system to expose failures before users encounter them. Include common and edge cases in test sets, with diverse examples to help reveal disparities. section 1.4.3 section 11.6.6
- Run automated evaluation in CI/CD and track results over time to detect regressions. In production, monitor semantic quality, hallucination rates, and user satisfaction—not only uptime and latency. section 11.6.6 section 1.4.3
For retrieval-augmented generation (RAG), assess retrieval and generation together: their interplay makes response accuracy and hallucinations harder to evaluate with a single measure. Test queries are useful for inspecting responses, but inspecting one answer is not a substitute for a test set and tracked metrics. section 3.6 section 11.6.6 section 3.8.10
question = "What are the best wireless headphones under $100?"
result = qa.invoke({"query": question})
print(result["result"])
A sample product question sent through `qa.invoke` prints the chatbot’s answer for inspection; the snippet does not score it against a reference or quality criterion. section 3.8.10














