TokenPad

RAG

Semantic search

Semantic search finds text by meaning rather than by keyword, by comparing embeddings instead of matching words.

It is what lets a query about "getting money back" retrieve a passage about refunds with no shared vocabulary. Keyword search would return nothing.

Its weakness is the mirror image: exact terms. Product codes, error identifiers and proper nouns are often retrieved better by keyword matching, which is why hybrid search exists.

In practice

Semantic search finds "how do I cancel" when the document says "terminating your subscription", which is exactly what keyword search cannot do. It also confidently returns near-misses for exact identifiers, which is exactly what keyword search does best. Systems that run both and merge the results fail in neither direction.

Common questions

When does semantic search beat keyword search?

On paraphrase. It finds "how do I cancel" when the document says "terminating your subscription", which keyword matching cannot do. It loses on exact identifiers, which keyword matching does best.

Should I replace keyword search with semantic search?

No — run both and merge. Real queries contain both a paraphrased complaint and an exact code, and no single retrieval method handles both well.

Measure it

More in RAG