Semantic Search
Semantic Search: What is it?
In the context of modern AI, Search is the mechanism used to find relevant information to feed into an LLM. It goes beyond matching exact keywords (lexical search) to understanding the meaning behind the query (semantic search).
- Keyword Search: Matches specific words (e.g., “Python error”).
- Semantic Search: Matches the intent/concept using vector embeddings (e.g., “coding issue” matches “Python error” because they are conceptually close in vector space).
Why is it Important?
- The “R” in RAG: It is the foundational retrieval step. If you can’t find the right data, the LLM can’t answer correctly.
- Handling Ambiguity: Humans ask questions vaguely. Semantic search bridges the gap between how we speak and how data is written.
- Hybrid Approach: Modern systems use Hybrid Search (Keyword + Semantic) to get the best of both worlds (exact matches for part numbers, concept matches for descriptions).
Technical View
The core component is the Embedding Model which turns text into numbers (vectors).