Context precision.
Signal-to-noise ratio of retrieved chunks, weighted by ranking position. Range 0 to 1, higher is better.
How it’s computed
For each retrieved chunk at position k, the
judge marks it as relevant or not. The metric is the ranked
precision: relevant chunks near the top matter more than
relevant chunks lower down.
context_precision@K = sum_{k=1..K} (precision@k × v_k) / sum(v_k)
where v_k ∈ {0, 1} indicates relevance.
The ranking weight is what makes this metric useful. A retriever that finds the right chunks but buries them at position 8 will score worse than one that puts them at positions 1 and 2 — even if both retrievers returned the same set.
Worked example
Top-5 retrieved chunks. Chunks at positions 2 and 4 are
relevant; the others are noise.
precision@2 = 1/2 = 0.5,
precision@4 = 2/4 = 0.5. Weighted score
≈ 0.5 — mediocre because the relevant chunks
aren’t at the top.
How Yoke Agent uses it
Context precision is one of the RAGAS core four metrics, run on every RAG experiment. Low context precision is the signal that tells you to add a reranker — the relevant chunks are in your top-k, they just aren’t at the top.
Frequently asked
What if my relevant chunks are ranked low?
Context precision drops even if context recall is fine. This is exactly why the metric is weighted by position — it exposes retrieval-ordering problems that simple hit-rate wouldn’t.
How do I improve it?
The usual fix is adding a reranker (Cohere Rerank, BGE, or hybrid BM25 scoring). A reranker moves relevant chunks up without changing the underlying retriever.
What’s the difference from context recall?
Precision asks “of what I retrieved, how much is useful”; recall asks “of what is useful, how much did I retrieve”. You need both.