StudyVisuallyStart studying
Part 05 · Embeddings + RAG · Card 3 of 14

Semantic search

Search by meaning instead of exact words. It finds "rollback steps" when you asked about reverting a deploy.

Last updated

Analogy

Keyword search is WHERE text LIKE '%rollback%'. Semantic search is "find rows that mean the same thing", even if the word never appears.

In an agent

It lets an agent find relevant docs even when the user phrases things differently from the docs.

Practice

Flashcards

  • Interview: four uses for embeddings?Semantic search, RAG, deduplication and clustering.

Interview questions

  • What are embeddings?
    • Vectors that represent meaning.
    • Similar meanings give nearby vectors, measured with cosine similarity.
    • They power semantic search, RAG, deduplication and clustering.

Questions people ask

What is the difference between semantic search and keyword search?

Keyword search matches exact words, like a SQL LIKE query. Semantic search matches meaning by comparing embeddings, so a question about reverting a deploy can find a page titled rollback steps even though the word revert never appears. Semantic search is better for questions; keyword search is better for exact IDs.

Why do agents need semantic search?

Users rarely phrase questions the way the docs are written. Semantic search lets an agent find the right page anyway, by meaning. It is the retrieval half of RAG, and it is usually exposed to the agent as a search tool it can call whenever it needs facts from your documents.