Retrieval-augmented generation (RAG) is a way of answering questions from company materials: the system first finds the relevant fragments in documents, then a language model writes an answer based only on those fragments and links to the source. For an enterprise knowledge base, this means employees can ask a question in plain language and get an answer they can check, without the company training its own model.
RAG is the most common architecture for internal assistants, and also one of the most commonly disappointing. A demonstration on twenty clean documents works well. A system on thousands of documents with old versions, scans and access restrictions often does not. This article explains how enterprise RAG works and where it usually breaks.
How RAG works on company documents
A production RAG system has four layers. Problems in any of them show up as wrong answers, so it helps to think about them separately.
| Layer | What happens | What has to be decided |
|---|---|---|
| Sources and preparation | Documents are taken from storage, parsed, recognised if they are scans, and split into fragments with metadata | Which materials are usable, who owns them, how versions and validity periods are tracked |
| Retrieval and selection | For each question, the system finds candidate fragments using keywords, semantic search or both, then ranks them | Filters by role, product and date; how duplicates and conflicting versions are handled |
| Answers | The model writes an answer from the selected fragments and cites the document, page or fragment | What the system does when the context is insufficient: clarify, decline or pass to a person |
| Updates and monitoring | Changes in sources are synchronised into the index, and quality is checked after each release | Synchronisation schedule, ingestion error tracking, a regression question set, user feedback |
The model itself is usually a ready-made one. In most corporate search projects, the work is in source preparation, retrieval configuration and quality control, not in training. Whether fine-tuning is needed is a separate question, answered with test tasks and data.
When a knowledge base needs RAG, and when it does not
RAG suits materials that change often and questions that are phrased in many different ways: procedures, product information, rates, internal instructions, policies. It is also useful when answers must be traceable to a source.
It is not always necessary. If employees search for documents by title or number, a conventional search with good filters may be enough. If the questions are about figures in a database, such as order status or stock levels, the answer should come from that system through an integration, with RAG covering only the descriptive part.
Where enterprise RAG fails
1. Poor source preparation
Scans with low recognition quality, tables flattened into text, headings lost during parsing: all of these produce fragments that cannot answer a question even when they are found. Recognition quality depends on structure, resolution, handwritten content and table complexity, so it should be checked on real documents before the pilot.
2. Outdated and conflicting versions
When a policy exists in three versions, retrieval may find the old one. Each document needs an owner, a validity period and an update rule. Outdated documents must be removed from the index, not just from the shared drive.
3. Retrieval that misses the right fragment
Employees use internal abbreviations, product codes and informal wording. Pure semantic search can miss exact terms; pure keyword search misses paraphrases. Most enterprise systems need a combination, and retrieval coverage must be tested on real questions, including awkward ones.
4. Access rights not carried over
This is the most serious failure. If the index ignores the permissions of the original storage, an assistant can reveal restricted documents to the wrong people. Permissions should be transferred from the sources and applied during retrieval and answer delivery. Instructions to the model do not replace technical access control. Role changes, access revocation and document deletion should all be tested. Our AI security consulting covers these requirements in more detail.
5. No measurement after launch
Without a fixed set of test questions, nobody notices when a new data source or a model update makes answers worse. Quality must be checked after every release, and users need a simple way to report wrong answers.
How to measure RAG quality
Measure retrieval and answers separately. If the right fragment was never found, changing the prompt will not help.
- Retrieval and grounding: whether the system finds the required source, and whether its content actually supports the answer.
- Freshness and access: how quickly updated materials reach the index, whether revoked permissions take effect, and whether restricted documents ever appear in answers.
- Behaviour on missing information: whether the system clarifies or declines instead of guessing.
- Business effect: for example, the share of routine questions resolved without an expert, or the time to answer a customer.
No RAG system can guarantee that every answer is correct. For legal, financial and other critical materials, a responsible specialist should still review the result.
Examples from delivered projects
- Sales assistant in B2B logistics. Rates, routes, customs commodity codes and document requirements were scattered across spreadsheets, instructions and expert correspondence. An internal AI assistant for the sales department answers questions from the knowledge base with source references. Up to 80% of routine questions are resolved without an expert, and customer responses are 3–5 times faster.
- Order status enquiries in manufacturing. An AI agent for order status combines the knowledge base and FAQs with order data, so descriptive answers come from documents and status facts come from the order system. Up to 70% of enquiries are processed automatically.
The second case shows a common pattern: RAG answers “how” and “why” questions, while integrations answer “what is the current value”. When an assistant also needs to take actions in systems, it becomes an AI agent.
How to start an enterprise RAG project
- Pick one area with clear content owners, such as support, HR policies, sales materials or compliance.
- Collect real employee questions and example documents, including scans and tables.
- List storage locations, access rules and how materials are updated.
- Build a test question set before the pilot and use it for every release.
- Connect the assistant where people already work: a portal, a messenger or a work application.
At SkaiLab, a first assistant with source search for one area typically takes 3–6 weeks. See our approach to AI systems for knowledge and documents, and for connecting storage, file storage integrations. For the stages around a pilot, read how to implement AI in a company.
Frequently asked questions
What is enterprise RAG? It is retrieval-augmented generation applied to company materials: the system finds relevant fragments in internal documents, applies the user’s access rights, and a language model writes an answer based on those fragments with a link to the source.
Do we need to train our own model for a corporate knowledge base? Usually not. Most corporate search projects need source preparation, retrieval configuration and a ready-made model that uses the retrieved context. Fine-tuning is considered only if tests show it is needed.
Why does a RAG assistant give wrong answers? The most common causes are poorly prepared sources, outdated or conflicting document versions, retrieval that misses the right fragment, and no quality testing after changes. Checking retrieval separately from answer generation usually shows which one it is.





