Skip to content
Article Issue #5187

Semantic Search

What to know

Semantic Search is a search method that represents both the query and the document corpus as embedding vectors and retrieves documents whose vectors are nearest to the query vector in embedding space, capturing meaning rather than surface form; An embedding model converts the query into a vector at search time; Semantic search is foundational to any RAG-powered application and dramatically improves search UX compared to keyword-only approaches for knowledge base and documentation tools

Semantic Search, WikiWalls Glossary illustration

« Back to Glossary Index

Semantic Search is a search method that represents both the query and the document corpus as embedding vectors and retrieves documents whose vectors are nearest to the query vector in embedding space, capturing meaning rather than surface form. A query for ‘how to deploy a container’ will match documents about Kubernetes pod scheduling even if those documents never use the word ‘deploy.’

How it works

An embedding model converts the query into a vector at search time. The same model, or a compatible one, was used to embed all documents during indexing. A vector database performs approximate nearest-neighbor search to return the top-k document chunks with the highest cosine similarity to the query. Optional reranking with a cross-encoder model rescores and reorders the initial candidates for improved relevance.

Key facts

  • vs. keyword search: BM25 keyword search excels on exact terminology; semantic search excels on paraphrase and conceptual queries. Hybrid approaches often win.
  • Embedding alignment: Query and document embeddings must be produced by the same or compatible models to ensure vector space consistency.
  • Chunking matters: Retrieval quality depends heavily on how documents are split; overly large or small chunks degrade precision.
  • Latency: HNSW indexes return nearest neighbors in single-digit milliseconds even at million-scale corpora.

For builders

Semantic search is foundational to any RAG-powered application and dramatically improves search UX compared to keyword-only approaches for knowledge base and documentation tools. Combining semantic similarity with BM25 keyword scores in a hybrid retrieval step is now considered best practice, offering robustness across query types. Reranking the top 20-50 candidates with a cross-encoder before returning the final top-5 is a high-ROI quality improvement.

Sources

« Back to Definition Index
Administrator · 41 published guides · Joined 2016

Welcome to wikiwalls

The WikiWalls Journal · Free, weekly

One careful fix in your inbox each Wednesday.

No affiliate links inside the diagnosis. No sponsored "top 10". One careful fix per week — unsubscribe in one click.

No tracking pixels · No spam · Edited by a human.