LIVEยทThe trends shaping tomorrow's world.
AI

RAG Evaluation Using RAGAS

How RAGAS scores RAG systems: faithfulness, answer relevancy, context precision and recall, with worked examples, test sets and the limits of LLM judges.

RAGAS (Retrieval Augmented Generation Assessment) is an open-source Python framework that scores a RAG pipeline with a set of metrics, most of them computed by prompting a language model. Its core metrics answer four questions: is the answer supported by the retrieved text (faithfulness), does it address the question (answer relevancy), are the relevant chunks ranked near the top (context precision), and did retrieval find everything the answer needs (context recall)? Treat the scores as a fast, cheap signal for comparing versions of your system, not as ground truth.

Why RAG needs its own evaluation

A retrieval-augmented generation system can fail in two places. The retriever can return the wrong passages, or the generator can ignore good passages and hallucinate. A single "was the answer right?" score doesn't tell you which part to fix.

The RAGAS authors, from Exploding Gradients, Cardiff University and AMPLYFI, made the same argument in their 2023 paper. Evaluating RAG means judging "the ability of the retrieval system to identify relevant and focused context passages," whether the LLM uses them faithfully, and the quality of the generation itself [1]. They also noted that teams building RAG "usually do not have access to human-annotated datasets or reference answers," so they designed metrics that could run without them [1].

Classic retrieval metrics such as Precision@K, Recall@K and MRR need labeled relevant documents for every test query. RAGAS's pitch is that an LLM can stand in for much of that labeling.

The four core metrics

As of November 2026, the RAGAS docs list metrics for RAG, agents and tool use, text comparison, SQL and general-purpose rubric scoring [2]. For RAG, four do most of the work. Each needs different inputs:

Metric

Measures

Inputs

Needs a reference answer?

Faithfulness

Share of the answer's claims supported by the retrieved context [3]

question, response, retrieved contexts

No

Answer relevancy

How well the answer addresses the question [4]

question, response

No

Context precision

Whether relevant chunks are ranked high [5]

question, retrieved contexts, plus a reference or the response

Optional

Context recall

Share of the reference's claims found in the retrieved context [6]

question, retrieved contexts, reference

Yes

Faithfulness: is the answer grounded?

Faithfulness checks whether every claim in the answer can be inferred from the retrieved context. The paper describes two LLM steps: break the answer into short statements, then ask the LLM to verify each statement against the context [1]. The score is supported statements divided by total statements [1][3]:

Faithfulness = claims supported by the retrieved context รท total claims in the response

Illustrative example. Context: "The X200 router supports Wi-Fi 6 and has four Ethernet ports. Its warranty is two years." Answer: "The X200 supports Wi-Fi 6, has four Ethernet ports, includes a two-year warranty and supports Wi-Fi 7." The LLM extracts four claims; three are supported and one (Wi-Fi 7) isn't.

Faithfulness = 3 รท 4 = 0.75

Note what faithfulness doesn't check: whether the context itself is true. A perfectly faithful answer built on an outdated document is still wrong. For a lighter-weight verifier, the docs describe an option that swaps the LLM verification step for Vectara's open-source HHEM-2.1-Open classifier [3].

Answer relevancy: did it answer the question?

