AI-agent skill · Claude Code · Codex · Cursor · Gemini CLI
RAG Eval Kit lets your AI coding agent test a chatbot or RAG system that answers from your documents. It writes a test set from your own documents (including questions the documents cannot answer), scores retrieval, and checks every sentence of every answer against the sources the system retrieved. Every "supported" or "contradicted" verdict must carry a word-for-word quote, and a script checks that the quote, every number, every name and every calculation is really there. You get a report with confidence intervals, the exact wrong answers with proof, and a paired comparison between two versions.
RAGTruth (MIT licence) is a public dataset of chatbot answers in which humans marked every made-up or wrong statement. I froze version 1.0.0, took 120 answers from its test split (40 that humans marked as containing made-up details and 80 they marked clean), and gave them to 3 fresh AI agents that saw only the skill and the chatbot log. Scored once against the human labels, no changes afterwards. (Versions 1.0.1 and 1.0.2 later fixed checker bugs found in this test and in the chatbot test below, such as "Aug" vs "August"; all 120 verdicts pass them unchanged, so these numbers still hold.)
| Part (40 answers each) | Made-up answers caught | Clean answers flagged |
|---|---|---|
| A | 11 / 13 | 9 / 27 |
| B | 9 / 11 | 13 / 29 |
| C | 14 / 16 | 4 / 24 |
The skill is stricter than the human labellers: it flags any detail that is not in the retrieved passages, even when it may be true
in real life. Some flagged "clean" answers do contain real errors that the labels missed. In one, the passage says "T-Bone steaks and
Porterhouse steaks are the same", while the answer says sirloin and porterhouse may be the same thing. They still count as false alarms here.
At RAGTruth's natural rate of 18% made-up answers, about 36% of flagged answers
would match a human label. Every verdict, quote and label is published in results/ragtruth_blind/.
Free first pass: quickcheck (no AI, instant) flags answers containing numbers or names that appear in none of their sources.
On all 900 RAGTruth QA test answers it flagged 89, of which 46 had human-labelled made-up details
(false alarms on 5.8% of clean answers). It misses most made-up details (46 of 160 caught): it is a quick
screen, the AI judge does the real work.
A small "chat with the docs" app over the real httpx documentation (21 files, TF-IDF retrieval). Old version: 2 small chunks and a "be helpful" prompt. New version: 5 bigger chunks and an "only from the context, otherwise say you don't know" prompt. A fresh agent wrote the 40-question test set with the skill; two fresh agents judged the versions. I wrote down the expected results before running.
| Measure | Old | New |
|---|---|---|
| Correct vs reference answer | 86.8% | 86.8% |
| Answers with made-up or wrong details | 95.0% | 12.8% |
| Faithfulness (claims backed by the sources) | 33.6% | 90.2% |
| Correct refusals on 6 unanswerable questions | 1 / 6 | 6 / 6 |
| Retrieval: evidence in the top 5 | 61.8% | 85.3% |
The lesson: both versions were 86.8% correct, so a correctness check alone would call them equal. But the old version's answers
were mostly not backed by its sources: it answered from the model's memory and changed or invented details. The paired comparison calls the drop in
made-up answers a real change (−82.1 points, 95% interval −92.3 to −69.2). Before judging, 6 errors were planted in the old answers
(a number, a yes/no flip, a behaviour flip, a version, a parameter name, an invented function), hidden from the judge: all 6 were caught.
See examples/httpx-chatbot/ for the full reports.
Teams whose chatbot or RAG feature gives wrong answers and who need proof, a regression test, or a fair A/B between prompts, chunking, retrievers or models.
Your own coding agent is the judge; one Python script (standard library, Python 3.10+) does the checking. Nothing is sent anywhere.
Each verdict comes with the quote that proves it, checked mechanically, so you can see exactly why an answer was flagged.
It is strict: true but unsourced details count as unsupported. The judge is an AI; spot-check 10 verdicts before big decisions. Small test sets give wide intervals.
Made by Muhammad Shahmeer · Data Science MSc, University of Naples Federico II · © 2026, all rights reserved. RAGTruth is © its authors (MIT licence). httpx documentation © Encode OSS Ltd (BSD licence). Not affiliated with either.