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.
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
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
Embeddings
Semantic vector retrieval uses learned representations and similarity.
prerequisiteIngestion and Chunking
Search indexes require well formed retrievable units.
prerequisiteHybrid Search and Reranking
Hybrid and reranking stages operate on retrieval candidates.
alternativeHybrid Search and Reranking
Lexical semantic and combined retrieval trade precision recall and cost.
Primary sources
- Sentence-BERT Sentence Embeddings using Siamese BERT-Networks - arXiv, verified 2026-07-16
- pgvector Documentation - pgvector, verified 2026-07-16