Embeddings
Turning words (or images, or anything) into lists of numbers, arranged so that similar meanings end up close together.
When not to use it
- Exact matching. If you need to find an invoice number, a SKU, or a legal citation, embeddings will helpfully return things that are similar — which is precisely wrong. Use exact or keyword search.
- Small collections. Under a few hundred documents, keyword search plus a decent ranking is faster to build, easier to debug, and often just as good.
- Anything where you must explain the match. "These vectors were close" is not an answer a compliance team will accept.
Reach for something else instead
- Keyword search (BM25) is still the strongest baseline for a huge share of real search problems, and it's transparent about why it matched.
- Hybrid search — keywords and embeddings together, results merged — beats either alone often enough that it's the sensible default for production retrieval.
- Fine-tuned classifiers are better than embedding similarity when your categories are fixed and you have labelled examples.
Read more on the blog
- What are embeddings? How AI turns meaning into numbersWhen a search returns the right result without sharing a single keyword, when a chatbot pulls the relevant document, when a store recommends something that just fits, the technology underneath is almost always embeddings. They rest on one powerful idea: turn meaning into geometry, so that similar things sit close together in space and similarity becomes something a computer can measure.
- Your RAG system isn't hallucinating. It never found the answer.When a RAG system gives a bad answer, almost everyone blames the model. Usually the right passage was never retrieved, and that changes everything about how you fix it.
- Why AI thinks hot and cold mean the same thingWord embeddings score "accept" and "reject" at 0.73 similarity. The reason is the idea embeddings are built on, and it explains why cosine similarity is a weaker signal than most systems treat it as.
- Does it understand? The argument, properly statedBoth sides of this debate are usually presented by their opponents. Here is the sceptical case at full strength, the case for at full strength, why the two keep missing each other, and what would actually settle it.
Embeddings place similar meanings near each other in space.
An embedding turns a word, sentence, or item into a vector positioned so that similar things sit close together. 'King' lands near 'queen,' 'dog' near 'puppy,' and the distances encode relationships. This geometry is what powers semantic search, recommendations, and the input to every language model.
Further reading
- Mikolov et al. (2013), Efficient Estimation of Word Representations in Vector Space — word2vec, and the origin of the king−man+woman analogy.
- Reimers & Gurevych (2019), Sentence-BERT — the shift from word vectors to sentence embeddings that made semantic search practical.
- Radford et al. (2021), Learning Transferable Visual Models From Natural Language Supervision — CLIP, the shared image-and-text embedding space.
Primary sources, listed so you can check the claims on this page rather than take them on trust.
Where people go wrong
- Mixing embedding models. Vectors from two different models live in incompatible spaces; comparing them produces confident nonsense. Documents and queries must use the same model.
- Embedding documents whole. A 40-page PDF becomes one blurry average of everything it says. Chunk into passages that each hold one idea.
- Treating cosine similarity as truth. It measures "these look related in this model's geometry," which is not the same as relevance to your user's actual question.
At a glance
Where this sits
6 concepts come first. Understanding it opens up 84 more.
Computed from the prerequisite graph, not assigned. How this works