Semantic search

Semantic search finds results by meaning rather than by matching words. Query and documents are turned into embeddings, and the closest vectors are returned — so "how do I cancel" can find a passage about ending a subscription.

Also called: vector search, dense retrieval · Reviewed

How does it work?

Every document is converted to an embedding ahead of time and stored. At query time the query is embedded the same way, and the system returns the stored vectors closest to it. Closeness in that space corresponds to similarity in meaning, because that is what the embedding model was trained to produce.

Keyword search does something fundamentally different: it looks for the actual words, weighted by how rare they are. It has no notion that "cancel" and "terminate" are related, and no notion that they are not.

Why does it matter?

It removes the requirement that a user guess the vocabulary of the document. People ask questions in their own words, describe symptoms rather than causes, and use the wrong term for things — all of which defeat keyword search and none of which defeat semantic search.

It is also what makes retrieval-augmented generation work. A user asks a question in natural language and relevant passages come back without anyone writing a query.

What do people get wrong?

Expecting it to handle exact matches. Order numbers, product codes, error strings, surnames and version numbers are precisely where meaning-based matching is weakest — an embedding of an error code is not meaningfully close to that same code. Keyword search is better at this and always will be.

The fix is not to choose. Hybrid search runs both and combines the rankings, which is what most systems that work well in production actually do. Treating semantic search as a replacement rather than an addition is the common and expensive mistake.

Learning this properly is easier with other people.

OneShopAI is where students, developers and founders work through this material together — sessions, builds and people who answer questions.