Context precision
A RAG retrieval metric: whether the passages relevant to the question are ranked at the top of what was retrieved.

Context precision is a RAG retrieval metric that checks whether the passages relevant to the question sit at the top of what was retrieved. It rewards a retriever that puts the useful chunks first and penalizes one that buries them under noise.
Each retrieved chunk is judged relevant or not, by comparison with a reference answer or by a judge model, and the score rewards relevant chunks appearing early in the list; Ragas computes it as an average of precision at the positions of the relevant chunks. A low score means the model gets noise mixed in with, or ahead of, the useful text, which costs tokens and can pull the answer off course. Retrieving more chunks with a higher top-k tends to lower it.
It is a property of the retriever and the reranker, not of the language model. It pairs with context recall: precision asks whether what came back is clean, recall asks whether anything needed is missing. Ranking metrics from classic search, such as MRR and nDCG, measure a similar thing with labeled relevance.
Sources
- Ragas: Context Precision docs.ragas.io
Related terms
- Context recall: A RAG retrieval metric: how much of the information needed for the correct answer was actually retrieved.
- Precision (AI metric): The share of returned results that are actually correct: of everything the system flagged or retrieved, how much was right.
- Reranker: A model that rescores the top search results against the query, so the most relevant ones go to the language model first.
- Ragas: An open-source Python library for evaluating RAG systems with metrics such as faithfulness, answer relevancy, context precision and context recall.
- 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.
- 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.
