What is an embedding in AI?
A list of numbers that stands for the meaning of a piece of text, an image or other data. Things with similar meaning get similar numbers, so a computer can find them.
beginner · Also called Vector Embedding, Vector Representation
Computers are good at comparing numbers and bad at comparing meaning. "How do I reset my password?" and "I'm locked out of my account" share almost no words, yet they ask the same thing. An embedding is how a computer sees that.
An embedding model reads a piece of text and returns a long list of numbers. OpenAI's smaller embedding model returns 1,536 of them for each piece of text. Each list is a point in a space with that many directions. You cannot picture it, but the rule is simple: texts with similar meaning land close together.
A map of meaning
Think of a map where every sentence is a pin. Questions about passwords cluster in one corner, questions about refunds in another. "Locked out of my account" lands near "reset my password", far from "refund my order". Nobody drew that map by hand. The embedding model learned where to put things from the text it was trained on.
How close is close? Usually it is measured with cosine similarity, which compares the direction 2 lists point in. OpenAI recommends it, and notes that the choice of measure rarely matters much.
What people use them for
- Search by meaning. Find the help article that answers a question, even when the words differ.
- RAGRAGA way to answer from your own documents. A search finds the passages that match the question, and they are added to the prompt before the model writes.. Find the passages from your documents that a model should read before it answers.
- Grouping. Sort a large pile of support tickets or reviews into themes.
- Recommendations. "People who read this also read" by similarity of content.
- Odd ones out. Spot an entry that sits far from all the others.
Where they fall short
Embeddings capture what something is about, not its exact letters. A search for an error code such as "TS-999" may come back with other error codes that are "about" the same thing and miss the exact one. That is why good search systems combine embeddings with ordinary keyword search, as Anthropic does in its own retrieval setup.
Where they are kept
Once you have millions of these lists, you need somewhere to store them that can find the nearest ones fast. That is a vector databaseVector DatabaseA database built to store embeddings and quickly find the ones closest to a query, which is how AI apps search by meaning..
Sources
Where each fact comes from
This page was last checked against these sources on 14 October 2026.
- 1Vector embeddings
OpenAI API documentation · 14 October 2026
An embedding is a vector (list) of floating point numbers. The distance between 2 vectors measures their relatedness. Small distances suggest high relatedness and large distances low relatedness. Uses include search, clustering, recommendations, anomaly detection, diversity measurement and classification. By default text-embedding-3-small produces 1,536 numbers and text-embedding-3-large 3,072. Cosine similarity is recommended, and the choice of distance function typically does not matter much.
- 2Introducing Contextual Retrieval
Anthropic · 19 September 2024
In RAG, documents are split into chunks, an embedding model turns each chunk into a vector, and a vector database finds the chunks closest in meaning to the query. Embedding models can miss crucial exact matches. For the query "Error code TS-999" they may find content about error codes in general and miss the exact match, which keyword search (BM25) finds. The 2 result sets are combined.