Go to the service: Private AI (on-premises)
AI with company knowledge: RAG explained simply
AI with company knowledge through RAG: how a language model draws answers from your own documents, which risks the BSI names and how access rights stay intact.
What is it about?
A language model, or LLM, is an AI that understands and writes text. It knows a great deal about the world but nothing about your business: not your work instructions, not the templates you use, not what your quality manual says. This is where AI with company knowledge comes in. The usual method is called RAG, short for retrieval-augmented generation – in plain terms, writing answers after looking things up.
Picture a very well-read temp starting in your office. They write well but do not know your processes. So before answering a question, they go to the filing cabinet, pull out the right pages and answer on that basis. With RAG, the filing cabinet is your knowledge base, and a search function does the pulling out.
How RAG works, step by step
Germany’s Federal Office for Information Security (BSI) describes the process like this: relevant information is found in the knowledge base using suitable search mechanisms and passed to the model together with the question. Put simply:
- Your documents are prepared and made searchable.
- An employee asks a question, such as “How do we handle a complaint?”.
- The search finds the relevant sections, for example from the work instruction.
- The language model writes an answer based on those sections and can show where they came from.
Importantly, your documents are not used to train the model. They are simply looked up for each question.
What RAG is not
RAG is not an all-knowing search engine for everything ever written in your business. The AI can only answer as well as the stored documents allow. If a work instruction is out of date, the assistant gives out-of-date information – just faster and in nicer sentences. If a topic is missing from the documents altogether, the assistant should say so openly rather than guess. That is why looking after the documents matters at least as much as the technology behind them.
Why does it matter for your business?
In many businesses, knowledge sits in folders, emails and people’s heads. New staff ask the same things again and again, and experienced colleagues lose time searching. An assistant that knows your own documents can take some of that load – in a law firm for internal guidance notes, in a trades business for installation instructions and summaries of standards.
RAG has a second advantage. Language models sometimes invent statements that sound convincing but are wrong; these are called hallucinations. Because RAG can show which passages an answer is based on, the BSI says the impact of such errors can be reduced. Your staff can see where a statement comes from and check it.
The risks you should know about
The BSI also names clear risks:
- Wrong permissions: if the search ignores who may see what, a trainee might receive extracts from personnel files. The BSI recommends a rights and roles concept and advises against managing permissions only through text instructions to the AI, because these can be attacked.
- Poisoned content: if manipulated documents get into the knowledge base, the AI can be steered towards giving specific wrong answers.
- Hidden instructions: in an indirect prompt injection, invisible commands are hidden in a document, for example in white text. The BSI pointed out as early as 2023 that no reliable countermeasure removes the problem completely. It does, however, describe baseline measures that provide basic protection, such as cleaning up document content and clearly separating the question from the document.
Data protection also applies. If the knowledge base contains personal data, the GDPR principles apply – for example, that only as much data is processed as the purpose requires.
An everyday example
Example: A fictional plumbing and heating business with 25 employees has built up a lot of documents over the years: installation instructions, maintenance checklists, internal rules for emergency call-outs and quote templates. Even so, new fitters keep ringing the office because they do not know where things are.
The business sets up an internal assistant using RAG. First comes a clear-out: outdated instructions are removed, and every document is given an owner. Personnel records and payroll never go into the knowledge base at all. Management gets a separate area that only they can search.
A fitter on site now asks: “Which checks apply after replacing a boiler?” The assistant answers in a few sentences and names the checklist the information comes from. The fitter opens it briefly and checks the steps. If an answer is unclear, he reports it to the office so the document can be improved. Over time, the knowledge base gets better instead of going stale.
How we approach it
As part of our local AI service, we build RAG solutions step by step:
- Clarify the use case: we define which questions the assistant should answer and for whom. Not every document belongs in it.
- Review and clean up documents: together with you we remove outdated content and decide who is responsible for which area.
- Map permissions: we carry your existing access rights over into the search, so nobody sees more through the AI than in the file system.
- Decide where it runs: for confidential data we can run the solution entirely on your premises. For the data protection side, see local AI and the GDPR; for the technology required, see AI server hardware for local AI.
- Secure and test: we put protective measures against hidden instructions in place and test the assistant with real questions from your daily work.
- Roll out and maintain: we train your team, set up a way to give feedback and keep the knowledge base up to date together with you.
What you can do right away
- Collect ten questions that come up again and again in your business.
- Note which documents contain the answers today – and whether those documents are current.
- Decide which documents must never go into an AI knowledge base, such as personnel files.
- Check whether your folder permissions are properly set up today. Otherwise an AI simply inherits the existing mess.
- Name one person for each area of knowledge who keeps it up to date.
Key terms
- RAG (retrieval-augmented generation)
- A method in which an AI first looks up relevant passages in your documents and then bases its answer on them.
- Language model (LLM)
- An AI that understands and produces text. LLM stands for large language model.
- Knowledge base
- The collection of documents the AI draws its information from, such as manuals, templates or policies.
- Hallucination
- A statement invented by the AI that sounds convincing but is not true.
- Indirect prompt injection
- An attack in which hidden instructions in a document or web page try to make the AI behave in unwanted ways.
Frequently asked questions
Is the AI trained on our documents?
Not with RAG. The BSI describes RAG as giving the model access to additional documents without those documents having been used as training material beforehand. The relevant passages are looked up for each question and passed along with it.
Does RAG prevent wrong answers?
Not completely. RAG can reduce the impact of invented answers because the AI can show which passages its answer is based on. Your staff still need to check important answers.
Will every employee then see every document?
That must not happen. The BSI recommends controlling the search through a rights and roles concept and checking carefully who may see which information. It explicitly advises against managing permissions only through text instructions to the AI.
Can RAG run entirely on our own premises?
Yes. The language model, the search and the documents can all run on your own hardware. Whether that makes sense for you depends on the amount of data, the number of users and your requirements. We clarify this with you beforehand.
Sources
Official sources, consulted when the article was written.
- BSI – Generative AI models: opportunities and risks for industry and authorities (incl. M14 Retrieval-Augmented Generation, German) (opens in a new tab)
- BSI – Baseline protection against indirect prompt injections in document-based LLM chats (German) (opens in a new tab)
- European Commission – Principles of the GDPR (opens in a new tab)

