Embedding (vector embedding)
Also called vector embedding, text embedding.
A list of numbers that represents the meaning of a piece of text, an image or other data, so that similar items have similar numbers.
Last updated
What it is.
An embedding model reads an input and outputs a vector, a fixed-length list of numbers. Inputs with similar meaning get vectors that are close together, even when they use different words. Comparing vectors is how semantic search finds results that match what you meant rather than the exact words you typed.
Embeddings are created once per item, stored, and compared at query time. Vectors from different embedding models cannot be mixed: if you switch models, you have to embed everything again.
Why it matters
Embeddings power search, recommendations, duplicate detection, clustering and the retrieval step in RAG. They are cheap to create compared with chat calls, but large collections still need planning for storage, re-embedding and updates.
Common mistakes.
- 01
Mixing vectors from two embedding models in the same index.
- 02
Embedding whole long documents as one vector, which blurs their meaning. Embed sensible chunks.
- 03
Relying only on vectors for exact matches like product codes. Combine them with keyword search.
Work it out with a tool.
Related terms.
- Vector databaseA database built to store embeddings and quickly find the ones closest to a query vector.
- RAG (retrieval-augmented generation)A pattern that finds relevant passages from your own data and gives them to a language model along with the question, so it answers from your content.
- Token (LLM)The unit an AI language model reads and writes, and the unit most LLM APIs bill by.
- Inference (AI)Running a trained AI model on new input to get an output, such as an answer, a label or an embedding.
Guides and pages
Browse the full glossary or read answers to common questions.