What is semantic search?

Semantic search finds passages of text by their meaning rather than by exact words, so that a question worded differently can still be answered.

4 min read

When a visitor types "I'm moving house, what happens to my contract?", they use neither the word "termination" nor the word "transfer", which nevertheless appear in your terms. A classic keyword search finds nothing. Semantic search looks for the meaning of the question and finds the passages that discuss it, even when they are worded differently.

Keyword search compares the words of the question with those of the documents. It is fast, precise on exact terms and easy to explain: a document is found because it contains the word searched for. Classic search engines improve this principle with weighting methods such as BM25, which give more weight to rare words and to documents where they appear often.

Semantic search compares meaning. Each document passage and each question is turned into embeddings, series of numbers that represent their meaning. The system then finds the passages whose meaning is closest, even without a shared word.

SituationKeyword searchSemantic search
Synonyms ("rate" and "price")Often misses the passageFinds it
Question in everyday languageDepends on the words chosenWorks well
Exact reference, number, codeVery preciseLess reliable
Question in a different language from the documentFailsWorks with a multilingual model
Explaining the resultSimple: the word is thereHarder: the meaning is close

Why it is useful for an AI assistant

Visitors do not know your company's vocabulary. They write the way they speak, in their own words, sometimes with typos, sometimes in another language. Semantic search bridges that gap and lets the assistant find the right information in the knowledge base.

In assistants that work with RAG, it is the first step: finding the relevant passages, then passing them to the language model so it can write the answer. The passages are usually stored in a vector database, which makes this search fast even at large volume.

The two methods have complementary strengths. Many systems combine them: keyword search finds exact terms (a product name, a form number), semantic search finds different wordings. The results are then merged and ranked. This hybrid search usually gives better results than either method alone, especially in fields where technical vocabulary sits alongside everyday language.

  • Close does not mean correct. A passage about the guarantee on a new appliance will be close to a question about the guarantee on a repair, without applying to it. The model and its instructions must then check the scope
  • How documents are split matters. A passage that is too long mixes topics, one that is too short loses its context. Clear sections with an explicit heading improve the results
  • Numbers are poorly represented. "14-day period" and "30-day period" have very similar meanings for an embedding model, whereas the difference matters to the customer
  • The result is harder to explain. When a wrong passage comes up, it is harder to understand why than with a word-based search

These limits explain why search is never enough on its own: citing the source, the instruction to say "I don't know" and reviewing conversations remain necessary.

How to write documents that are easy to find

Whatever the search method, a few writing habits help the assistant:

  • An explicit heading for each section, using the words your customers would use: "Cancelling or transferring your contract when you move"
  • The subject repeated in important paragraphs, rather than a pronoun pointing back to a heading three paragraphs up
  • Common synonyms mentioned once: "the call-out rate (price)"
  • The terms in all three languages for key notions, if your audience is multilingual

And in KernChat?

KernChat does not use embedding-based semantic search at present. The sources of the knowledge spaces go into the model's context in full, and the model reads the documents itself and understands different wordings. When the sources exceed an assistant's size limit, a BM25-style keyword search ranks those that share the most words with the question so they go in first. For an SME's documentation, this approach avoids missed passages and keeps every rule in its full context.

To go further

Frequently asked questions

Does semantic search replace keyword search?
No, they complement each other. Keywords are more precise on exact terms, such as a reference or a number. Meaning works better on free wording. Hybrid search combines both.
How can I make my documents easier to find?
Give each section an explicit heading using your customers' words, repeat the subject in important paragraphs and mention common synonyms. These habits help whatever the search method.

See it on your own cases

Everything starts with a one-hour audit of your questions, your documents and your tools. Then we propose the level that fits.

Request a demo