Evaluating retrieval performance with the right tools and metrics
Retrieval quality directly bounds RAG answer quality, so it must be evaluated separately from generation quality. Databricks recommends evaluating retrievers using standard information retrieval metrics computed over a labeled evaluation set of (query, relevant document/chunk) pairs, and provides tooling such as Mosaic AI Agent Evaluation to help compute and track these metrics.
1 · Learn the must-know
- Precision@K measures what fraction of the top-K retrieved chunks are actually relevant, penalizing irrelevant results returned to the LLM context.
- Recall@K measures what fraction of all known relevant chunks were successfully retrieved in the top-K, indicating whether important context is being missed.
- NDCG (Normalized Discounted Cumulative Gain) accounts for the ranking order of relevant results, rewarding retrievers that place the most relevant chunks higher.
- MRR (Mean Reciprocal Rank) focuses on how quickly the first relevant result appears, useful when only one correct answer/chunk is expected.
- Building a labeled ground-truth dataset of representative queries mapped to known-relevant document chunks is required before these metrics can be computed, and Databricks supports curating such evaluation sets (including via human or LLM-assisted labeling) as part of the evaluation workflow.
- A common gotcha: retrieval metrics can look strong on a small or non-representative evaluation set yet fail to reflect real production performance, so evaluation sets should be periodically refreshed and reviewed for coverage.
2 · Check your understanding
A Generative AI Engineer's RAG application retrieves the top 8 chunks per query and passes all of them into a prompt bounded by a 4,096-token context limit. Evaluation feedback shows the LLM frequently grounds answers in irrelevant chunks, diluting the correct context. The engineer wants a retrieval metric that reflects what fraction of the 8 retrieved chunks are actually relevant, to gauge how much noise reaches the model. Which metric should the engineer track?
What you have tried across Databricks GenAI Engineer's objectives, not a readiness score.
Design Applications10.71% of the exam*0 of 6 tried
Data Preparation14.29% of the exam*0 of 8 tried
Application Development23.21% of the exam*0 of 13 tried
Assembling and Deploying Applications26.79% of the exam*0 of 15 tried
Governance7.14% of the exam*0 of 4 tried
Evaluation and Monitoring17.86% of the exam*0 of 10 tried
* Our estimate. Databricks publishes no section weights.
3 · Keep going
Ready for more? Take a weighted mock or try free practice questions.