Equation 18 · Building Production RAG: An Advanced Technical Guide
What does this equation mean?
Read the formula alongside the article passage below. Each part has a deeper page with its role in the equation, the supporting passage and nearby citations.
This mathematical expression combines the displayed quantities; its precise role follows from the surrounding article text. Read the equation part by part below; each part has a contextual explanation and a link to its mathematical background.
Read it piece by piece
Symbol k
k is a part of this expression. Its role is fixed by the surrounding article and by the operations shown in the formula.
How to interpret it
Read this expression with the definitions, units, and assumptions supplied by the article.
What the article says around this equation
The second, less discussed failure mode is architectural rather than a missing check: whether filtering happens before or after the candidate set is fixed. A system that retrieves its top- k candidates first and then discards the ones the caller is not permitted to see can silently return fewer than k usable results — or, in the worst case, zero — without any error being raised, because nothing in that architecture treats “permitted candidate count fell below what the caller expected” as a condition worth surfacing. Filtering that runs as part of the retrieval call itself, constraining which vectors are even compared rather than pruning the result afterward, avoids the silent shortfall but…
Read the full surrounding passage
The second, less discussed failure mode is architectural rather than a missing check: whether filtering happens before or after the candidate set is fixed. A system that retrieves its top- k candidates first and then discards the ones the caller is not permitted to see can silently return fewer than k usable results — or, in the worst case, zero — without any error being raised, because nothing in that architecture treats “permitted candidate count fell below what the caller expected” as a condition worth surfacing. Filtering that runs as part of the retrieval call itself, constraining which vectors are even compared rather than pruning the result afterward, avoids the silent shortfall but requires that the index and the access-control model be designed together rather than bolted on afterward. Which architecture a given vector database supports is a real, load-bearing question to ask before committing to it, not a detail to discover during an incident.
Sources cited in the article section
These citations give research context. Read each source to check which claims it supports.
Return to Building Production RAG: An Advanced Technical Guide