MRR and nDCG
Ranking metrics for search: MRR scores how high the first relevant result appears, nDCG scores the order of the whole result list.

MRR and nDCG are ranking metrics for search. Mean reciprocal rank (MRR) scores how high the first relevant result appears; normalized discounted cumulative gain (nDCG) scores the order of the whole result list. Both answer one question: did a change to search put the right documents nearer the top?
Mean reciprocal rank averages 1 divided by the position of the first relevant result: first place gives 1, third gives 0.33. It fits tasks with one right answer. Normalized discounted cumulative gain, introduced by Järvelin and Kekäläinen in 2002, handles several relevant results with graded relevance, discounting those lower in the list, and compares the ranking with the ideal one. Both are usually reported at a cutoff, such as nDCG@10 for the first ten results, and both range from 0 to 1.
Both need labeled queries (ground truth), and both tell you whether a reranker or hybrid search actually improved the order. Precision and recall ignore order: they only count what is in the list. In RAG evaluation, context precision plays a similar role, with an LLM judging relevance instead of human labels.
Related terms
- Reranker: A model that rescores the top search results against the query, so the most relevant ones go to the language model first.
- Hybrid search: Combining keyword search (such as BM25) with vector search, so results match both exact terms and meaning.
- Precision (AI metric): The share of returned results that are actually correct: of everything the system flagged or retrieved, how much was right.
- Top-k (retrieval): The number of highest-ranked search results passed on to the next step; in RAG, how many passages go into the prompt.
- Recall (AI metric): The share of all correct items that the system actually found: of everything it should have caught, how much it did.
- Ground truth: The known correct answers or labels that a model’s output is compared against in an evaluation.
- Context precision: A RAG retrieval metric: whether the passages relevant to the question are ranked at the top of what was retrieved.
