L

Learn AI

Track progress · learn offline

Open

Lesson 5 of 7

Semantic vs hybrid search

6 min read

A user searches for the error code "E-4021". Your slick semantic search returns three passages about errors — and not the one page that actually mentions E-4021. What went wrong?

Where semantic search slips

Semantic search — matching by embedding nearness — is what makes RAG feel smart: it finds meaning, not just words. But it can fumble the literal: exact codes, product names, IDs, rare acronyms. "E-4021" has almost no meaning to embed, so it drifts toward passages that are merely about errors.

Semantic search matches meaning — brilliant for phrasing, weak on exact tokens like codes, IDs, and rare names.

Hybrid: meaning plus keywords

Hybrid search runs both: semantic search for meaning and classic keyword search for exact terms, then blends the two rankings. The keyword half nails "E-4021"; the semantic half catches "how do I stop it crashing". Together they cover each other's blind spots — which is why most production RAG uses hybrid, not pure semantic.

Hybrid search blends semantic and keyword ranking, so you catch both meaning and exact terms.

A common next step is to retrieve a wider set with hybrid search, then rerank the top candidates with a stronger model before handing the best few to the generator.

The shape of it

Users search your docs with both plain questions and exact function names like `parseConfig()`. Which retrieval setup serves both best?

Continue in the app

Take the whole RAG & Search course — tracked

Get your personalized path, progress and streaks in the app — this lesson and every next one, in order.