Skip to content

Retrieval Evaluation Metrics

Recall@k, precision@k, MRR and NDCG: how to measure whether your search or RAG retrieval finds the right documents.

Editorial team 2 min read

In search and RAG systems, the answer can only be as good as what's retrieved. Measure retrieval separately from generation.

Build a Retrieval Test Set

Collect realistic queries and, for each, the documents or chunks that should be found. Real user questions are best; subject-matter experts can mark the relevant passages.

Core Metrics

  • Recall@k: of the relevant items, what share appears in the top k results? Crucial for RAG, where only the top few chunks reach the model.
  • Precision@k: of the top k results, what share are relevant?
  • Hit rate@k: did at least one relevant item appear in the top k?
  • MRR (mean reciprocal rank): how high the first relevant result appears, on average.
  • NDCG: rewards ranking highly relevant items near the top, and supports graded relevance.

Choosing k

Use the k that matches your system: if you pass five chunks to the model, measure recall@5.

Diagnose Failures

For queries where retrieval fails, look at what was returned instead. Common causes: poor chunking, missing metadata, synonyms the index doesn't handle, and outdated content.

Track Over Time

Re-run the retrieval evaluation whenever you change the embedding model, chunking, index settings or document set.

Then Evaluate Answers

Once retrieval is solid, evaluate whether the generated answers are correct and supported by the retrieved passages.

More in Generative AI

All Generative AI guides →
Generative AI Guide · 2 min

Prompt Engineering Fundamentals

The building blocks of a good prompt — context, task, constraints and format — with before-and-after examples.

Generative AI 2 min read 24 Jul 2026

Generative AI Guide · 2 min

Few-Shot Prompting With Examples

Showing a model a few examples of the input and output you want is often clearer than describing it. How to choose good examples.

Generative AI 2 min read 23 Jul 2026

Generative AI Guide · 2 min

Getting Structured Output From LLMs

How to get JSON and other machine-readable output reliably from a language model, and how to validate it.

Generative AI 2 min read 22 Jul 2026

Generative AI Guide · 2 min

Why Language Models Hallucinate

What hallucination is, why it happens, and practical ways to reduce and catch it.

Generative AI 2 min read 21 Jul 2026