In the second installment of the RAGAS series, we dive deep into a real-world hallucination from a children's education robot to demonstrate how four evaluation metrics work together to pinpoint exactly what went wrong.
The Kansas City Case
The robot was asked a knowledge-base question about Kansas City. Instead of retrieving the correct answer, it used news headlines to fabricate a response—never actually providing the numeric value requested. This single example became the test subject for all four RAGAS metrics.
Breaking Down the Metrics
-
Answer Relevancy (0.80): By reverse-generating questions from the answer and measuring cosine similarity against the original query, this metric showed that the response was topically on-point—but relevance alone doesn't catch falsehoods.
-
Context Recall (0.00): This metric decomposes the ground truth and checks each part against the retrieved context. A score of zero means the robot's retrieved context didn't contain any of the necessary facts.
-
Context Precision (0.00): By voting on per-chunk usefulness and applying rank weighting, this metric penalizes junk documents ranked above gold ones. In this case, irrelevant chunks were placed higher than the single correct one.
-
Faithfulness (0.17): The flipped engine checks whether each claim in the answer is supported by the context. The low score reveals that most claims were invented.
The Four-Dial Diagnosis
Combined, the metrics tell a clear story: relevancy 0.80 + faithfulness 0.17 + recall 0.00 + precision 0.00 = the robot produced a confident on-topic fabrication due to a routing failure. The system retrieved the wrong documents, and then confidently generated an answer from them.
The Surprise Discovery
When the same robot was asked a question it couldn't answer, it honestly replied "I don't know." Surprisingly, the hallucinated response scored higher on relevancy than the honest one. This proves that no single metric can be trusted alone—you need the full dashboard.
The Robot's Full Report Card
Across 60 questions, the robot scored:
- Faithfulness: 0.26
- Recall: 0.13
The worst-10 hallucinations are ranked, showing that low scores often stem from the same root cause: the router sent the query to the wrong knowledge base.
Production Architecture
The video outlines a two-tier monitoring system:
- Tier 1: Live traffic monitoring without ground truth, using proxy metrics like answer relevancy.
- Tier 2: Nightly evaluation on a golden dataset with human-curated ground truths, using all four RAGAS metrics.
Stack Used
- DistilBERT router
- ChromaDB vector store
- MCP (Model Context Protocol)
- Fine-tuned 1B Llama (GRPO) on Raspberry Pi 5
- Judge: Claude
- RAGAS 0.3.9
Key Takeaway
A score of 0.26 isn't a failure—it's a diagnosis. By reading the four-dial dashboard, engineers can trace the exact subsystem that broke and fix it, rather than blindly tweaking the model.