Embedding
An embedding is a numerical representation of text, an image, or other content that places items with similar meaning close together, allowing software to compare them by meaning rather than by exact wording.
Embeddings are what make semantic search and retrieval-augmented generation possible: a question and a relevant passage end up near each other even when they share no keywords, so the right source can be retrieved without matching exact terms.
They are not a store of truth. An embedding captures similarity, so a retrieved passage may be topically close while still failing to support the specific claim being made — which is why retrieved sources still need checking.
How it works
An embedding model reads a piece of content and outputs a list of numbers, a vector, typically hundreds or thousands of values long. Content with similar meaning produces vectors that point in similar directions, so "how do I reset my password" and "forgot login details" land close together even though they share no words. Comparing two items then becomes a quick calculation of the distance between their vectors.
To search a collection, every document is embedded once and stored in a vector index; each new query is embedded and the nearest documents are returned.
Example
A help centre can embed each of its articles. When a customer types a question in their own words, the site retrieves the three closest articles by meaning, rather than failing because the customer did not use the exact keyword in the article title.
Common mistakes
- Embedding whole long documents as one vector, which blurs several topics into one average meaning.
- Mixing vectors from different embedding models in the same index.
- Treating the closest result as a correct answer rather than a candidate to check.