The AI Handbook Open in the app →

Semantic Search

Retrieval & Data · Beginner · 4 min read

What is it?

Semantic search finds results by meaning rather than exact words, so a search for 'car' can also surface 'automobile' and 'vehicle'.

Explain like I'm 5

Keyword search matches the exact words you typed. Semantic search understands what you meant, so it finds the right thing even if you phrased it differently.

Why was it created?

Keyword search misses results that use different wording for the same idea. Semantic search was developed to match on meaning, using embeddings that place similar concepts close together.

Where is it used?

  • Document and knowledge-base search
  • Retrieval for RAG
  • Recommendations
  • Duplicate and similarity detection

Why should developers care?

It's the retrieval engine behind modern search, recommendations, and RAG systems, so it's core to building AI features over your own data.

How does it work?

Text is converted to embeddings — numeric vectors that capture meaning. Your query is embedded too, and the system returns the stored items whose vectors are closest to the query's, often using a vector database for speed.

Real-world example

A help center search for 'can't log in' returns an article titled 'Resolving sign-in problems' even though it shares no keywords.

Common use cases

  • Natural-language document search
  • Feeding relevant context to an LLM (RAG)
  • Similar-item recommendations
  • Clustering and deduplication

Advantages

  • Matches meaning, not just keywords
  • Handles synonyms and paraphrasing
  • Works across languages
  • Foundation for RAG

Disadvantages

  • Needs embeddings and a vector store
  • Can miss exact-match/keyword needs
  • Quality depends on the embedding model
  • Harder to explain why a result ranked

When should you use it?

When users phrase things differently than your content, or when you need meaning-based retrieval for an AI feature.

When should you avoid it?

When exact keyword, code, or identifier matching is what users need — plain keyword search can be better.

Alternatives

Keyword / full-text searchHybrid (keyword + semantic) searchManual tags and categories

Related terms

EmbeddingsVector DatabaseRetrieval-Augmented GenerationReranking

Interview questions

Beginner

  • How does semantic search differ from keyword search?
  • What does it match on instead of exact words?

Intermediate

  • What role do embeddings play in semantic search?
  • When would keyword search beat semantic search?

Senior

  • Why do production systems often use hybrid search?
  • How does a reranking step improve semantic search results?

Common misconceptions

  • "Semantic search replaces keyword search" — hybrid approaches often win in practice.
  • "It always understands intent perfectly" — quality is bounded by the embedding model.

Fun facts

  • Similarity is usually measured by cosine distance between vectors.
  • Combining keyword and semantic scores ('hybrid search') often beats either alone.

Timeline

  • 2013 — word2vec popularizes meaning-carrying embeddings
  • 2020s — Vector databases make semantic search mainstream

Learning resources

Quick summary

Semantic search retrieves by meaning using embeddings, so it finds relevant results even when the wording differs from the query.

Cheat sheet

  • Matches meaning, not exact words
  • Powered by embeddings + vector search
  • Backbone of RAG
  • Hybrid with keywords often best

If you remember only one thing

Semantic search finds results by meaning using embeddings, so 'can't log in' matches an article about sign-in problems.

Related tools

Further reading