How to evaluate RAG: retrieval, faithfulness and answer quality

Evaluate RAG in three layers: whether retrieval found the right chunks, whether each answer claim is backed by them, and whether the answer is correct.

By CloudOEngine.ai Engineering · · 12 min read

You evaluate a RAG system by scoring three things separately on a fixed set of real questions: whether retrieval brought back the right chunks and ranked them near the top, whether every claim in the answer is supported by those chunks (faithfulness), and whether the answer actually addresses the question and agrees with a reference. A single "answer quality" score hides which of the three broke, and the fix for each one is different.

One wrong answer, three different bugs

As an illustration, picture an internal assistant over a company's travel policy. An employee asks: "What is the daily hotel limit for Pune?" The assistant answers ₹6,000. The real limit, in the policy revised last quarter, is ₹7,500.

To the employee, that is one wrong answer. To the engineers, it could be any of three bugs.

Retrieval may have missed the revised policy entirely and returned the old one. The model then repeated what it was given, faithfully and wrongly. Or retrieval found the new policy, but ranked it eighth, below two chunks from the old version, and the model picked the first number it saw. Or retrieval was perfect, the right chunk sat at position one, and the model blended it with a figure from a Mumbai row in the same table.

The first is a recall problem. The second is a ranking problem, which is what reranking is for. The third is a generation problem. If all you track is "was the final answer right", you know something is broken but not where, and a team can spend a week tuning prompts for a bug that lives in the index.

That is why the common frameworks split evaluation into layers. The Ragas paper names three aspects to judge: whether retrieval finds relevant and focused context, whether the model uses that context faithfully, and the quality of the generation itself. TruLens calls its version the RAG triad: context relevance, groundedness and answer relevance, one check on each edge between question, context and answer. ARES scores the same three dimensions. The names differ; the split is the same.

QuestionRetrieverTop-k chunksLLMAnswerRetrievalrecall@k, context precisionneeds labelled chunksFaithfulnessanswer claims backed by chunksno reference neededAnswer qualityrelevant to the question, correct vs referencerelevance needs no reference; correctness doesReference setreal questions, labelled chunks,short reference answers
Three checks on three edges of the pipeline. Faithfulness can run on any answer; retrieval recall and correctness need a small labelled reference set.

Measure retrieval before you look at answers

Retrieval is the layer I would measure first, because it caps everything downstream. If the right chunk never comes back, no prompt will fix the answer, and a faithfulness score will happily report that the model stuck to the wrong text.

The two questions are: did the right material come back at all (recall), and did it come back near the top (precision and ranking).

Recall at k is the share of questions where the relevant chunk appears somewhere in the top k results. Anthropic reported its contextual retrieval experiments as "1 minus recall@20", the percentage of relevant documents not found in the top 20 chunks. That framing is useful because it reads as a failure rate. In their tests, the failure rate was 5.7% at baseline, 3.7% with contextual embeddings, 2.9% when contextual BM25 was added, and 1.9% with reranking on top. Your numbers will differ, but the metric is worth copying.

Ragas also has an LLM-based recall that skips chunk labels. Its context recall splits a reference answer into individual claims and checks how many of them the retrieved context supports. The documentation is clear that recall needs a reference of some kind, since you can only say something was missed if you know what should have been found. Its point is that a short reference answer is easier to write than a list of correct chunk IDs.

Precision asks the opposite question: of what came back, how much was useful, and was the useful part on top? Ragas's context precision is the mean of precision@k taken at each rank where a relevant chunk appears, so a relevant chunk at position one scores much better than the same chunk at position eight. It comes in variants that judge relevance against a reference answer, against the generated response (no reference needed), or by comparing retrieved chunk IDs with labelled IDs, which needs no LLM at all.

If you can label source chunks, do. ID-based retrieval metrics are deterministic, cost nothing to run, and will not drift when someone updates the judge model. You label once per question, and every chunking or embedding change after that gets an exact, repeatable score. Our guide to chunking strategies has the kinds of changes you will want to compare this way. One catch: re-chunking changes chunk IDs, so label by document and section, or by a span of text, and map that to whatever chunks exist today.

Faithfulness: is every claim backed by the context?

Faithfulness checks the generation step against what the retriever handed it. Ragas defines it as the number of claims in the response supported by the retrieved context, divided by the total number of claims. A reply with two claims, one supported and one not, scores 0.5. TruLens does the same thing under the name groundedness: split the response into claims and look for evidence for each one independently.

The claim-by-claim approach matters. A judge asked "is this answer faithful?" in one go tends to wave through a mostly-right answer with one invented detail, and the invented detail is usually the one that hurts: a figure, a date, an eligibility condition. Splitting first forces it to look at each.

Because it needs no reference answer, you can run it on live traffic and alert when it drops. That makes it the closest thing RAG has to a production health metric.

