What is RAG?
Retrieval-augmented generation
RAG, or retrieval-augmented generation, is a method where a system searches your own documents for passages relevant to a question, then hands those passages to an AI model as the material to answer from. The model does not learn your documents. It reads the relevant part one second before answering.
The short version: it looks things up before it speaks. That is the whole difference between an assistant that invents a plausible refund policy and one that quotes yours, with a link to the paragraph it came from.
An AI that has never read your handbook.
A language model learned from a very large amount of public text. It has never seen your pricing rules, your contracts, your onboarding guide or last quarter's board pack. Ask it a question about any of those and it will answer anyway, confidently, because producing plausible text is exactly what it does.
RAG fixes that by looking things up first. Before the model writes a word, the system searches your documents, pulls the passages that actually relate to the question, and hands them over as the material to answer from.
The only difference is one step. Before the right-hand phone answered, the system searched your documents and handed it the passages that matched. terms-v4.pdf §7 billing-sop.mdsupport-macros
Why not just train the model on our documents?
That is called fine-tuning, and it is a different tool for a different job. The two get confused constantly and choosing wrong is expensive.
| Fine-tuning | RAG | |
|---|---|---|
| What it changes | How the model writes. Tone, format, style | What the model knows right now |
| Updating a document | Retrain. Time and money, every time | Replace the file. Live immediately |
| Can it cite a source? | No. The knowledge is baked in and untraceable | Yes, and it should |
| Controlling who sees what | Very hard. It is all one model | Straightforward. Filter what gets retrieved |
| Use it when | You need a consistent voice or a strict output shape | You need answers grounded in facts that change |
For almost every business use, the answer is RAG, and often RAG alone. Fine-tuning is the smaller, more specialised job.
RAG is mostly a search problem.
The model is the easy part. Nearly every disappointing internal assistant fails for the same reasons, and none of them are about the AI.
- If retrieval brings back the wrong passage, the answer is wrong. Confidently so. The model will faithfully summarise whatever it was handed.
- Documents have to be cut up sensibly. Split a policy in the middle of a sentence and neither half means anything on its own.
- Old documents are worse than none. If three versions of the handbook are in there, retrieval will sometimes find the 2023 one and answer from it.
- Permissions have to be part of the search. If everything is retrievable by everyone, you have built a very efficient way to leak salary bands.
- It reduces invention, it does not end it. Grounded answers are far more reliable, and citations let a human check. That is the honest claim.
OpsBrain.
A multi-tenant RAG platform, built from scratch
React 19, Express 5 and Supabase with pgvector and HNSW indexing for the search side. Row-level security across eight tables and three-tier role-based access, so what a given person can retrieve is a rule the database enforces rather than something the application remembers.
Integrations into Slack, ClickUp and Drive, so the documents it answers from are the ones people actually keep there, not a copy that goes stale the week after launch.
Words that turn up next to this one.
Still unclear?
What is RAG?
RAG, or retrieval-augmented generation, is a method where a system searches your own documents for passages relevant to a question, then hands those passages to an AI model as the material to answer from. The model does not learn your documents. It reads the relevant part immediately before answering, which is why the answer can cite a source.
What is the difference between RAG and fine-tuning?
Fine-tuning changes how a model writes: its tone, format and style. RAG changes what a model knows at the moment it answers. Updating a document with RAG means replacing the file and it is live immediately, where fine-tuning means retraining. RAG can cite its source and fine-tuning cannot. For most business uses the answer is RAG.
Does RAG stop AI making things up?
It reduces it substantially and does not eliminate it. Grounding an answer in retrieved passages is far more reliable than answering from memory, and citations let a person verify. But if retrieval returns the wrong passage the model will faithfully summarise the wrong passage, confidently.
Why do internal AI assistants usually disappoint?
Almost always because of the search, not the AI. Documents cut up badly, so passages lose their meaning. Old versions left in the index, so answers come from a superseded handbook. No permission filtering, so it either leaks or is locked down until useless. The model is the easy part.
Is our data safe with RAG?
It can be, and the control is in the retrieval layer rather than the model. Filter what a given person is allowed to retrieve and the model never sees anything they should not. Done properly the permissions are enforced by the database, not by the application remembering to apply them.
Wondering what this would look like on your stack?
Thirty minutes. We will tell you whether it is worth building and what it would take. No deck.
OpsLabs builds custom operational systems for growing companies. This page is part of a plain-English glossary of the terms that appear in our proposals and on this site.