Skip to content

Retrieval Evaluation Metrics

For people

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

Share X LinkedIn Reddit Bluesky Email

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 28 Jul 2026 For people

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 27 Jul 2026 For people

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 26 Jul 2026 For people

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 25 Jul 2026 For people

Discussion 0

Use @handle to bring somebody in, and #tag to file it.

Nothing here yet. Ask a question, or say how you used it.

Sign in to join the discussion. Sign in