Skip to content
// ai glossary

What is RAG in AI? Plain-English guide

A method where the AI first searches your documents for relevant information, then uses it to write the answer. Reduces made-up facts.

Quick example: A company chatbot that answers from the official policy documents.

Last reviewed

In plain English

RAG stands for retrieval-augmented generation. In plain terms: before the AI answers, it first looks up relevant information in a set of documents, then writes its answer using what it found. It is like an open-book exam instead of a closed-book one.

How it works

  1. You ask a question, such as "How many days of leave do new staff get?"
  2. The system searches your documents, such as the HR policy, for the most relevant passages. This often uses embeddings and a vector database to match meaning.
  3. It adds the passages to the prompt along with your question.
  4. The model writes an answer based on those passages, often with a link back to the source.

A simple example

A company builds a helper that answers staff questions from its own policy documents. Without RAG, a general chatbot would guess from what it learned in training, and could get the company's rules wrong. With RAG, it reads the relevant policy page first and answers from that.

Why it matters

  • Fresher and more specific answers, because the documents can be updated without retraining the model
  • Fewer made-up answers, because the AI is working from text in front of it. This reduces the risk. It does not remove it. See AI hallucinations.
  • A trail you can check, when the answer shows which passages it used

Where it can fail

  • The search misses the right passage, so the model answers from the wrong one or from memory.
  • The documents are wrong or out of date. The AI will repeat what it is given.
  • The answer drifts from the source. Check important claims against the cited passage.

Common mix-ups

  • RAG is not fine-tuning. RAG looks things up when you ask. Fine-tuning changes the model itself.
  • RAG is not a guarantee of accuracy. It improves the odds. People still need to check.
  • EmbeddingA list of numbers that represents the meaning of a piece of text, so a computer can compare meanings. Used in search and RAG.
  • Vector databaseA database that stores embeddings so you can quickly find text with similar meaning. Common in RAG apps.
  • Fine-tuningTraining an existing model a bit more on your own examples so it gets better at a specific task or style.

Keep reading