Answer relevancy (listed as Response Relevancy in the docs' metric index [2]) works backwards. An LLM reads the answer and generates questions it would answer, by default three [4]. Each generated question is embedded and compared with the original question by cosine similarity, and the score is the average [1][4]:

Answer relevancy = average cosine similarity between the original question and the questions generated from the answer

The idea is that an on-topic, complete answer implies the original question; a vague or padded one implies something else. It doesn't measure factual accuracy [4]. The docs also note scores usually fall between 0 and 1 but aren't guaranteed to, because cosine similarity can be negative [4].

Context precision: are the good chunks at the top?

Context precision asks whether the retriever ranked useful chunks above useless ones, which matters because every extra chunk costs tokens and, as the RAGAS paper notes, LLMs are often less effective at using long contexts [1]. The RAGAS docs define it as a weighted average of Precision@k over the ranks where a relevant chunk appears [5]:

Context Precision@K = ฮฃ (Precision@k ร— v_k) รท number of relevant chunks in the top K, where v_k is 1 if the chunk at rank k is relevant and 0 otherwise [5]

An LLM decides relevance by comparing each chunk with a reference answer or, in a reference-free variant, with the generated response; non-LLM variants compare against reference contexts by string similarity or by document IDs [5].

Illustrative example. Three chunks are retrieved; the LLM marks them relevant, not relevant, relevant.

  • Rank 1: Precision@1 = 1/1 = 1.00, vโ‚ = 1 โ†’ contributes 1.00
  • Rank 2: Precision@2 = 1/2 = 0.50, vโ‚‚ = 0 โ†’ contributes 0
  • Rank 3: Precision@3 = 2/3 โ‰ˆ 0.667, vโ‚ƒ = 1 โ†’ contributes 0.667

Context precision = (1.00 + 0 + 0.667) รท 2 โ‰ˆ 0.833

If the irrelevant chunk had been ranked first, the score would be (0 + 0.5 + 0.667) รท 2 โ‰ˆ 0.583. Same chunks, worse order, lower score. This is the same idea as average precision in classic IR, restricted to the retrieved list.

Context recall: did retrieval find everything needed?

Context recall needs a reference answer. The LLM splits the reference into claims and checks whether each can be attributed to the retrieved context [6]:

Context recall = reference claims supported by the retrieved context รท total claims in the reference

Illustrative example. Reference answer: "The X200 has four Ethernet ports, a two-year warranty and costs $129." The retrieved chunks mention the ports and the warranty but not the price. Two of three claims are covered.

Context recall = 2 รท 3 โ‰ˆ 0.667

Low context recall points at retrieval, not generation: the answer can't be right if the facts never reached the model. A non-LLM variant compares retrieved contexts with a list of ground-truth reference contexts instead [6].

Reading the scores together

The metrics are most useful as a diagnostic pattern:

Pattern

Likely problem

Where to look

Low context recall

Retrieval misses needed facts

Chunking, hybrid search, top-k size

High recall, low context precision

Right chunks retrieved but buried

Reranking, fewer chunks

Good context scores, low faithfulness

Generator adds unsupported claims

Prompt, model choice, citation requirements

High faithfulness, low answer relevancy

Grounded but off-target or padded

Prompt, answer format, question understanding

RAGAS also documents noise sensitivity, the share of incorrect claims in a response, which can be measured against relevant or irrelevant retrieved context; lower is better [7]. It's useful when you suspect distractor chunks are pulling answers off course.

From the paper to the library

The library has moved on from the 2023 paper, so it helps to know which is which.

  • The paper proposed three reference-free metrics: faithfulness, answer relevance and context relevance, the share of context sentences an LLM judged necessary to answer the question [1]. Experiments used OpenAI's gpt-3.5-turbo-16k as the judge and text-embedding-ada-002 for embeddings [1].
  • The library, as of November 2026, centers retrieval evaluation on context precision and context recall, which can use a reference answer [5][6]. The paper's context relevance no longer appears among its core RAG metrics; a metric named Context Relevance is listed separately under "Nvidia Metrics" [2]. The library also adds agent, SQL and rubric-based metrics [2].
  • Versions. The latest PyPI release when we checked was 0.4.4, published November 14, 2026, under the Apache 2.0 license [9]. The docs recommend a newer "collections" API and say the legacy metric classes will be removed in version 1.0 [3][6]. Pin your version, because scores can shift when prompts or defaults change.

What the paper found about accuracy

The authors built a small dataset, WikiEval, from 50 Wikipedia pages on events since early 2022, with human judgments on pairs of answers or contexts [1]. They report that RAGAS agreed with annotators more often than two baselines that asked ChatGPT for direct scores or rankings. Agreement was highest for faithfulness, lower for answer relevance (where the two candidates often differed subtly), and lowest for context relevance, which the authors called "the hardest quality dimension to evaluate," noting the LLM struggled to pick crucial sentences from long contexts [1]. That's one small dataset; it doesn't tell you how well the metrics track human judgment on your domain.

Building a test set

Every score is only as good as the questions you run. RAGAS can generate synthetic test questions from your documents. The docs describe loading documents, building a knowledge graph of them with an LLM and embeddings, then generating queries with a default mix of 50% single-hop specific, 25% multi-hop abstract and 25% multi-hop specific questions [8]. The docs advise reviewing the generated questions and keeping the ones you want [8].

A practical recipe:

  1. Start with real questions. Pull them from search logs, support tickets or user interviews. These reflect what people actually ask.
  2. Add synthetic questions to cover documents and question types your logs miss.
  3. Write reference answers for a subset, so you can use context recall and reference-based context precision.
  4. Freeze the set, version it and rerun it on every change to chunking, embeddings, retrieval or prompts.
  5. Spot-check with humans. Read a sample of low and high scores each run to make sure the judge agrees with you.

Limitations and risks

  • An LLM is grading an LLM. Scores depend on the judge model, its prompt and its mistakes. Changing the judge can change the scores without any change to your system.
  • Scores are noisy. LLM outputs vary between runs. Look at differences across a decent-sized test set, not single examples.
  • Faithful isn't the same as correct. Faithfulness measures support by the retrieved context, not truth.
  • Reference-free metrics can miss what's absent. Without a reference, nothing tells you the answer left out an important fact. Context recall needs references for that reason.
  • Not every question type fits. Microsoft's GraphRAG researchers argued that RAGAS-style criteria such as context relevance, faithfulness and answer relevance aren't well suited to broad "sensemaking" questions about a whole corpus, and used head-to-head comparisons instead [10]. See Graph RAG vs traditional RAG.
  • Cost. Each LLM-based metric makes one or more LLM calls per test example, and answer relevancy adds embedding calls. Budget for it in CI.
  • Data handling. Your documents, questions and answers go to whichever judge model you configure. Use an approved provider for sensitive content.

How to use RAGAS well

  • Evaluate retrieval separately too. If you have labeled relevant documents, classic metrics such as Recall@K and MRR are deterministic and cheap. Use RAGAS for the parts that need judgment.
  • Track trends, not absolutes. A faithfulness of 0.82 means little alone. A drop from 0.88 to 0.82 after a prompt change means something.
  • Gate releases on a few metrics. For example, require faithfulness and context recall not to regress on the frozen test set.
  • Keep humans in the loop for high-stakes domains; see human-in-the-loop AI.

Outlook

The paper's central bet, that LLM judges can make RAG evaluation cheap enough to run continuously, has shaped how teams test RAG. The library's move from purely reference-free metrics toward reference-based context precision and recall [5][6] suggests a realistic middle ground: a modest set of human-written references, plus LLM grading at scale. Expect evaluation to widen further toward agentic RAG, where the docs already list tool-call and goal-accuracy metrics [2].

Frequently asked questions

What is a good RAGAS score?

There's no universal threshold. Scores depend on your judge model, prompts and test set. Set a baseline on a frozen test set, then aim to improve it and never regress.

Does RAGAS need ground-truth answers?

Not for faithfulness and answer relevancy, which are reference-free [3][4]. Context recall requires a reference answer or reference contexts [6], and context precision works best with one [5].

What is the difference between faithfulness and answer relevancy?

Faithfulness asks whether the answer's claims are supported by the retrieved context [3]. Answer relevancy asks whether the answer addresses the question, regardless of accuracy [4]. An answer can be faithful but off-topic, or on-topic but unsupported.

Which LLM should I use as the judge?

Use a capable model you're permitted to send your data to, keep it fixed across comparisons, and record its version. Changing the judge mid-project makes old and new scores incomparable.

Is RAGAS free?

The library is open source under the Apache 2.0 license [9]. Running it costs whatever your judge model and embedding calls cost.

Sources

  1. Es, S., James, J., Espinosa-Anke, L. and Schockaert, S. "Ragas: Automated Evaluation of Retrieval Augmented Generation." arXiv:2309.15217, v2, April 2025. https://arxiv.org/abs/2309.15217
  2. Ragas. "List of available metrics." Accessed November 2026. https://docs.ragas.io/en/stable/concepts/metrics/available_metrics/
  3. Ragas. "Faithfulness." Accessed November 2026. https://docs.ragas.io/en/stable/concepts/metrics/available_metrics/faithfulness/
  4. Ragas. "Answer Relevancy." Accessed November 2026. https://docs.ragas.io/en/stable/concepts/metrics/available_metrics/answer_relevance/
  5. Ragas. "Context Precision." Accessed November 2026. https://docs.ragas.io/en/stable/concepts/metrics/available_metrics/context_precision/
  6. Ragas. "Context Recall." Accessed November 2026. https://docs.ragas.io/en/stable/concepts/metrics/available_metrics/context_recall/
  7. Ragas. "Noise Sensitivity." Accessed November 2026. https://docs.ragas.io/en/stable/concepts/metrics/available_metrics/noise_sensitivity/
  8. Ragas. "Testset Generation for RAG." Accessed November 2026. https://docs.ragas.io/en/stable/getstarted/rag_testset_generation/
  9. Python Package Index. "ragas." Accessed November 2026. https://pypi.org/project/ragas/
  10. Edge, D. et al. "From Local to Global: A GraphRAG Approach to Query-Focused Summarization." arXiv:2404.16130, v2, February 2025. https://arxiv.org/abs/2404.16130