Skip to content
Back to glossary
AI

Embedding

An embedding turns text into a list of numbers in which texts with similar meaning sit close together. It is the basis of every semantic search.

An embedding turns a piece of text into a long list of numbers. The useful part: texts with similar meaning get similar number sequences. That makes meaning something you can calculate with, and every semantic search is built on it.

How does an embedding work?

A specialised model reads a text and returns a vector, typically a few hundred to a few thousand numbers. That vector is a position in a space with a great many dimensions.

What matters is how those positions are distributed. "Cancel an invoice" and "issue a credit note" land close together despite sharing no words. "Bank" as a financial institution and "bank" as a river's edge land far apart despite being the same word.

The similarity of two texts is then arithmetic on their vectors. That is how a vector database can find the relevant passages among millions without comparing a single keyword.

Why do embeddings matter?

Keyword search finds words. Type "notice period" and you find documents containing "notice period", while missing the one that says "termination of the contractual relationship". An embedding closes exactly that gap.

For you, the practical consequence is that search works even when people do not know the terminology your documents use. Customers ask in their own words and the system still finds the right passage.

Embeddings are also the foundation of RAG, and therefore of almost any application that connects a language model to your own content. Tasks such as sorting, grouping and duplicate detection can be solved with them too, with no language model involved at all.

What commonly goes wrong

The most frequent mistake is mixing models. Vectors from two different embedding models are not comparable. Switching models means recalculating the entire corpus, otherwise the search quietly returns nonsense.

The second is section size. An embedding describes a whole passage with a single vector. Put too much into one passage and the meaning blurs into an average that no longer matches any question properly.

Third: an embedding is not encryption. The original content can be partly reconstructed from a vector. A vector database holding your documents needs the same protection as the documents themselves.

Which model fits

Three criteria decide it in practice, and none of them is a position on a leaderboard.

Language. A model trained predominantly on English recognises German paraphrases less well. For German-language documents a multilingual model belongs in the shortlist, and the difference is larger for technical language than for everyday text.

Domain. If your corpus consists of standards, part numbers or legal text, evaluate candidates on exactly that material. A model that separates everyday language well can fail on article numbers, because those barely differ from each other.

Where it runs. An embedding model can often be self-hosted, even without substantial hardware. That is frequently the simplest way to keep documents out of external processing, see on-premise AI.

The test is cheap. Take thirty real questions where you know the correct source passage, and check how often the model puts that passage among the top results. That number settles the choice faster than any leaderboard comparison.