GuidesUnderstanding AI
Embeddings explained simply
The principle
An embedding model reads a text and returns a vector: a few hundred to a few thousand numbers. No single number means anything. Together, they place the text in a space where distance measures difference in meaning.
- A textA product page, a paragraph, a question.
- The modelIt returns a vector.
- The comparisonA similarity score, often cosine.
- The nearestTexts with a close meaning.
What it is for
- Semantic searchFind an answer even when it is phrased differently.
- RAGRetrieve the useful passages before answering. See RAG.
- RecommendationSuggest similar products or articles.
- ClassificationSort tickets or reviews by topic, without written rules.
Rules to know
- One model for documents and questions.
- Split long texts: one vector summarises ten pages badly.
- Keep the original text next to the vector, so you can cite it.
Vectors are stored in a vector database.
Frequently asked questions
- How is it different from keyword search?
- Keyword search finds “running sneaker” only if those words are written. Embeddings also bring it close to “trail shoe”.
- Can two embedding models be mixed?
- No. Documents and questions must go through the same model. Changing model means recomputing everything.
- Is it expensive?
- Computing embeddings usually costs far less than generating text. The heaviest item is often storage and keeping it up to date.