Control over AI
Blog
AI data leakage 8 min read

What is RAG, and what does it mean for your work?

With RAG, an AI tool answers questions from your own documents and shows the source. How it works, what it solves and what to sort out before you switch it on.

Abstract cards linked together like a flow chart
Quick answer

RAG stands for retrieval-augmented generation: the tool first searches a collection of documents, attaches the passages it finds to your question and has the model answer from those. The model is not trained on them; it receives the text with each query. That gives you answers from your own, current sources, with something to point to. What can end up in an answer therefore depends on the sources and the permissions on them, so check those before you switch it on.

01

Start with a small, well-defined source, such as a handbook or a set of procedures

02

Check who can read which documents in that source, and tidy up permissions that are too broad

03

Ask whose permissions the assistant searches with

04

Agree how a document gets taken out of the index

05

Treat retrieved text sent to the vendor like any other prompt

An organisation switches on an assistant that can search the intranet. The intent is modest: let people ask about leave policy without digging through folders. It works straight away; questions that used to land with HR are now answered in thirty seconds, with a link to the policy. Two weeks later somebody asks about pay bands and receives a passage from a document that was opened up to the whole company by mistake three years earlier.

The assistant did exactly what it was meant to do: search everything the person asking could reach. In doing so, it surfaced something that had been too widely shared for three years. That says a lot about how RAG works, and about what to sort out before switching it on.

How does RAG work?

RAG stands for retrieval-augmented generation. In plain terms: search first, then answer.

Four steps:

  1. Indexing. Your documents are split into chunks and converted into a form that supports searching by meaning rather than exact words. This happens once per document, and the result is usually stored in a vector database.
  2. Retrieval. When someone asks a question, the question is converted the same way and the closest-matching chunks are pulled back.
  3. Assembly. Those chunks are attached to the question, along with an instruction to answer from them.
  4. Generation. The model produces the answer, usually with a citation back to the source document.

What does not happen is training. The model receives the text with each query and forgets it afterwards, exactly like any other prompt.

What does it give you?

It solves two problems at once, which is why nearly every vendor now offers it.

Stale knowledge. A model knows nothing after its training cutoff and nothing about your organisation. With RAG it does not need to: the knowledge comes from a source you keep current.

Fabrication. Because real text accompanies the question, there is something to point at. That substantially reduces the problem described in why AI makes things up, without eliminating it: the model can still misread the retrieved passage or assert a connection the text does not support.

And one practical advantage that gets overlooked: you can remove a document from the index and it stops appearing in answers. With a model fine-tuned on your data, you cannot.

Where does the risk move to?

Without RAG the question is: what does an employee type in? That is a behavioural question, with a moment and a person attached.

With RAG the question is: what can the assistant reach? That is an authorisation question, and it was already answered years ago by whoever set permissions on those folders and sites.

Those two questions have different owners and different fixes. The second is also the more uncomfortable one, because the honest answer is usually that nobody is entirely sure.

Over-broad permissions become findable. A site readable by "everyone in the organisation" was protected in practice by nobody knowing it existed. Searching took effort. An assistant searches everywhere at once and summarises. The same thing happens with Copilot and SharePoint. The assistant does not break anything. It surfaces what was already broken.

The index ages differently. A deleted document may persist in the index until the next crawl. An edited document can keep surfacing in its old form. That is a new category for your retention policy, and it rarely gets one.

Retrieved text goes to the vendor. This is often skipped in assessments. The passages pulled from your own documents are attached to the prompt and therefore sent to the model. Everything that applies to ordinary prompts (storage, retention, the possibility of human review) applies to those passages too.

What do you sort out before switching it on?

  1. Which sources are in the index? Not the ones you intended, but the ones actually there.
  2. Whose permissions does the search run under? Usually the user's. Sometimes a service account, in which case every user gets the same answer regardless of what they were entitled to see.
  3. Are those permissions still correct? This is the real work and it has nothing to do with AI. It is also why Microsoft puts remediating oversharing first in its own deployment guidance.
  4. How does a document leave the index? On request, automatically or only at the next full crawl?
  5. What does the vendor do with retrieved text? The same question as for any prompt.

RAG moves the conversation from the employee to the configuration, and that is good news: configuration is something you can get right once. Start with a small, well-defined source, such as the staff handbook or one department's procedures. Check the permissions on exactly that source, switch the assistant on and only widen it once that works well. Keep in mind that people also paste their own text into the same chat window, from this morning's inbox for instance. With that text, they still need to take care with sensitive data.

FAQ

Common questions

What does RAG mean?

Retrieval-augmented generation. The tool first retrieves relevant passages from a document collection, adds them to your question and has the language model answer from them. The model does not learn the documents; it is handed them with each query.

Is the model trained on our documents with RAG?

No, that is the point of the pattern. Documents are indexed and retrieved for each query. The retrieved passages do travel to the model as ordinary text, so that provider's rules on processing, storage and retention apply to them.

Is RAG safer than fine-tuning on our own data?

In one respect, clearly yes: remove a document from the index and it stops appearing in answers, whereas you cannot readily make a trained model unlearn something. In another, no: the index makes findable what a folder structure was quietly hiding.

Why is authorisation the central issue with RAG?

Because the assistant searches with the permissions it holds, usually the user's. If those permissions were too broad for years, nobody noticed as long as searching took effort. An assistant searches everywhere at once and summarises the result.

What should we check before switching on RAG for company documents?

Which sources are in the index, whose permissions the search runs under, whether those permissions are still correct, how a document leaves the index and whether the AI vendor stores retrieved text. Those five cover most of it.

Portrait of Rens Timmermans from BeeSensible

Prefer someone to walk you through it?

Rens, BeeSensible

I'm happy to give you a twenty-minute tour. Leave your details and I'll find a time that suits you. You're also welcome to call or email.

Prefer to talk to someone first?

Want a live demo, or a quote for 100+ users? Leave your details and we'll be in touch within one working day.