RAG: Retrieval-Augmented Generation

RAG lets AI answer using your own documents. Before answering, it searches your files for the most relevant pages, then writes the answer using those pages.

Everyday analogy

An open-book exam. Instead of answering from memory (and maybe guessing), the student first finds the right page in the book, then writes the answer.

Example

A company HR bot: you ask "How many sick days do I get?" It finds the leave policy, reads it, and answers "12 days per year", with a link to the policy.

QuestionSearchTop chunksLLMAnswerThe question travels: find the best passages in your documents, hand them to the LLM, get a grounded answer.
RAG in one picture: retrieve first, then generate.
1 · ASKYou ask a question
→
2 · SEARCHIt searches your documents for the best matches
→
3 · ADDThose pages are added to your question
→
4 · ANSWERThe LLM answers using them, often with sources

Why it matters: fewer hallucinations, up-to-date answers, and no need to retrain the model when documents change.

Try it yourself

About 15 min

Do RAG by hand

  1. Copy a public FAQ page (e.g. a bank's or airline's) into an AI chatbot.
  2. Ask: Using only the text above, answer: [your question]. Quote the line you used.
  3. Ask something not in the text and see if it admits it doesn't know.

What you should see: Answering from supplied text with quotes is the core idea of RAG.

Use any free AI chatbot (ChatGPT, Claude, Gemini or Copilot). Never paste private or confidential information.

Build it for real · guided projectBuild your own custom AI assistantAbout 60 min · No coding needed · step by step
Test what you learned

Take a quick quiz, or look up any word in the glossary.