# We have a RAG chatbot that answers customer questions from our help docs. Every so often it says something the docs don't say. How do we put a real number on how often that happens, which tools can score it, and how much can we trust the number?

**Short answer:** Measure it against the documents the bot retrieved, on a fixed set of real questions. A hallucination in RAG means an answer that the retrieved text doesn't support, even if it happens to be true. Vectara's HHEM model card gives the example of a source saying the capital of France is Berlin and an answer saying Paris: the answer is true in the world but not supported by the source. Two common scorers are the Ragas Faithfulness metric (an LLM splits the answer into claims and counts how many the retrieved context supports, so 1 of 2 supported scores 0.5) and Vectara's open HHEM-2.1-Open classifier, which scores each pair of context and answer from 0 to 1. Neither catches everything: on the RAGTruth question-answering benchmark, HHEM-2.1-Open's published recall is 54.38% and GPT-4 zero-shot's is 56.88%, so either one misses a large share of labelled hallucinations. Report your rate with the sample size and a confidence interval, check a human-labelled sample to see what the scorer misses, and record which scorer version and test set produced each number.

## Checklist
1. Build a fixed test set from real user questions (a few hundred is a practical start), and save the documents retrieved for each one along with the answer.
2. Score each answer only against its retrieved context, not against general knowledge. An answer the context doesn't support counts, even if it's true.
3. Use a scorer such as Ragas Faithfulness or HHEM-2.1-Open, and write down the cut-off you use to call an answer unsupported.
4. Have people label a sample (for example 100 to 200 answers) and compare with the scorer, so you know how many unsupported answers it misses.
5. Report the rate with its sample size and a 95% confidence interval: 12 unsupported answers out of 400 is 3.0%, with an interval of about 1.7% to 5.2%.
6. Track the answer rate too. A bot that refuses more often can look better on this measure without being more useful.
7. Separate retrieval misses (the right document wasn't retrieved) from generation errors (the document was there but the answer went beyond it), because they need different fixes.
8. Keep the test set, scorer version and settings fixed between runs, and record each run, so a change in the number reflects the bot, not the measurement.

## What counts as a hallucination in a RAG chatbot answer?
- Vectara's model card for HHEM-2.1-Open says you always need two pieces of text: the evidence (the retrieved context) and the text being judged (the answer). An answer is hallucinated if the evidence doesn't support it. Its example is a context saying the capital of France is Berlin and an answer saying Paris, which is true in the world but hallucinated in RAG terms, because the model used its training data instead of the retrieved text.
- The check is also one-directional. The model card's example: "I visited Iowa" isn't supported by "I visited the United States", but the reverse is. So a scorer has to check the answer against the context, not just measure how similar they are.
- This is why you can't measure hallucination for open questions with no reference text. Vectara's leaderboard notes that judging an ad hoc answer without a reference source would mean solving the hallucination problem itself, so it measures factual consistency against a given document instead.

## How do Ragas Faithfulness and Vectara's HHEM score RAG hallucinations?
- Ragas Faithfulness scores an answer from 0 to 1: the number of claims in the answer that the retrieved context supports, divided by the total number of claims. An LLM does both steps, splitting the answer into claims and checking each one. In the Ragas example, the answer "Einstein was born in Germany on 20th March 1879" against a context giving 14 March 1879 has two claims, one supported, and scores 0.5.
- HHEM-2.1-Open is Vectara's open-source classifier (Apache 2.0, built on Google's flan-t5-base). It takes pairs of premise and hypothesis and returns a score from 0 (not supported at all) to 1 (fully supported). The model card says it has no fixed context limit, unlike HHEM-1.0's 512 tokens, uses under 600 MB of RAM at 32-bit precision and takes about 1.5 seconds for a 2,000-token input on a modern x86 CPU. Ragas can use it for the checking step through its FaithfulnesswithHHEM metric, so you're not paying for an LLM judge on every claim.
- Vectara's public hallucination leaderboard uses its commercial HHEM-2.3 to score summaries that each LLM writes of more than 7,700 articles, at temperature 0. It reports a hallucination rate, a factual consistency rate and an answer rate for each model. As of the October 22, 2026 update, the lowest listed rate is 1.8% and many widely used models are between about 3% and 7%. That's a comparison of models on Vectara's documents and prompt; your app's rate depends on your documents, retrieval and prompt, so you still need to measure it yourself.

