Semantic Search

Semantic search retrieves documents by meaning: a query and each passage are mapped to dense embeddings, then nearest neighbors are ranked by similarity (often cosine). Exact keyword overlap is optional, not required.

It shines on paraphrases (“heart attack” ↔ “myocardial infarction”) where classic keyword search fails. It struggles on rare IDs, exact quotes, and legal codes unless those strings appear in training or you add a sparse channel.

Typical stack

  1. Chunk and embed the corpus
  2. Index vectors in a vector database
  3. Embed the query and run ANN search
  4. Optionally rerank or fuse with BM25 (hybrid search)

Semantic search is the retrieval half of most RAG pipelines; quality tracks the embedding model, chunking, and filters more than the DB brand.

← Back to AI Glossary