Semantic Search
Searching for information based on deep meaning and context rather than exact keyword matches.
Definition
Semantic search is an information retrieval approach that finds results based on the meaning and intent behind a query rather than matching exact keywords. It works by converting both queries and documents into dense vector embeddings that encode semantic relationships, then finding the closest matches in embedding space using similarity metrics like cosine distance.
Key characteristics of semantic search include:
-
Meaning-Based Matching: A search for "how to fix a broken deployment" can surface documents about "troubleshooting failed releases" even if no keywords overlap, because the underlying concepts are semantically similar.
-
Embedding Models: Text is transformed into vectors using models like sentence-transformers, OpenAI's embedding models, or Cohere Embed. The quality of the embedding model directly determines search quality.
-
Cross-Lingual Capability: Multilingual embedding models enable searching across languages, returning relevant results regardless of whether the query and document share the same language.
-
Context Sensitivity: Unlike keyword search, semantic search considers the full context of a query, distinguishing between "Python the language" and "python the snake" based on surrounding terms.
Semantic search is the foundation of modern RAG systems and powers knowledge retrieval in AI assistants, enterprise search engines, and code search tools.