Learning outcomes

  • Select similarity and index options
  • Use metadata filters
  • Measure retrieval recall

Mental model

Vector search embeds a query into the same representation space as indexed items, then retrieves nearby candidates under a chosen similarity and index strategy.

Query
Query embedding
Metadata filter
Nearest-neighbor index
Candidate passages

Theory

Exact nearest-neighbor search compares every vector; approximate indexes trade some recall for speed and memory. Metadata filters enforce scope and reduce candidates. Index parameters affect build time, query latency, and recall. A retrieval evaluation needs known relevant items, not merely appealing demo results.

Alternatives and trade-offs

Lexical search excels at exact terms, vector search captures semantic similarity, hybrid search combines them, and reranking applies a more expensive relevance model to a shortlist.

Failure modes and misconceptions

Do not treat distance as relevance certainty, omit access filters, change embedding models without reindexing, or tune only on a few hand-picked questions.

Knowledge check

Reflect before revealing the guide

What does an approximate index trade for lower query latency?

Decision scenario

A legal system filters by matter and permission before vector search, measures recall at k, and retains exact search for citations and case identifiers.

Relationships

Primary sources