AiBuzz

AI news, models and research, decoded

What is RAG? How AI tools answer questions from your own documents

Retrieval-augmented generation lets an AI assistant look things up before it answers. Here is how it works, where it helps and where it still goes wrong.

Ask a general-purpose chatbot about your company’s refund policy and it can only guess — it has never seen the document. Retrieval-augmented generation, or RAG, is the technique behind most “chat with your documents” tools, and it fixes exactly that problem.

The idea in one sentence

Before the model answers, the system retrieves the most relevant passages from a collection of documents and hands them to the model, which then writes an answer based on them.

How it works, step by step

  1. Split. Documents are cut into smaller chunks — a few paragraphs each.
  2. Index. Each chunk is turned into an embedding — a list of numbers that captures its meaning — and stored in a search index, often called a vector database.
  3. Retrieve. When a question arrives, it is embedded the same way and the closest-matching chunks are found, often combined with ordinary keyword search.
  4. Generate. The question and the retrieved chunks go to the model, with instructions to answer from them and cite where each point came from.

Why teams use it

  • Fresh information without retraining the model — update the documents and the answers change.
  • Grounded answers with citations you can click and check.
  • Access control. The system can retrieve only what each user is allowed to see.

Where it goes wrong

  • The right passage isn’t found, and the model answers confidently from the wrong one — or from its own memory.
  • Bad chunking splits a key fact across two pieces, so neither makes sense alone.
  • Outdated or conflicting documents produce outdated or conflicting answers.
  • Prompt injection. Text hidden inside a document can try to give the model instructions.

RAG or fine-tuning?

They solve different problems. Fine-tuning changes how a model behaves — its style, format or specialised skills. RAG gives it the facts it needs at the moment it answers. Many products use both.

Getting better answers from RAG tools

  • Keep the source documents clean, current and free of duplicates.
  • Ask for citations — and open them before you rely on an answer.
  • Test with the real questions your team actually asks.
  • Tell the assistant to say “I don’t know” when the documents don’t cover it.

Why do models still make things up? Read why AI chatbots hallucinate — and how to catch it.

Up next

The AiBuzz Briefing

The week in AI, in one email.

The biggest stories, the model launches that matter and the tools worth your time — sent once a week, free.