Vector embeddings are lists of numbers that an AI model produces to capture the meaning of a piece of text, an image or a product, so that things with similar meanings get similar numbers. A list of numbers like this is called a vector, and turning something into one is called embedding it. A typical embedding has a few hundred to a few thousand numbers. No single number means anything that a person could name. What matters is how close two lists are to each other.
Here is how it works in general. An embedding model is an AI model trained on huge amounts of text or images. It reads an item and outputs its vector. Items with similar meanings come out close together. "Cheap flights to Goa" and "low-cost air tickets to Goa" get nearby vectors, though they share few words. A photo of a red cotton kurta lands near the photos of other red kurtas. To search, the system first embeds every document or product and stores the vectors, usually in a vector database. When a question or a photo arrives, it is embedded too. The system then finds the stored vectors closest to it, measured by a formula such as the angle between two vectors, and returns those items.
Why use them? A keyword search matches words exactly. It misses a passage that says "loan repayment" when the user typed "EMI", and it cannot search with a photo at all. Embeddings match meaning, across different words, different languages and even pictures.
Take, for example, retrieval-augmented generation. A bank's assistant embeds the customer's question, finds the closest passages in the bank's policy documents, and gives them to a large language model to answer from.
Consider visual search on a furniture shop's app. A shopper photographs a chair in a café, and the app shows the chairs in its catalogue whose image vectors are closest to that photo.
Say an engineer types "stainless steel bolt for a pump, M8, 40 mm". Industrial product search embeds the description to find bolts of that kind, even where the catalogue uses other words, and then filters them by the exact size.
How are embeddings different from keyword search? Keyword search, which most enterprise search was first built on, looks words up in an index and ranks the documents that contain them. Embeddings find meaning without shared words. But they can also return something close in meaning that is still wrong, such as a bolt of the wrong size. So many systems use both, and combine the results. Embeddings are also not the model itself: an embedding model produces them, and a database stores and searches them.
Appears in
- Graph database↗ Data engineeringSome graph databases store a vector beside each record, so a search by meaning can then follow the record's links.
- Multi-model database↗ Data engineeringA multi-model database stores AI vectors in the same database as documents, graphs and sensor readings.
- Retrieval-augmented generation (RAG)↗ Generative AI applicationsRAG turns each question into a vector and fetches the company passages whose vectors are closest to it.
- Vector database↗ Generative AI applicationsA vector database stores embeddings, and finds the ones closest to a new query's vector in milliseconds.
- Visual search↗ E-commerce marketplacesVisual search turns the shopper's photo into a vector, and shows the products whose image vectors are closest.
- E-commerce search and recommendations↗ D2C e-commerceE-commerce search turns the shopper's words and every product into vectors, so 'party wear' finds dresses never tagged that way.
- Industrial product search↗ B2B e-commerceIndustrial product search turns an engineer's description into a vector to find matching parts, even when the catalogue uses other words.