## How much can you trust an automated hallucination rate for a RAG app?
- Automated scorers miss a lot. The HHEM-2.1-Open model card reports results on RAGTruth, a labelled benchmark of RAG answers: on its question-answering part, balanced accuracy was 74.28%, precision 66.92% and recall 54.38%, about the same as GPT-4 zero-shot (74.11% balanced accuracy, 56.88% recall). So a scorer like this may miss close to half of the unsupported answers, and some answers it flags are fine. Treat its rate as an estimate and calibrate it with people.
- Have reviewers label a random sample of answers as supported or not, without seeing the scorer's result, and compare. If the scorer catches 60% of the answers people marked unsupported, a scored rate of 3% likely means more unsupported answers than that. Record the sample, the labels and who labelled them.
- Give every number its sample size and a confidence interval, and keep the measurement fixed. A rate from 50 questions can move a lot by chance. If you change the test set, the scorer, its version or its cut-off, start a new series instead of comparing with old numbers. Recording each run (test set hash, scorer version, settings, results file hash) lets you show later which number came from which setup.

## Ask Rightshold (free, no key)
Add the MCP server https://www.rightshold.com/mcp to Claude, Cursor, ChatGPT, Grok or VS Code (one-click setup: https://www.rightshold.com/start?ref=seo), then ask: "Record a signed receipt for this week's hallucination check on our help-desk RAG bot: the bot's model version, a hash of the frozen test set and of the per-answer results file, and in params the scorer and its version, the cut-off, the number of questions, the unsupported rate with its 95% interval, the answer rate and the size of the human-labelled sample."

```json
{
  "tool": "record_ai_run",
  "arguments": {
    "model": "<chat model id and dated version used by the bot>",
    "provider": "<model provider>",
    "prompt_sha256": "<sha256 of the frozen test set: questions plus retrieved contexts>",
    "output_sha256": "<sha256 of the per-answer results file>",
    "params": {
      "app": "help-desk RAG bot",
      "retriever_config": "cfg-2026-11-20",
      "scorer": "HHEM-2.1-Open",
      "scorer_cutoff": 0.5,
      "questions": 400,
      "unsupported": 12,
      "unsupported_rate": "3.0% (95% CI 1.7%-5.2%)",
      "answer_rate": "97.5%",
      "human_labelled_sample": 150,
      "code_commit": "<git commit of the evaluation script>"
    },
    "ran_at": "2026-11-23T17:00:00Z"
  }
}
```
- Needs an API key. Send hashes and the fields shown; keep the test set, answers and contexts in your own storage, and keep customer data out of params. params are stored as a hash, so keep the exact params object.
- Record one receipt per run, so a later run with a different scorer or test set shows up as a new setup instead of silently replacing the old number.
- verify_ai_run is free and needs no key: anyone with the receipt, its signature and your results file can confirm it matches what was recorded.
- A receipt shows what you recorded and when. It doesn't score answers, run the evaluation or confirm the rate is right.

_Rightshold isn't affiliated with Vectara, the Ragas project or the RAGTruth authors, and doesn't score answers for hallucinations. Metric definitions and benchmark figures are from the Ragas Faithfulness documentation, the HHEM-2.1-Open model card on Hugging Face and Vectara's hallucination leaderboard README (updated October 22, 2026), read November 23, 2026; they can change. The confidence interval example uses the Wilson score method. Not engineering or statistical advice for your specific app._

## Sources
- [Ragas documentation: Faithfulness metric](https://docs.ragas.io/en/stable/concepts/metrics/available_metrics/faithfulness/)
- [Vectara: HHEM-2.1-Open model card on Hugging Face (vectara/hallucination_evaluation_model)](https://huggingface.co/vectara/hallucination_evaluation_model)
- [Vectara: Hallucination Leaderboard (GitHub README, methodology and October 22, 2026 table)](https://github.com/vectara/hallucination-leaderboard)
- [Niu et al.: RAGTruth: A Hallucination Corpus for Developing Trustworthy Retrieval-Augmented Language Models (ACL 2024)](https://aclanthology.org/2024.acl-long.585.pdf)

## Related
- [How to investigate a complaint that your AI chatbot made something up](https://www.rightshold.com/answers/how-to-investigate-a-complaint-that-your-ai-chatbot-made-something-up)
- [How much should you trust an AI agent benchmark score when another AI model grades it?](https://www.rightshold.com/answers/how-much-should-you-trust-an-ai-agent-benchmark-score-when-another-ai-model-grades-it)
- [How to version an LLM-as-a-judge and keep a frozen eval set so scores stay comparable](https://www.rightshold.com/answers/how-to-version-an-llm-as-a-judge-and-keep-a-frozen-eval-set-so-scores-stay-comparable)
- [How to make LLM eval results reproducible and tamper-evident](https://www.rightshold.com/answers/how-to-make-llm-eval-results-reproducible-and-tamper-evident)
- [Why do AI benchmarks reward models for guessing instead of saying I don't know?](https://www.rightshold.com/answers/why-do-ai-benchmarks-reward-models-for-guessing-instead-of-saying-i-dont-know)

_Not legal advice. Updated 2026-11-23. JSON: https://www.rightshold.com/answers/how-do-you-measure-how-often-your-rag-chatbot-makes-things-up.json_