Semantic search
Semantic search retrieves documents based on meaning rather than keyword overlap — using embedding vectors and similarity scoring to match queries to documents that express the same concept in different words. 'how do I fix a slow Postgres query' matches a document titled 'optimising database performance' even with no keyword overlap.
Semantic search complements (rather than replaces) keyword search. Hybrid approaches — keyword search for exact-match queries, semantic search for natural-language queries, with BM25-style re-ranking — outperform either alone. The implementation is straightforward with modern tooling: embed the corpus once, embed queries at runtime, retrieve nearest vectors. The hard parts are scale (vector databases for large corpora), freshness (re-embedding when documents change), and relevance tuning (most production setups need re-ranking on top of pure vector similarity). Semantic search has become the default retrieval mode for documentation sites, support knowledge bases, and most RAG implementations.
Related terms
- Embedding vector
An embedding vector is a numerical representation of a piece of content (text, image, audio) as a fixed-length vector — typically 384 to 3072 dimensions — produced by a neural network trained so that semantically similar inputs produce vectors close to each other in the embedding space.
- Vector database
A vector database stores embedding vectors and supports fast approximate-nearest-neighbour search at scale — answering 'find the K vectors most similar to this query vector' in milliseconds across millions or billions of vectors.
- Retrieval-augmented generation (RAG)
Retrieval-augmented generation is the pattern where an LLM is given relevant context retrieved from an external source — typically via semantic search over a vector database — before generating its response.