Embedding
In one sentence An embedding is a list of numbers representing a piece of text, an image or an item, arranged so that similar things land close together.
Updated
An embedding is a list of numbers that stands in for a piece of text, an image or a product, positioned so that similar things end up near each other.
Think of seating guests at a wedding. You do not seat people randomly. Cousins from your mother's side go together, colleagues go together, and the two people who both love cricket end up at the same table. Anyone walking in can guess a stranger's connection to the family from where they are sitting. An embedding does this with meaning: every item gets a seat in a space with hundreds of dimensions, and distance means similarity.
The numbers themselves are unreadable — a typical text embedding is 384, 768 or 1,536 values, and no single value means anything on its own. What matters is that the model producing them was trained so that related inputs land close.
Why that is useful
"how do I reset my password" ┐
"I forgot my login details" ├─ these three sit close together
"cannot sign in to my account" ┘
"what is your refund policy" ── this one sits far awayKeyword search fails on that group, because not one word is shared between the first and third line. Embedding search finds them instantly, which is why embeddings sit under semantic search, recommendations, duplicate detection, clustering, and the retrieval step in RAG. The famous word-vector trick — king minus man plus woman lands near queen — holds roughly rather than perfectly, but it captures the right intuition: direction in this space carries meaning.
Two practical notes. Comparison is normally done with cosine similarity, which cares about direction rather than length. And embeddings from different models are not interchangeable — if you change the embedding model, you must rebuild the whole index.
Where to go next
- Full lesson: Embeddings
- Related terms: vector-database, rag, token, attention