But it is easy to over-read. Faithfulness measures agreement with the retrieved text, not with the truth. In the hotel example, an answer built from the superseded policy scores a perfect 1.0. So does an answer that says "the policy does not specify a limit for Pune" when the retriever missed the right chunk. A high faithfulness score with a low retrieval score is a system confidently repeating the wrong document.

When a faithfulness check fails, you want to see the exact chunks the model saw, in the order it saw them. CloudOEngine's AI runtime runs agents with RAG and traces every step and tool call, so the steps behind a flagged answer can be opened and inspected instead of reconstructed from scattered logs.

Answer quality: relevant, then correct

The third layer looks at the answer from the user's side. It has two parts that often get mixed up.

Answer relevance asks whether the response addresses the question that was asked. An answer can be fully faithful and still miss the point, for example by explaining the general travel policy when the employee asked for one number. Relevance needs no reference, since the judge only compares the question with the answer.

Correctness asks whether the answer agrees with what is actually true, and for that you need a reference answer. RAGChecker, a 2024 diagnostic framework, does this at the level of claims too: precision is the share of claims in the response that the reference answer supports, recall is the share of reference claims that made it into the response, and F1 combines them. Recall here catches the incomplete answer, the one that gets the hotel limit right but leaves out that it excludes taxes, which neither faithfulness nor relevance would flag.

Here is how the metrics line up.

Metric Question it answers Needs a reference? Typical fix when it drops
Recall@k / context recall Did the right material come back at all? Yes (labelled chunks or reference answer) Chunking, hybrid search, query rewriting, freshness of the index
Context precision Was the useful material near the top? Optional Reranking, fewer and better chunks
Faithfulness Is every claim backed by the retrieved text? No Prompt that restricts the model to the context, citations, smaller context
Answer relevance Does it address the question asked? No Prompt, query understanding
Correctness (claim precision and recall) Does it match the truth, completely? Yes Depends on which layer above failed

More context is not free

The most useful finding in the RAGChecker paper, for me, was a trade-off that a single score would hide. Raising the number of retrieved chunks from 5 to 20 lifted claim recall from 61.5 to 77.6 and faithfulness from 88.1 to 92.2. Both look like wins. But noise sensitivity, which counts wrong claims the model picked up from chunks in its context, also went up, from 34.0 to 35.4. The paper's summary is that as retriever recall increases, generators become more sensitive to noise.

In plain terms, every extra chunk is another chance for the model to grab a nearby wrong number. The Mumbai row in the hotel table is exactly this kind of noise: relevant enough to be retrieved, wrong for this question.

So when someone proposes raising k, ask to see recall, faithfulness and correctness on the same run. If recall rises and correctness does not, the extra chunks are adding noise faster than they add answers, and a reranker that keeps fewer, better chunks is probably the better move.

The reference set: smaller than you think

All of this needs a set of questions to run on. ARES was designed around needing only a few hundred human annotations, combined with synthetic data to train its judges.

I would start with 50 to 100 real questions from logs or from the people who will use the system, each with three things attached: the document and section that answers it, a one- or two-sentence reference answer, and a tag for the type of question (lookup, comparison, policy exception, numeric). Then add the awkward ones on purpose.

Questions the corpus cannot answer belong in the set, with the expected behaviour written down as "says it does not know". So do questions where two documents disagree, like the old and new travel policy, and questions with numbers in tables, because tables are where chunking and generation both slip.

Include questions the asking user should not get an answer to. If a junior employee asks about a director's salary band, the right retrieval result is nothing at all. This is an access control test as much as a quality test, and it only works if retrieval and the documents share one permission model. In CloudOEngine, data connections, the AI runtime and RAG sit under one permission model and one audit trail, so the same role that cannot open a document should not get it back from retrieval either, and an evaluation run can check that directly.

Synthetic questions generated from your own documents are fine for padding out coverage, but keep them tagged and report them separately. A model writing questions from a chunk tends to reuse that chunk's wording, which makes retrieval look better than it will be on real users who phrase things their own way.

Check the judge, especially on relevance

Most of these metrics use an LLM as the grader, and the judges are not equally good at every task. In the Ragas paper's own tests, on 50 questions built from recent Wikipedia pages, its faithfulness scoring agreed with human annotators 95% of the time, answer relevance 78%, and context relevance only 70%. The authors noted that context relevance was the hardest dimension to evaluate. That is a small dataset built by the framework's own authors, but the ordering is worth remembering: trust automated faithfulness scores more than automated relevance scores.

The defence is the same as for any judge. Label 50 outputs by hand for each metric you plan to rely on, run the judge on the same outputs, and read the disagreements. Our article on evaluating LLM applications covers judge bias and calibration in more detail. Where the judge and people disagree often, route those cases to a person rather than trusting either score. CloudOEngine uses the same principle in its Vision AI, where two independent trackers count people and the cases where they disagree go to a human review queue instead of into the number.

