All posts

What is RAG?

In short

RAG lets an AI consult a library of documents before replying — without making it learn everything upfront.

Illustration: what is RAG

Picture a huge library.

It holds:

  • your company’s policies;
  • your procedures;
  • your manuals;
  • your contracts;
  • thousands of other documents.

You ask an AI:

“How many weeks of vacation am I entitled to after five years?”

The AI might try to answer from what it already knows.

But that’s probably not what you want.

You want it to check your company’s official policy.

That’s where RAG comes in.

📚 A librarian for your AI

RAG stands for Retrieval-Augmented Generation.

The name sounds complicated.

The idea isn’t.

Simply imagine that before answering, the AI asks a librarian:

“Find me the documents about vacation after five years.”

The librarian:

  • searches your library;
  • finds the relevant passages;
  • hands them to the AI.

And the AI uses that information to shape its answer.

🔎 How it works, in very simple terms

You ask your question:

“How many weeks of vacation am I entitled to after five years?”

Then:

Question → 🔎 Search → 📄 Right documents → 🤖 AI → Answer

So the AI doesn’t necessarily get the company’s thousands of documents.

It mainly gets the information that matters for that specific question.

🧩 But how does it find the right documents?

One common technique is called embedding.

It lets the system search for information that has a meaning similar to your question, even when the same words aren’t used.

👉 What is an embedding?

🧠 You don’t have to teach the AI all your documents

That’s an important distinction.

You might think you need to train an AI on every company document.

That’s not necessarily the case.

With RAG:

  • your documents stay in a knowledge source;
  • the system searches for what it needs;
  • it gives that to the AI when it’s time to answer.

If a policy changes, you can update the document.

On the next question, the system can find the new information and pass it to the AI.

🏠 It works with your own information too

The same idea can be used with a personal digital memory.

Imagine you’ve collected notes over several months while shopping for an e-bike.

You ask:

“Which e-bikes had I shortlisted, and why?”

The system:

  • searches your own notes;
  • finds the relevant passages;
  • gives them to the AI;
  • the AI prepares its answer.

Your digital memory becomes, in a sense, its library.

⚠️ RAG doesn’t make the AI infallible

If the librarian brings the wrong document, the AI may give a bad answer.

Search quality matters.

RAG helps the AI work with better information, but it doesn’t automatically guarantee that every answer will be correct.

🍳 The simple version

Just remember this:

RAG lets an AI consult a library before it answers.

That library can hold:

  • company documents;
  • procedures;
  • manuals;
  • a knowledge base;
  • your own notes;
  • your digital memory.

So the AI doesn’t need to know everything.

It mainly needs to find the right information at the right time. 📚🤖

To go further