Skip to content
Adrythm
AI and automation

Retrieval augmented generation

RAG / train it on our documents / knowledge base for AI / grounding an AI in your content

In short

Retrieval augmented generation is how an AI answers from your documents without being trained on them. OWASP describes it as combining a pre-trained model with external knowledge sources at answer time. So the documents sit in a store the system reads from, and who can read that store is the question.

Start with what it is not. OWASP describes retrieval augmented generation as a model adaptation technique that improves the performance and contextual relevance of responses by combining pre-trained language models with external knowledge sources. The model is not retrained. Your documents are converted into a form the system can search, and the relevant pieces are pulled in at the moment a question is asked.

That distinction decides which questions matter. Nothing has been baked into a model somewhere. There is a store holding your material, and the real subject is who is allowed to read it.

OWASP names three ways that goes wrong, and the first is the one to raise with any vendor selling a shared product. In multi-tenant environments where several classes of users or applications share the same vector database, there is a risk of context leakage between users or queries. Second, attackers can invert embeddings and recover significant amounts of source information, so the common reassurance that the store holds only mathematical representations rather than your documents is not by itself a guarantee. Third, poisoned data can arrive from insiders, prompts, data seeding or unverified data providers.

There is also an effect nobody warns you about. OWASP notes that retrieval augmentation can alter the underlying model's behavior, and that while factual accuracy and relevance may increase, qualities like emotional intelligence or empathy can diminish. An assistant that becomes more correct can become worse at handling an upset customer.

NIST supplies the standard the store has to meet. It says systems that maintain confidentiality, integrity and availability through protection mechanisms preventing unauthorized access and use may be said to be secure, and lists among common security concerns the exfiltration of models, training data or other intellectual property through AI system endpoints. The endpoint is the assistant itself.

In practice

OWASP's own first remedy is the one to ask for by name: fine-grained access control, so that retrieval respects who is asking. Without it, an assistant that can see everything answers everyone as though they were entitled to everything, and the person who finds that out is usually a customer or a junior member of staff.

Not the same as

Training or fine-tuning
Those change the model. This leaves it alone and hands it material at question time.
Prompt injection
That is an instruction arriving in content. This is about what the system is able to fetch and show.

Why it matters to you

The phrase you will hear is that they will train it on your documents, and it is almost never what is happening. Knowing the real arrangement changes the contract you should be asking for, because the risk does not sit in the model. It sits in a searchable copy of your files, whose access rules somebody chose, and which can be asked questions by anyone the assistant will talk to.

What to ask or check

  1. 01Is the store shared with other customers, and what separates them?
  2. 02Does retrieval respect who is asking, or can the assistant see every document?
  3. 03When a file should stop being visible, what removes it, and how quickly?

What people get wrong

That the documents have been trained into the model and are therefore gone from view. OWASP describes external knowledge sources combined with a pre-trained model, and notes that embeddings can be inverted to recover significant amounts of source information.

Red flags

  • A shared knowledge store with no answer about what separates one customer from another.
  • An assistant with one level of access to everything, answering everybody.
  • No process for removing a document from retrieval when it should no longer be visible.

Who owns it

Whoever configures the store and its access rules. NIST puts the standard on the deployed system: confidentiality maintained by mechanisms that prevent unauthorized access and use.

Where you will see it

In every proposal that offers an assistant trained on your policies, prices, manuals or past tickets.

AI agent

An AI agent is a model that has been granted the ability to take actions, not just produce text. OWASP says the damage one can do comes from three grants: excessive functionality, excessive permissions and excessive autonomy. What it is allowed to do matters more than how good it is.

Privacy-enhanced AI

Privacy-enhanced AI means an AI system built so your data is not exposed or quietly reused. NIST lists it as one of seven characteristics of trustworthy AI, and states the honest catch: privacy techniques can cost accuracy. The FTC has required firms to delete models built on unlawfully obtained data.

Training data

Training data is what a model learned from. The question owners ask is whether their own data joins it, and there is no single answer: OWASP names three separate stages, pre-training, fine-tuning and embedding. A commitment worth having names the stage and comes in writing.

Hallucination

A hallucination is AI output that sounds right and is not. OWASP describes the model filling gaps in its training data using statistical patterns, without understanding the content, so the answer can be fluent and unfounded at once. Its own first example is an airline that was successfully sued over its chatbot.

Prompt injection

Prompt injection is when text an AI system reads becomes an instruction it follows. OWASP notes the text does not have to be visible to a person, only parsed by the model, and that no fool-proof prevention is known. The UK's national cyber security body says the same.

Explainability

Explainability is being able to say how an AI system reached a decision. NIST separates three questions: transparency answers what happened, explainability answers how, and interpretability answers why it meant what it did. A global explanation describes the model. Only a local one answers a customer.

Want this explained against your own numbers?

Twenty minutes, a straight answer, and no follow-up sequence if you decide not to work with us.