Skip to content
AI for Beginners

What are embeddings?

Intermediate4 min read

Embeddings turn text into coordinates, so that pieces of text with similar meanings end up sitting close together. In this guide you will learn what that means, why it is so useful, and how it quietly powers search and RAG.

New here? Before this guide, you might want to read What is RAG?.

In this guide, you will learn what embeddings are, using the picture of books on a shelf, and why they are the quiet engine behind search and RAG. Take this one gently; it rewards a second read.

The problem: computers do not read meaning

Computers are very good with numbers and, on their own, hopeless with meaning. To a plain search that only matches letters, “car” and “automobile” are completely different, and “the bank of a river” and “a bank account” look identical. The words on the page do not tell a computer what they actually mean.

What we would love is a way for a computer to tell that two pieces of text are about similar things, even when they share no words. That is exactly the problem embeddings solve.

The idea: turn meaning into coordinates

Think of a library where books are shelved by meaning rather than by title. Cookbooks sit together, travel guides sit together in another aisle, and a book that is a bit of both sits somewhere between the two. To find similar books, you would look at the nearby shelves.

An embedding does this for text. It converts a piece of text into a set of coordinates, a position in space, chosen so that text with similar meaning ends up nearby. “Car” and “automobile” land close together. “Banana” lands far away. The computer never understands meaning the way you do, but it can now measure it as distance, which is something it handles effortlessly.

These coordinates are not two or three numbers like a point on a map. An embedding often has hundreds of them, giving each piece of text a position in a space with far more directions than we can picture. That is impossible to visualise, so the shelf analogy is our stand-in: the key idea, that similar meanings sit near each other, holds true.

Why this is so useful

Once text lives as coordinates, a whole class of problems becomes easy. To find passages related to a question, you turn the question into an embedding too, then look for the text whose coordinates sit closest. Nearby means similar in meaning, so you get relevant results even when the wording is different.

This is what powers modern search that understands intent rather than matching exact words. It is also the retrieval half of Retrieval-Augmented Generation, the RAG approach from the previous guide. When a RAG system finds the right passages to hand the AI, it is comparing embeddings behind the scenes.

Where the coordinates live

All those coordinates have to be stored somewhere that can search through them quickly, even across millions of pieces of text. A store built specifically for this job, one that holds embeddings and finds the nearest ones in a flash, is called a vector database.

You do not need to run one to benefit from the idea, but it is worth knowing the name. When people describe how a company put its documents “into a vector database for search”, this is what they mean: every document turned into coordinates, ready to be matched by meaning.

Try it yourself

You cannot see the raw coordinates, but you can watch the underlying idea at work in any AI chat tool. Ask it to sort things by meaning:

Here is a list of words: salmon, guitar, trout, piano, mackerel, drums.
Group them by how similar in meaning they are, and briefly say what each
group has in common.

The tool will happily place the fish together and the instruments together. That sense of “these belong near each other, those belong far apart” is exactly the intuition embeddings capture, turned into numbers a computer can measure.

A helpful clarification

A common tangle is expecting an embedding to be a summary you could read back, like a short description of the text. It is not. It is a list of numbers with no words in it at all, and it is meaningful only by comparison: close to some things, far from others.

Think of it less as a description and more as a location. A location tells you nothing by itself, but the moment you compare it to other locations, distance becomes meaningful. That comparison is the whole point.

Next steps

You have now seen both halves of how tools like RAG work: embeddings to find the right material by meaning, and the model to write an answer from it. From here you might revisit the RAG guide with fresh eyes, or explore the wider Going Deeper topic to see how these pieces fit into the bigger picture of how AI is built.