← All insights
Explainers·8 min read

What is RAG (retrieval-augmented generation)? AI grounded in your own documents

Ask a general-purpose AI model a question about your own business and you hit a wall fast. It does not know your refund policy, your install procedure or what you told a client in 2023, because none of that was in its training data. RAG is the pattern that fixes this without retraining anything. It hands the model the relevant pages from your own documents at the moment you ask, so the answer comes from your material instead of the model's memory.

This is the plain-English version for owners: what RAG is, why it is usually the right way to build a knowledge assistant over your own content, and when something else is the better call.

RAG in 30 words

Retrieval-augmented generation searches your own documents for the passages that match a question, feeds those passages to the AI model alongside the question, and gets back an answer grounded in your material - with citations, and no retraining.

How it actually works

There are three steps, and AWS describes them in the same order in its RAG primer: retrieve, augment, generate.

  • Retrieve. The system searches your document library and pulls the handful of passages that best match the question. It is not keyword search - it matches on meaning, using embeddings (numeric representations of text, so “annual leave” and “holiday entitlement” land close together).
  • Augment. Those passages are added to the prompt, behind the scenes, so the model sees the question and the source material together.
  • Generate. The model writes the answer using the passages it was handed, and can name which document each fact came from.

The two pieces of plumbing you will hear named are embeddings and a vector database. Embeddings turn your text into numbers that capture meaning. A vector database stores those numbers and finds the closest matches to a question in milliseconds. You do not need to understand the maths - you need to know that the quality of retrieval is what makes or breaks the answer.

Why an owner should care

Every business is sitting on documents that hold the answers staff and customers keep asking for: SOPs, policies, product manuals, pricing rules, past quotes, the handbook. The knowledge is there. Getting to it is slow.

RAG turns that pile into something you can ask in plain English. A new hire asks “what is our process for a warranty claim?” and gets the answer with a link to the actual procedure. Support staff stop interrupting your most senior person for the same five questions. The value is not clever AI - it is your own knowledge, made instant and consistent.

The other reason owners care: you update an answer by updating a document. Change the policy, re-index it, and the assistant is current. No model retraining, no developer, no waiting.

RAG vs a big context window vs fine-tuning

These three get muddled constantly. Here is the clean split.

  • A big context window is the model’s working memory for one conversation. You paste documents in and it reads them. Fine for a handful of files you are working through right now. It does not scale to a library of hundreds of documents that change, and you pay to re-send everything each time.
  • RAG is for exactly that library. Instead of pasting everything, it searches and pastes only the relevant slices per question. Cheaper per question, always current, and it scales well past what any single context window can hold.
  • Fine-tuning changes how the model writes or behaves, not what facts it knows. It is the wrong tool for “answer from our documents,” because you would have to retrain every time a document changed. Use it for style and format on a narrow repetitive task, not for knowledge.

The short rule: if the goal is answering questions from a body of knowledge that changes, RAG is the default. Most SMBs need RAG, good prompting, or both - and fine-tuning rarely.

Can you trust the answers?

More than you can trust ungrounded AI, and that is the point. Because the model is handed real passages from your documents, it can quote them and cite the source, which makes answers checkable rather than taken on faith. AWS notes this directly: grounding answers in an authoritative source makes the system more accurate and more explainable.

It is not magic. If retrieval pulls the wrong passage, the answer follows it. So a serious build shows its sources on every answer, keeps the source documents clean and current, and keeps a human in the loop on high-stakes questions. Anthropic’s work on contextual retrieval exists precisely because better retrieval is the lever - they report cutting failed retrievals by 49%, and 67% with reranking added.

When RAG is the right call

Reach for RAG when:

  • You have more documents than fit comfortably in one prompt, and they change over time.
  • People keep asking the same questions that already have answers buried in your files.
  • You need answers that cite a source, for trust or for audit.

Skip it when you only have a few stable documents - just use the context window - or when the job is changing the model’s tone rather than its knowledge. Start with one well-defined document set, ship with citations switched on, and earn trust before you widen the scope.

Frequently asked questions

What is RAG in simple terms?
RAG (retrieval-augmented generation) is a way to make an AI model answer using your own documents instead of just what it learned in training. When someone asks a question, the system first searches your material, pulls the few passages that actually match, and hands them to the model along with the question. The model then writes an answer grounded in those passages and can tell you which document each fact came from. No retraining is involved.
How is RAG different from just using a big context window?
A context window is the model's working memory for one conversation - you paste documents in and it reads them. That works for a handful of files. RAG is for when you have hundreds or thousands of documents that change over time. Instead of pasting everything, RAG searches your library and pastes only the relevant slices. It is cheaper per question, stays current as documents change, and scales past what any single context window can hold.
When should I use RAG instead of fine-tuning?
Use RAG when the goal is answering questions from a body of knowledge that changes - your policies, SOPs, product docs, contracts. RAG is the default for knowledge assistants because you update an answer by updating a document, not by retraining. Fine-tuning is for shifting how the model writes or behaves on a narrow, repetitive task, not for teaching it facts. Most SMBs need RAG, prompting, or both - and fine-tuning rarely.
Can RAG answers be trusted and cited?
More than ungrounded AI, yes. Because the model is handed real passages from your documents, it can quote them and name the source, which makes answers checkable. AWS notes this makes the system more accurate and explainable. It is not perfect - if retrieval pulls the wrong passage, the answer follows it - so a good RAG build shows its sources and a human spot-checks high-stakes answers.
What does a RAG system need to run?
Three pieces. First, your documents, split into chunks and turned into embeddings (numeric representations of meaning). Second, a vector database that stores those embeddings and finds the closest matches to a question. Third, the language model that reads the retrieved chunks and writes the answer. The plumbing matters less than the discipline: clean source documents and a way to keep them current.

Where this fits

Custom Builds

Bespoke web apps, internal tools and AI products built on Claude and the Anthropic SDK.