AI Explained

Why Semantic Search Misses Exact Words

Aditya Kumar JhaAditya Kumar JhaLinkedIn·June 18, 2026·11 min read

Semantic search retrieves by meaning, so exact error codes, SKUs and IDs vanish. Here is why, and how hybrid search fixes it.

Semantic search misses exact words because it retrieves by meaning, not by spelling. When you search for an error code like E-4302, a part number like WH-1000XM5, or a rare function name, the search engine converts your query into a list of numbers that represent its general topic, then hunts for documents whose numbers sit nearby. A string of digits carries almost no meaning, so the document holding the exact answer can land far away in that mathematical space even though the words match perfectly. The fix is hybrid search: run a keyword engine alongside the meaning engine and merge their results so any document containing the exact term is guaranteed a seat at the table.

You typed the answer verbatim, and the system still returns something else. This is a frequent, confusing failure when people search their own notes, documents, or chat history through an AI tool. The rest of this guide explains the geometry of why it happens in plain language, then shows the two-engine fix that the best production search systems now ship by default.

How semantic search actually finds things

Semantic search turns every document and every query into an embedding, which is a long list of numbers that encodes meaning. Two passages about cancelling a subscription land close together in this space even if one says cancel membership and the other says terminate my plan. That is the whole point: you can ask a question in your own words and still find a document that phrased the answer differently. This is genuinely useful, and it is why meaning-based retrieval took over so quickly.

The catch is that an embedding only captures what the model learned to recognize as meaning. Topics, intent, and the relationships between words the model saw during training decide a document's position in this space. Anything the model treats as low-signal noise gets compressed away. For most prose that compression is fine. For a precise string the model has barely seen, it is fatal.

Why semantic search misses an exact phrase: the geometry

An exact identifier vanishes because the embedding model has almost no idea what it means, so it cannot place it anywhere useful. Embedding models train on huge amounts of text, and they learn rich positions for common words and phrases. A token they rarely encountered is different. A SKU, a court case number, an internal ticket ID, a niche library function: each is effectively unseen. The model splits it into subword fragments it has no strong signal for, then folds the whole thing into a generic, low-information region of the space.

Picture the consequence. You search for the error code E-4302. The document that contains E-4302 also contains a paragraph about, say, billing failures. The embedding for that whole chunk is dominated by the billing topic, because that is what carries meaning the model understands. The five characters of the code barely nudge the position. Now your query, which is mostly just the code, lands in some bland default region, while the answer document sits over in the billing neighbourhood. Close in spelling, far apart in the math. The retriever ranks other, more topically similar chunks above the one you actually need.

Insight

The core problem: meaning-based search rewards topical similarity. Your exact answer can rank below documents that merely sound related to your question.

The vocabulary mismatch problem, in reverse

Information retrieval researchers have a name for the opposite failure: vocabulary mismatch. You say cancel membership; the document says terminate subscription; zero shared words. Keyword-only search fails here because it sees no overlap. This is exactly the gap semantic search was built to close, since a meaning engine puts those two phrasings near each other even though they share no tokens. So you have two failure modes that mirror each other. Pure keyword search breaks on synonyms and paraphrase. Pure meaning search breaks on rare exact tokens. Neither engine alone covers both.

BM25: the precision safety net

The fix is not a newer, smarter embedding model. It is a keyword algorithm older than the problem. BM25 is the standard keyword ranking function, and it is the missing half. It scores a document by how well the literal query terms appear in it, weighing how often each term shows up, how rare that term is across the whole collection, and how long the document is. If you search for E-4302 and exactly one document contains that string, BM25 scores that document highly and everything else near zero. It does not care about meaning at all, which is precisely why it never loses an exact match.

BM25 is not new or experimental. It grew out of the probabilistic retrieval framework developed through the 1970s and 1980s by Stephen Robertson, Karen Sparck Jones, and colleagues, and it takes its name from the Okapi system built at City University in London in the 1980s and 1990s. The BM stands for best matching. It has been the workhorse of keyword search for decades because it is fast, predictable, and excellent at the one thing embeddings are worst at: matching the exact word.

Pro Tip

What most guides will not tell you: if your search problem is mostly codes, names, IDs, or quoted phrases, BM25 alone often beats a fancy embedding model. Embeddings find what you mean. BM25 finds what you typed. Exact-match retrieval is a solved problem; it just is not the problem embeddings solve.

Hybrid search: run both engines, then merge

Hybrid search runs BM25 keyword retrieval and vector retrieval in parallel, then fuses their two ranked lists into one. The keyword leg guarantees that any document containing your exact term enters the candidate set. The vector leg guarantees that documents matching your intent enter too, even when they used different words. Because the two engines fail in opposite situations, combining them covers far more queries than either could alone.

You are not picking a winner. You are stapling a precision tool to a recall tool so that a rare string and a paraphrased question both find their target.

Reciprocal Rank Fusion: how the two lists combine

