All posts

What is an embedding?

In short

An embedding turns information into numbers so a computer can compare meaning — even when the words differ.

Illustration: what is an embedding

In the article on RAG, we compared that system to a library.

You ask a question.

A librarian looks for relevant information.

Then they pass it to the AI so it can answer.

But one important question remains:

How does the librarian know which documents to look for?

That’s where embeddings become interesting.

👉 What is RAG?

🔎 Search for meaning, not just words

Imagine you ask:

“How much vacation do I get after five years?”

In the official document, it might say:

“Employees with five years of seniority are entitled to four weeks of annual leave.”

The two sentences use almost none of the same words.

Yet we immediately understand they’re about the same thing.

A system based only on keywords might struggle more.

Embeddings let the computer search for information based on meaning and closeness.

🧩 But what is it exactly?

An embedding is a way to turn information into a mathematical representation.

That information can be:

  • a word;
  • a sentence;
  • a paragraph;
  • a document;
  • sometimes even an image.

Essentially, the computer turns that information into a series of numbers.

It can then compare those numbers to see which pieces of information are alike.

🗺️ Picture a huge map

To keep it simple, imagine the AI placing all your information on a huge map.

On that map:

  • 🐶 dog would sit near puppy;
  • 🚲 e-bike would sit near battery, motor, and range;
  • 🏖️ vacation would sit near annual leave and days off.

The words aren’t necessarily identical.

But their meaning is close.

Embeddings let the computer represent that closeness.

📚 Back to our library

You ask:

“How much vacation do I get after five years?”

The system can turn your question into an embedding.

The information in your library has been represented that way too.

The system can then ask:

“Which information is closest in meaning to this question?”

It can find a passage that talks about:

“five years of seniority”

and:

“four weeks of annual leave”

Even if you didn’t use exactly those words.

🔗 Embedding + RAG

This is where the two ideas meet.

In a RAG system, you might have:

Question → 🧩 Embedding → 🔎 Search → 📄 Relevant information → 🤖 AI → Answer

Back to our library:

RAG lets the AI consult the library.

And:

Embeddings can help the librarian find the right information.

The two concepts are related, but they’re not the same thing.

  • Embedding: helps represent and compare information.
  • RAG: finds relevant information and gives it to the AI.
  • AI: uses that information to shape its answer.

🏠 And in a digital memory?

Imagine hundreds or thousands of notes collected over several years.

You ask:

“What had I noted for my future e-bike?”

You don’t need to know:

  • the file name;
  • the folder;
  • the date;
  • the exact words you used in your notes.

The system can search for information whose meaning is close to your question.

So you go from:

“Where did I file this information?”

to:

“Here’s what I’m looking for. Find it for me.”

⚠️ It’s not magic

Embeddings don’t understand the world exactly like a human.

They mathematically represent similarities learned by a model.

Two pieces of information can look close to the system without necessarily being the right answer.

🍳 The simple version

You don’t need to understand the math behind embeddings.

Just remember this:

An embedding turns information into numbers so a computer can compare its meaning with other information.

In very simple terms:

Different words + same idea → the computer can still make the connection. 🧩

And when you combine it all:

🧩 Embedding → helps find

📚 RAG → brings the right information to the AI

🤖 AI → uses that information to answer

👉 What is RAG?

To go further