An embedding is a list of numbers that represents the meaning of something, usually text. Things that mean similar things get similar lists.
That similarity is the whole point. Once meaning is a list of numbers, a computer can measure how close two ideas are by measuring the distance between them. Search stops depending on matching words.
Think of it like this. Think of placing every word on a giant map by meaning rather than spelling. Doctor and nurse land near each other. Doctor and doorknob land far apart. An embedding is just the coordinates.
How it works
- Text goes in, a vector comes out. A trained model converts your text into a fixed-length list of numbers.
- Meaning decides position. Training arranges the space so related ideas sit close together.
- Distance measures similarity. Cosine similarity is the usual metric.
- Length is fixed by the model. A few hundred to a few thousand numbers, always the same for a given model.
When to use it
- Semantic search. Find results that mean the same thing even when they share no words.
- Retrieval for RAG. Find the passages worth showing a language model.
- Recommendations. Surface items near something a user liked.
- Clustering and deduplication. Group similar content, or catch near-duplicates that are not exact matches.
Common mistakes
- "Embeddings store facts." They encode relationships. You cannot read a fact back out of one.
- "More dimensions is better." Larger vectors cost more to store and search, often for little gain.
- "You can read the dimensions." Individual numbers almost never map to anything a human would name.
- "Any model's embeddings work with any other's." They do not. Vectors are only comparable within the model that made them.