Definition

Dense retrieval selects candidate items by comparing learned dense vector representations of queries and stored content. Stored passages are typically encoded ahead of time. At query time, an encoder maps the query into a compatible vector space. The retriever scores the vectors, often with a dot product or cosine similarity, and returns the highest-ranked passages. Dense vectors typically have values in most dimensions, unlike sparse representations where only a small subset is active.

Vector search finds vectors using a chosen similarity or distance measure. Dense retrieval is a retrieval approach that uses learned dense representations to decide which items to return. A vector search system can perform that comparison, but the search operation alone does not tell you how the vectors were produced or whether they are useful for the task.

Simple example

A support assistant has indexed passages from its .NET operations guide. Someone asks, “How can I stop a background worker cleanly?” The query encoder produces a vector. The retriever compares it with the indexed passage vectors and may rank a passage about BackgroundService.StopAsync and cancellation highly, even if the passage never says “cleanly”. The assistant passes the retrieved passage to the language model as context.

Why it matters

Queries and documentation often use different terms for the same thing. Dense retrieval can still find a useful passage. Results depend on the encoder and the indexed content. Query and passage encoders must produce compatible representations. In a RAG system, a relevant passage excluded from retrieval cannot contribute as retrieved context for that query.

One important nuance

Dense retrieval can be weak on exact identifiers. A query for an error code or configuration key may rank a broadly related explanation above the passage containing the precise string. Test those queries separately. Sparse retrieval can provide an additional signal when literal terms matter.