Tech, ExplainedData platforms and AI
Concept

Vector embeddings

Meaning turned into numbers.

HOW IT WORKSAn embedding modelreads each document,image or productIt turns each oneinto a vector: alist of numbersThe vectors arestored, usually in avector databaseA new question orphoto is turned into avector tooThe closest storedvectors are found, andtheir items returnedThings with similar meanings get similar numbers, soa computer can search by meaning, not by exact words.HOW IT WORKSAn embeddingmodelreads eachdocument,imageor productIt turnseach one intoa vector:a listof numbersThe vectorsare stored,usually in avectordatabaseA newquestion orphoto isturned into avector tooThe closeststoredvectors arefound, andtheir itemsreturnedThings with similar meanings get similar numbers, soa computer can search by meaning, not by exact words.HOW IT WORKSAn embedding model reads each document,image or product↓It turns each one into a vector: a listof numbers↓The vectors are stored, usually in avector database↓A new question or photo is turned into avector too↓The closest stored vectors are found, andtheir items returnedThings with similar meanings get similar numbers, so acomputer can search by meaning, not by exact words.
An embedding model turns each document, image or product into a list of numbers, the lists are stored, and a new question is turned into a list too so the closest stored items can be found.
opens a page inside this one a page in the same scene a page in another scene a concept page a label only, with no page

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

Data platforms and AI
E-commerce, travel and logistics
Tech, Explained is a part of ingrid.fyi. Every page explains one piece of technology in plain words.