The common way to merge the two lists is Reciprocal Rank Fusion, or RRF. It sidesteps an annoying problem: BM25 scores and vector similarity scores live on totally different scales, so you cannot just add them. RRF ignores the raw scores entirely and looks only at rank position. Each document gets a score of 1 divided by (rank plus a small constant k) in each list, and those reciprocal scores are summed across both lists. A common default for k is 60.

The effect is simple and powerful. A document ranked first by either engine earns a big contribution. A document that both engines rank highly rises to the top. Crucially, a document that the keyword engine ranks first because it contains your exact code gets a strong reciprocal score even if the vector engine buried it. The exact-match document is no longer hostage to the geometry that lost it. It re-enters the top results through the keyword leg, and RRF carries it forward.

Query typeVector / semantic searchBM25 / keyword search
Paraphrased question (different words)Strong: finds matching meaningWeak: needs shared words
Exact error code or SKUWeak: rare token, low signalStrong: exact match wins
Rare proper name or IDOften missesReliable hit
Conceptual or fuzzy intentStrongLimited
Quoted exact phraseInconsistentPrecise

What this means for searching your own notes

If you keep personal notes, receipts, screenshots, or saved messages, you hit both failure modes constantly. You search for a flight confirmation code and get nothing, because that code is a rare token to any embedding model. You search for what did the plumber quote and the note that says estimate from the contractor stays hidden from a keyword-only tool. A search layer that only does one of the two will feel broken in exactly the cases you care about most: the precise fact you know you wrote down.

  • Reference numbers: order IDs, ticket numbers, confirmation codes, case numbers.
  • Product and part identifiers: SKUs, model numbers, serial numbers.
  • Names that are rare: a niche vendor, a small clinic, an obscure street.
  • Technical strings: error codes, function names, file paths, API keys you noted.
  • Exact quoted phrases you remember word for word but not the surrounding topic.

You can test any tool in under a minute. First, search for a code or ID you know is stored word for word. Then search the same item by a paraphrase of what it is about. If the exact code misses but the paraphrase hits, you are looking at meaning-only retrieval, and the failure is not a bug in your notes or a sign the data is gone. It is the predictable geometry described above.

How MemX handles the exact-keyword problem

MemX is a consumer AI memory app that acts as an external memory layer over your own documents, photos, notes, and messages across Android, iOS, and WhatsApp. The exact-keyword miss is the precise problem a personal memory tool has to get right, because the whole reason you saved something is usually a specific fact: a code, an amount, a name. When you go back to your own content, what you need is the thing you wrote down, not something that merely sounds related to it.

On privacy, MemX is private by architecture: per-user keys, encryption at rest, and an on-device first pass over your content. That is a design stance about how your data is isolated and processed, not a claim of end-to-end encryption or zero-knowledge. The point for search is that good retrieval and sensible data handling are not in tension; you can have a system that reliably surfaces an exact reference without treating your notes carelessly.

Insight

Rule of thumb: if your search tool ever fails to find an exact phrase you know is stored, it is probably running meaning-only retrieval. A hybrid system with a keyword leg is what guarantees the exact-match document gets considered.

Frequently Asked Questions
01Why does semantic search miss exact keyword matches?

Because it retrieves by meaning, not spelling. Rare strings like codes and IDs carry little topical signal, so the embedding model places them in a generic region and ranks topically similar documents above the one holding your exact term.

02What is hybrid search in simple terms?

Hybrid search runs two engines at once: a keyword engine (BM25) that matches exact words, and a vector engine that matches meaning. It then merges both ranked lists into one, so exact terms and paraphrased questions both find their target.

03What is BM25 and why does it matter?

BM25 is the standard keyword ranking function. It scores documents by how well your literal query terms appear, weighted by term rarity and document length. It reliably surfaces exact codes, names, and IDs that embeddings tend to lose.

04What is reciprocal rank fusion?

Reciprocal Rank Fusion (RRF) merges two ranked lists by position rather than raw score. Each document scores 1 divided by (rank plus a constant, commonly 60) in each list, and the scores are summed. It avoids mismatched score scales between BM25 and vectors.

05Can vector search find product codes or error codes?

Often not reliably. Product codes and error codes are rare tokens with weak semantic signal, so a vector model struggles to place them. A keyword leg like BM25 is what guarantees those exact-match documents are retrieved.

Read Next

Or try MemX to access 40+ AI models in one place — including Claude Sonnet 4.6 and GPT-5.4 — and get your questions answered today.

Was this article helpful?

Found this useful? Share it with someone who needs it.

Free · iOS, Android & WhatsApp

Stop losing what you save.
Let MemX remember it for you.

Every screenshot, photo, PDF and voice note — captured, encrypted, and instantly searchable. Ask in plain English, get the answer in seconds.

  • Reads text inside images and handwriting
  • Private and encrypted by default
  • Free to start, no credit card

Takes under a minute to set up. Your data stays yours.

Aditya Kumar Jha
Written by
Aditya Kumar JhaLinkedIn

Core software engineer at MemX, where he builds the website, backend, and data systems. Also a published author of six books on Amazon KDP, writing on AI, memory, and behavior.

Keep reading

More guides for AI-powered students.