Inferensys

Glossary

Contextual Recall

Contextual Recall is a Retrieval-Augmented Generation (RAG) evaluation metric that quantifies the proportion of information from a ground truth answer that is present within the context retrieved by the system.
Developer working on RAG retrieval system, document chunks visible on screen, technical workspace with code editor.
RAG EVALUATION METRIC

What is Contextual Recall?

A core metric for assessing the retrieval component of a Retrieval-Augmented Generation (RAG) system.

Contextual Recall is a quantitative evaluation metric that measures the proportion of information from a ground truth answer that is successfully retrieved and present within the context passages provided to a large language model in a RAG pipeline. It directly assesses the retrieval system's ability to find all necessary facts, ensuring the LLM has the required information to generate a complete and accurate response. A high score indicates the retrieved context contains the full answer, while a low score signals critical information was missed.

Calculated by comparing named entities, facts, and key statements between the ground truth and the retrieved chunks, Contextual Recall is the recall-oriented counterpart to Contextual Precision. It is fundamental for diagnosing information loss in retrieval, which is a primary cause of LLM hallucinations or incomplete answers. Optimizing for this metric involves improving chunking strategies, hybrid search algorithms, and query understanding to ensure comprehensive coverage of relevant information.

RAG EVALUATION METRIC

Key Characteristics of Contextual Recall

Contextual Recall is a core metric for assessing the retrieval component of a Retrieval-Augmented Generation (RAG) system. It quantifies the system's ability to find all necessary information from source documents to answer a user's query.

01

Definition and Core Calculation

Contextual Recall measures the proportion of information from a ground truth answer that is present within the retrieved context provided to the language model. It is calculated as:

  • (Number of Ground Truth Statements Retrieved) / (Total Number of Ground Truth Statements)
  • A score of 1.0 indicates all required information was retrieved; a score of 0.0 indicates none was found. This metric directly evaluates the completeness of retrieval, which is critical for preventing answer omissions and ensuring factual grounding.
02

Relationship to Classic Information Retrieval

Contextual Recall is the RAG-specific adaptation of the classic Recall metric from information retrieval. The key difference is the reference point:

  • Classic Recall: Measures retrieval of entire relevant documents from a corpus.
  • Contextual Recall: Measures retrieval of specific information statements needed to formulate an answer. It is closely related to Recall@k, which measures if relevant documents are in the top-k results. High Contextual Recall requires high Recall@k, but also depends on effective document chunking to ensure key facts aren't split across chunks.
03

Trade-off with Contextual Precision

In practice, optimizing for Contextual Recall often involves a trade-off with Contextual Precision, which measures how much of the retrieved context is actually relevant.

  • High Recall, Low Precision: System retrieves many chunks, ensuring all facts are present, but includes irrelevant text that can confuse the LLM, increase latency, and waste context window space.
  • High Precision, Low Recall: System retrieves only highly relevant chunks but may miss key facts, leading to incomplete or hallucinated answers. Effective RAG design uses techniques like hybrid search and cross-encoder reranking to optimize the precision-recall curve for a given use case.
04

Dependence on Chunking Strategy

The metric is highly sensitive to the document chunking strategy. Poor chunking can artificially lower scores even with a perfect retriever.

  • Small, Fixed-Size Chunks: Risk splitting a single fact across two chunks, causing both to be incomplete and lowering recall.
  • Semantic or Topic-Aware Chunks: Chunking by paragraphs or using models to identify logical boundaries (e.g., NLTK, spaCy) helps keep coherent information together, improving recall.
  • Overlapping Chunks: A common technique where consecutive chunks share some content (e.g., a 100-token overlap) to mitigate split-fact issues and boost Contextual Recall at the cost of increased index size and potential redundancy.
05

Evaluation Methodology and Ground Truth

Accurate measurement requires a robust evaluation dataset with human-annotated ground truth.

  1. Query & Ground Truth Pair: For each query, human experts define the complete, verifiable answer.
  2. Statement Decomposition: The ground truth answer is decomposed into distinct, atomic factual statements.
  3. Annotation: Annotators label whether each atomic statement is present in the system's retrieved context. Frameworks like RAGAS automate this by using an LLM judge to perform the decomposition and presence-check, though human validation is recommended for high-stakes evaluations. Inter-annotator agreement (e.g., Cohen's Kappa) should be measured to ensure label reliability.
06

Operational Impact and Optimization Levers

Low Contextual Recall directly causes hallucinations of omission and incomplete answers. Engineers optimize it by adjusting:

  • Retrieval Method: Replacing pure dense vector search (high precision) with hybrid search (combining BM25 and vectors) often boosts recall.
  • Query Transformation: Using query expansion (adding synonyms) or hypothetical Document Embeddings (HyDE) can retrieve a broader set of relevant chunks.
  • k Value: Increasing the number of chunks retrieved (top-k) directly improves recall but harms precision and latency.
  • Index Granularity: Experimenting with chunk sizes and overlap is a primary lever for recall improvement without changing the core retriever model.
METRIC COMPARISON

Contextual Recall vs. Classic Information Retrieval Recall

This table compares the core characteristics of the RAG-specific Contextual Recall metric against the foundational information retrieval metric of Recall.

Feature / DimensionContextual RecallClassic Information Retrieval Recall

Primary Objective

Measures if retrieved context contains all facts needed to answer a specific query.

Measures if the system retrieved all relevant documents from a corpus for a query.

Unit of Evaluation

Granular facts or entities within a ground truth answer.

Whole documents or passages.

Relevance Definition

Dynamic; defined by the information required to synthesize a correct, comprehensive answer.

Static; defined by topical relevance of a document to a query.

Evaluation Method

Compare retrieved context to a ground truth answer for factual coverage (e.g., using LLM-as-judge).

Compare retrieved document IDs to a pre-defined set of relevant document IDs.

Dependency on Answer

Directly dependent on a known ground truth answer for the query.

Independent of any specific answer; only depends on document relevance labels.

Typical Scoring

Proportion of answer facts/entities present in the context (e.g., 0.85 or 85%).

Proportion of all relevant documents retrieved (e.g., Recall@k = 0.70).

Key Limitation

Requires high-quality ground truth answers for evaluation.

Requires exhaustive relevance judgments for the entire corpus, which is often impractical.

Primary Use Case

Diagnosing RAG pipeline sufficiency and identifying missing context for answer generation.

Benchmarking pure search engine performance and optimizing for high coverage.

RETRIEVAL EVALUATION METRICS

Frequently Asked Questions

Essential questions and answers about Contextual Recall, a core metric for evaluating the factual grounding of Retrieval-Augmented Generation (RAG) systems.

Contextual Recall is a quantitative evaluation metric for Retrieval-Augmented Generation (RAG) systems that measures the proportion of information from a ground truth answer that is present within the context retrieved by the system. It is a recall-oriented metric, focusing on whether the retrieval component successfully captured all necessary facts to support a complete answer. A high Contextual Recall score indicates the retrieved documents contain the key information required for the language model to generate a factually comprehensive response, directly combating hallucinations by ensuring source material is available.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.