Skip to content

RAG, retrieval-augmented generation

Adrià Castany 2 min

What is retrieval-augmented generation?

Retrieval-augmented generation, or RAG, is the technique of finding relevant information in your own sources and handing it to a language model so it writes the answer with that. The model does not memorize the content. It looks it up at answer time.

Also called

RAG

Stands for

Retrieval-Augmented Generation

Topic
AI in support
On this page
  1. RAG is not training a model
  2. Why it matters
  3. How it works, in four steps
  4. Why it searches by meaning, not words
  5. Where it fails
  6. What RAG does not solve
  7. How Intake handles it
  8. Frequently asked questions

RAG is not training a model

This is the most common confusion.

Training modifies the model with your data, costs a lot and freezes the knowledge at training time. RAG leaves the model untouched and passes it the relevant documents with every question. That is why, with RAG, fixing an article today changes the answer today.

Why it matters

It is what lets an AI system talk about your product without making it up.

It is also what makes your documentation the ceiling. The model cannot answer better than what is written, and if the wrong passage is retrieved the answer will be flawless and wrong.

How it works, in four steps

The first two happen once, when the content is prepared.

The last two repeat on every question.

  • The documentation is split into passages.
  • Each passage becomes a vector that represents its meaning, the embedding.
  • When a question arrives, the passages closest to it are retrieved.
  • Those passages go to the model, which writes the answer from them.

Why it searches by meaning, not words

Because customers do not use your words.

If your article says "retention policy" and the customer writes "how long do you keep my data", exact matching finds nothing. Vector search does, because it compares meanings.

Where it fails

In retrieval, nearly always, not in the writing.

If the wrong passage comes back, the model writes a convincing answer based on it. That is why most of the work of improving one of these systems goes into what gets retrieved.

What RAG does not solve

Data that lives in no document.

Which plan this customer is on, how much quota is left, whether the last payment went through. That is not retrieved from documentation, it is looked up in your system. It is the difference between a documentation chatbot and an agent.

How Intake handles it

Frequently asked questions

What does RAG stand for?

Retrieval-Augmented Generation. Finding relevant information in your own sources and passing it to the model so it writes with it.

Is RAG the same as fine-tuning a model on my data?

No. Fine-tuning changes the model and freezes what it knows; RAG leaves it untouched and looks documents up on every question. With RAG, updating an article changes the answer immediately.

Why does my RAG system answer incorrectly?

Almost always because it retrieves the wrong passage, not because the model writes badly. Looking at what was retrieved for the failed questions usually explains the whole problem.

What does RAG need in order to work well?

Documentation that is up to date, written in the customer’s words and with one topic per article. The model cannot answer better than what is written, so the quality of the content weighs more than the model chosen.

Glossary

Keep reading

Glossary

Related terms

See the full glossary

Add it without dropping what you use

15 minutes, no commitment