Semantic Search
Semantic search retrieves items using learned representations of meaning or intent rather than relying only on exact keyword overlap.
Download Markdown (.md)Soroush’s Product Wiki · https://wiki.soroush.uk/topic/semantic-search/
01What it means
Semantic search represents queries and candidate content in a learned space and ranks items by estimated conceptual relevance. It can match paraphrases and related language that lexical search misses. Many systems combine semantic and keyword signals because semantic similarity does not replace exact names, identifiers, dates, filters, or access rules.[1][2]
- 01Prepare contentUnits, metadata, permissions
- 02EmbedLearned vector representations
- 03Represent querySame compatible space
- 04Retrieve candidatesSimilarity plus filters
- 05Rank + evaluateLexical, semantic, freshness, authority
Hybrid systems retain lexical signals for exact names, identifiers, dates, filters, and other cases semantic similarity does not replace.
02Why it matters
Users rarely know the exact vocabulary stored in a product. Semantic retrieval can improve discovery and support grounded AI answers, while hybrid ranking preserves precision for literal terms and structured constraints.
03When to use it
Use semantic search for natural-language queries, varied terminology, cross-lingual discovery, or retrieval-augmented generation when relevance can be evaluated. Keep lexical and structured search for identifiers, quoted phrases, exact compliance terms, and facets; combine methods when query intent varies.
04How it works
- Define search tasks, relevance judgments, important query groups, and permission boundaries.
- Prepare content units with useful metadata and create embeddings using a suitable model.
- Embed each query and retrieve nearby candidates, optionally applying metadata filters first.
- Combine semantic, lexical, freshness, authority, and business signals in ranking where justified.
- Evaluate ranking quality and zero-result, harmful, multilingual, and access-control cases using real queries.
05A practical example
A help center adds semantic retrieval so cancel my plan can find an article titled End a subscription. Exact search remains available for error codes, and the ranker boosts current official articles while excluding content outside the customer's product tier.
06Where it breaks
Semantic models may blur distinctions, overmatch broad concepts, and perform unevenly across languages or domains. Approximate indexes trade recall for speed, relevance labels are subjective, and embeddings do not enforce authorization. Hybrid systems add tuning and operational complexity.
Common mistakes
- Replacing keyword search entirely without testing exact-term and identifier queries.
- Chunking content mechanically so retrieved passages lack the context needed to answer.
- Applying access filters after retrieval or generation instead of before exposure.
- Judging quality from a few demos rather than a query set with graded relevance.
07Sources
- Semantic SearchSentence Transformers · Official documentationSemantic Search
- Dense Passage Retrieval for Open-Domain Question AnsweringAssociation for Computational Linguistics · Peer-reviewed researchDense Passage Retrieval for Open-Domain Question Answering