What is RAG (Retrieval-Augmented Generation)?
A language model like ChatGPT only knows what was in its training data. Your quotes, maintenance logs and framework agreements aren't part of that. Ask it anyway, and it guesses, phrasing the guess so convincingly that it sounds like a fact.
RAG solves this with an extra step. Before the model answers, a search system pulls the passages that match the question out of your document store. The model only sees these passages, together with the instruction to stick to them. The answer points back to the documents it came from.
The terms “AI knowledge base” and “enterprise AI search” describe the same idea: an AI that works with Retrieval-Augmented Generation. Companies sometimes also call this a corporate knowledge system or an internal AI search.
How does an AI knowledge base with RAG work?
Once, up front, your documents are prepared: converted to text (including scans), split into meaningful sections (chunking) and stored as vectors in a vector database. A vector represents the meaning of a section in numbers. That's why the system finds matching passages even when the question uses different words. After that, every query runs through four steps:
- Prompt: An employee asks, for example: “What warranty period did we agree with customer X for the control system?”
- Retrieval: The system searches the approved documents for matching passages, by meaning and by exact terms such as contract numbers.
- Context augmentation: The best matches are passed to the language model together with the question.
- Generation: The model writes the answer from these passages and names the source, such as the contract, section and date.
If the system finds no matching passage, it should say exactly that instead of making up an answer. We test this behavior with real questions before launch.
For more detail on how the individual building blocks work together technically, see our guide AI Knowledge Management.
RAG architecture: the building blocks of a company RAG system
A production RAG system has six parts. Each one can fail on its own, so we test them separately:
- Ingestion: Documents are collected from the sources you approve, such as file shares and wikis. Scans go through OCR.
- Chunking and embeddings: The text is split into sections, and each section is stored as a vector that represents its meaning.
- Index: A vector database plus a keyword index. Hybrid search finds passages by meaning and by exact terms such as contract or part numbers.
- Retrieval and reranking: The system collects candidate passages and ranks them against the question. Access rights are checked here, before the model sees anything.
- Generation: The language model writes the answer from the retrieved passages and cites them.
- Evaluation and monitoring: A list of real test questions, review of answers and logs show when quality drops.
For the technical background on chunking, embeddings and reranking, see AI Knowledge Management.
RAG chatbot for business: what it takes beyond a tutorial
A RAG chatbot is the chat window on top of a RAG system. Employees ask a question and get an answer with its sources. Tutorials get a demo running with a handful of PDFs. A chatbot your teams rely on needs more:
- Permissions: Each user only gets answers from documents they may open.
- Sources and honest gaps: Every answer names its source. If nothing matches, the chatbot says so.
- A test set: Real questions with correct answers, run before launch and after every change.
- Upkeep: New documents come in, outdated ones leave the index.
- Where it lives: The chatbot sits where the question comes up, for example on the intranet or in the ticketing system.
RAG vs. fine-tuning: why RAG is usually the better choice
Fine-tuning retrains a language model on your own data. That sounds like the more direct route, but it has drawbacks in everyday business use:
| Feature | RAG | Fine-tuning |
|---|---|---|
| New document | is searchable immediately after it's ingested | requires new training |
| Source citation | yes, every answer points to its source | no, the knowledge is baked into the model |
| Access rights | controllable per document and role | hard to control, the model knows everything |
| Deleting data | remove the document, done | the model has to be retrained |
| Strength | facts and current knowledge | tone, format, industry language |
That's why RAG is almost always the better foundation for knowledge questions. Fine-tuning can complement it, for example when a model needs to follow a specific reporting style.
A rule of thumb: RAG supplies relevant information at query time without retraining the model; fine-tuning adjusts model behavior through training. If the problem is missing or changing facts, such as prices, contracts or manuals, use RAG. If the model has the facts but the format or tone is off, fine-tuning is the tool. Many systems use both: RAG for the facts and a lightly tuned model for the style.
Benefits: fewer hallucinations, current data, source citations
Fewer hallucinations: The model answers from your documents instead of general knowledge. The risk of made-up answers drops significantly. It can't be ruled out entirely, which is why the source belongs with every answer.
Current data: A new quote or a changed policy is searchable as soon as it's ingested. There's no knowledge cutoff tied to a training date.
Source citations: Whoever gets an answer sees where it came from and can check the original. That builds trust and surfaces errors before they cause problems.
Access rights carry over: If someone couldn't open a document before, the knowledge base won't give them an answer from it either.
GDPR-compliant implementation: connecting company data securely
A knowledge base is only as trustworthy as how it handles data. During planning, we clarify:
- Language model: The model only sees the few matching passages per question, never the entire document store. Your data is never used to train third-party models.
- Permissions: We define how roles and rights from your existing systems carry over into the knowledge base.
- Deletion: When a document is removed, it also disappears from the search index.
- Contract: We sign a data processing agreement with you under Art. 28 GDPR.
If you also want to run the language model itself under your own control, combine RAG with a Corporate LLM.
Use cases for larger companies (support, sales, internal knowledge base)
Support and service: Field technicians and support teams ask a RAG chatbot on the intranet or in the ticketing system about error codes, maintenance intervals or past fixes for the same problem. The answer comes from manuals and old service reports.
Sales and quotes: Whoever writes a quote finds similar past projects, previous price points and agreed special terms, without asking three colleagues.
Tenders: The system checks requirements from a tender against product documentation and certificates, and shows which points are covered and which aren't.
Internal knowledge base: Policies, process descriptions and project knowledge are retrievable by question. New hires get up to speed faster, and experienced colleagues get interrupted less.
Contracts and legal: Clauses, deadlines and liability terms can be searched and compared across many contracts at once.
How a RAG implementation runs
- Intro call (30 minutes by video, free): Which questions cost the most time today, and where do the answers live?
- Inventory: Which documents, which systems, which access rights? We also clarify which content is outdated and shouldn't be included.
- Define test questions: Together with your experts, we build a list of real questions with correct answers. The system is measured against this list.
- Pilot: One knowledge area goes live with a user group.
- Expand and support: More areas and data sources are added. We monitor answer quality and adjust the system.
If the knowledge you find should flow directly into workflows, such as quotes or tickets, AI Process Automation is the next step.
What drives the cost of a RAG project
We don't publish a price list because the effort depends on your setup. Three factors decide most of it:
- the number of sources and how clean the documents are, from tidy wikis to scanned legacy folders
- how closely permissions must follow your existing systems
- how many user groups and knowledge areas go live, and how fast
These points come up in the intro call and the inventory step, so you know what drives the effort before you commit.