QA
Intermediate LevelAI, LLMs, Embeddings & MCP

What is the difference between Context Recall and Context Precision in RAG metrics?

❓ Interview Prompt: Compare retrieval quality metrics: Context Recall (ground truth coverage) vs Context Precision (signal-to-noise ratio).

Retrieval metrics measure how effectively a vector database fetches documents required to answer a question:

1. Context Precision:

Measures the ratio of relevant chunks to total retrieved chunks. High precision means top-ranked retrieved chunks contain zero noisy, irrelevant text.

$$\text{Context Precision} = \frac{\text{Relevant Chunks Retrieved}}{\text{Total Chunks Retrieved}}$$

2. Context Recall:

Measures whether all ground-truth facts required to answer the question were successfully retrieved.

$$\text{Context Recall} = \frac{\text{Ground Truth Facts Found in Retrieved Chunks}}{\text{Total Ground Truth Facts}}$$

Code Implementation Example

typescript
function calculateContextPrecision(retrievedChunks: { isRelevant: boolean }[]): number {
  const relevantCount = retrievedChunks.filter(c => c.isRelevant).length;
  return relevantCount / retrievedChunks.length;
}
💡Context Precision metric score calculation.
🎯 Interview Key Takeaway

Context Precision measures signal-to-noise ratio of retrieved chunks; Context Recall measures ground-truth fact coverage.

#RAG Evaluation#Context Precision#Context Recall#Metrics#Intermediate
Back to all AI, LLMs, Embeddings & MCP Questions→

More AI, LLMs, Embeddings & MCP Interview Questions

Beginner LevelAI, LLMs, Embeddings & MCP

What are Vector Embeddings and Cosine Similarity in AI Semantic Search?

Beginner LevelAI, LLMs, Embeddings & MCP

What is the Model Context Protocol (MCP) and how does it connect LLMs to external tools?

Beginner LevelAI, LLMs, Embeddings & MCP

What is Retrieval-Augmented Generation (RAG) and how does it prevent LLM hallucinations?