L025 · Under the hood · 2 min

RAG: give AI your documents

RAG lets a chatbot look up the right pages in your own documents before it answers, so it can use facts it was never trained on.

01 · The idea

A model only knows its training data. It does not know your company handbook, your school's rules or last week's prices.

Retrieval-augmented generation, or RAG, fixes this in two steps. First, it searches your documents for the most relevant passages, usually with embeddings stored in a vector database. Second, it gives those passages to the model with your question.

The model then answers using that text, and good systems show which document each answer came from. This reduces hallucination and keeps answers up to date.

You already use RAG when you upload a PDF to a chatbot, or use a company help bot. It is only as good as the documents it finds.

02 · Think of it like this

It is an open-book exam. Instead of answering from memory, the student first finds the right page, then writes the answer.

03 · Do it now

04 · Quick check

A company help bot gives an outdated answer. What is the most likely cause in a RAG system?