Reading a failed case

When a question fails, read the layers from the top of the pipeline down.

  1. Check retrieval. Was the labelled chunk in the top k? If not, the bug is in chunking, search or the index, and nothing downstream is worth looking at yet.
  2. Check ranking. If the chunk was there but low, with distractors above it, look at reranking or at trimming k.
  3. Check faithfulness. If the right chunk was on top and the answer still contains an unsupported claim, the problem is generation: the prompt, the model, or too much competing context.
  4. Check correctness and completeness. If the answer is faithful and relevant but still wrong or partial, compare the reference with the source. Sometimes the reference is outdated, and sometimes the document itself is wrong.

That last case is common: plenty of "RAG errors" are documents that disagree with each other, and the fix is in the content, not the code.

What I would set up first

Pick 50 real questions this week and label the source section for each. Run ID-based recall@k and context precision on every chunking, embedding or search change, because they are cheap and exact. Turn on claim-level faithfulness for production traffic and watch the trend. Add reference answers and correctness scoring next, then check each LLM-based metric against 50 human labels before you put it on a dashboard. And every time a user reports a wrong answer, add that question to the set with its correct source the same day.

How CloudOEngine helps

CloudOEngine is one platform and console for connecting data (databases, files, camera streams), pipelines, and an AI runtime with an LLM gateway, agents with tool access, and RAG. Everything sits under one permission model and one audit trail, which matters for RAG evaluation because the access rules that decide who can read a document are the same ones retrieval runs under, so "should not be answered for this user" is a test you can actually run.

Agents run real tools, for example filing a ticket, and every step and tool call is traced and inspectable. When an answer fails a faithfulness or correctness check, you can open the run and go through each step and tool call, then turn that case into a test question with the context it actually had.

Autopilot runs triggered agents with approval rules: a person approves an action, in the app or through an email approve link, before it runs. While your evaluation coverage is still growing, that keeps a wrong answer from turning into a wrong action.

Governance is included, not upsold: tenant isolation, role-based access, audit logs and per-tenant encrypted secrets. CloudOEngine connects to your sources through 500+ connectors and is built in Bengaluru, India.

Book a demo or see the AI runtime.

Frequently asked questions

How do you evaluate a RAG system?

Score it in three layers on a fixed set of real questions: retrieval (did the right chunks come back, and near the top), faithfulness (is every claim in the answer supported by those chunks), and answer quality (does it address the question and agree with a reference answer). Then read the failing cases to see which layer broke.

What is the difference between faithfulness and correctness in RAG?

Faithfulness asks whether the answer's claims are supported by the retrieved context. Correctness asks whether the answer matches the truth, usually a reference answer. An answer can be perfectly faithful to an outdated or wrong chunk and still be incorrect, so you need both.

What is context precision in RAG?

Context precision measures whether the relevant chunks in the retrieved list are ranked near the top. Ragas computes it as the mean of precision at each rank where a relevant chunk appears, and offers variants that judge relevance against a reference answer, against the generated response, or against labelled chunk IDs.

Do I need reference answers to evaluate RAG?

Not for everything. Faithfulness and answer relevance can be scored without a reference. Retrieval recall and answer correctness need one, because you can only say something was missed if you know what should have been found. Labelled source chunks or a short reference answer per question are enough to start.

Can I trust an LLM judge to grade RAG answers?

Partly, and less on some metrics than others. In the Ragas paper's tests on 50 Wikipedia-based questions, its faithfulness scoring agreed with human annotators 95% of the time but context relevance only 70%. Check any judge against your own human labels before acting on its scores.

Does retrieving more chunks make RAG answers better?

It raises recall but adds noise. In the RAGChecker paper, increasing retrieved chunks from 5 to 20 lifted claim recall from 61.5 to 77.6 and faithfulness from 88.1 to 92.2, while noise sensitivity also rose. Measure both sides before changing k.

Sources

  1. Ragas: Automated Evaluation of Retrieval Augmented Generation (Es et al., 2023)
  2. Ragas documentation: Faithfulness
  3. Ragas documentation: Context Precision
  4. Ragas documentation: Context Recall
  5. ARES: An Automated Evaluation Framework for Retrieval-Augmented Generation Systems (Saad-Falcon et al., NAACL 2024)
  6. RAGChecker: A Fine-grained Framework for Diagnosing Retrieval-Augmented Generation (Ru et al., 2024)
  7. Anthropic: Introducing Contextual Retrieval (19 Sep 2024)
  8. TruLens: The RAG Triad

#rag evaluation #faithfulness #context precision #retrieval metrics #llm as a judge