/ ENGINEERING SYSTEMS
Back to Field Notes

FIELD NOTE / SYSTEMS NOTE

Evaluating and Improving Retrieval Quality in RAG Systems

·11 min read·Updated 2026-09-15
READERS

A RAG system that retrieves the wrong document answers confidently from bad evidence—and no amount of prompt engineering fixes a retrieval failure. Retrieval quality is the part of the pipeline most teams measure last and break most often: it degrades silently when documents change, embedding models drift, or query distributions shift. This note covers how to measure retrieval precision and recall at the chunk level, diagnose the specific failure mode when retrieval goes wrong, and build the evaluation infrastructure that catches degradation before users do.

Public-safe engineering note · no client or confidential implementation details
01

Retrieval is not search

Keyword search returns strings that match a query. Retrieval for RAG must return the evidence that lets a downstream model answer a task correctly. That distinction matters because semantic similarity can rank a paragraph about refunds above the exact table that contains the eligibility threshold. In a retail-banking assistant, a dense index scored 0.84 average cosine similarity on 2,000 questions while Recall@5 was only 0.71; the model saw plausible context, but 29% of required chunks never arrived. The team initially tuned the prompt and gained no measurable lift. Once retrieval was evaluated independently, the missing signal was obvious: account identifiers and policy codes were lexical anchors that embeddings underweighted. Treat retrieval as a measurable contract between a query and evidence, not as a black-box search box. The output of retrieval is a ranked set of chunks, each with provenance, access decisions, and a reason it was eligible. Generation quality is downstream of that set.

Retrieval stack pipeline
RETRIEVAL ZONERERANKERUser queryQuery processingEmbedding modelVector indexRerankerContext assemblyLLMDENSE / SPARSE MISSfix: model · index · chunkingRERANKER FAILUREfix: calibration · labels
02

The retrieval failure taxonomy

Four failure modes cover most incidents I have debugged. A dense miss occurs when semantically related language is far from the query in embedding space. A sparse miss occurs when exact identifiers, product codes, or spelling variants are absent from the lexical match. A chunking failure happens when the required fact is split across boundaries or its heading is detached from the value. A preprocessing failure removes tables, OCR text, code, or metadata before indexing. They present differently: dense misses have low embedding similarity but reasonable keywords; sparse misses have high lexical overlap but weak semantic ranking; chunking failures return neighboring fragments without the answer; preprocessing failures return an apparently relevant chunk whose critical field is blank. In a healthcare retrieval audit, 400 medication questions produced 62 misses: 27 dense, 14 sparse, 13 chunk-boundary, and 8 OCR failures. Each group needed a different fix. Report the taxonomy in incident reviews so “retrieval is bad” becomes an owned engineering action.

Share a thought

Comments appear immediately. Email is optional and never shown.

Markdown & code fences supported
AUTH VIA: PUBLIC FORM

No comments yet. Be the first to share a thought.