What is RAG? How AI answers from your company's own data

In short: RAG (retrieval-augmented generation) is a technique where an AI first searches your own documents and data, then writes its answer from what it found. It gives a business ChatGPT-style answers about its own products, prices and procedures, with sources, and without training a model of its own. The quality depends more on how tidy the underlying content is and who is allowed to see what than on which AI model you pick.
What is RAG?
RAG is a method that hands a language model knowledge it was never trained on, just before it answers. The term comes from a 2020 research paper by Patrick Lewis and colleagues. They combined a language model with search over a large text collection and got more specific and more factual output than from a model relying only on what it had learned in training (Lewis et al., 2020).
Anyone who has tried ChatGPT at work knows the problem: the model knows nothing about your company, and it may make up an answer that sounds plausible and is wrong. AWS describes RAG as a way to have the model consult an authoritative knowledge base outside its training data before it responds, so the answer draws on current sources that can be shown to the user, without retraining the model (AWS).
When people talk about "AI on our own data", "a company ChatGPT" or "a chatbot that knows our documents", RAG is almost always what sits underneath.
How RAG works, step by step
RAG works in three steps: indexing, retrieval and generation (AWS).
- Indexing. Documents, manuals, web pages and database content are split into shorter passages, often called chunks. Each chunk is converted into a list of numbers, an embedding, that represents its meaning, and stored in a vector database.
- Retrieval. When someone asks a question, the question is turned into an embedding too. The system finds the chunks closest in meaning. Many solutions combine this semantic search with ordinary keyword search.
- Generation. The retrieved chunks are sent to the language model together with the question. The model writes the answer and can say which documents it is based on.
When a document changes, you update the index, not the model. That is why RAG suits knowledge that changes, such as price lists, product sheets and internal policies. OpenAI's file search tool is one example: it searches uploaded files using both semantic and keyword search, and the answer includes citations to the files it used (OpenAI).
RAG vs fine-tuning vs a plain chatbot
RAG is the right choice when the AI has to answer correctly from your own knowledge, and that knowledge changes. Fine-tuning is better suited to teaching a model a particular style or a fixed format. A plain chatbot is enough when the task does not need company data. AWS notes that retraining a model on an organisation's information is expensive and calls RAG a more cost-effective way to introduce new data (AWS).
| Plain chatbot | RAG | Fine-tuning | |
|---|---|---|---|
| Knows your data | No, only what you paste in | Yes, retrieves it for every question | Partly, whatever was in the training set |
| Updating | Not applicable | Update the documents | A new training run |
| Shows sources | No | Yes | No |
| Access rights | Not applicable | Can follow each user's permissions | Hard, everything is inside the model |
| Best for | General tasks and writing | Questions about your own knowledge | A fixed style, format or vocabulary |
What companies use RAG for
RAG pays off where staff or customers keep asking things that are already written down somewhere. The most common uses:
- Internal knowledge search. Employees ask about the staff handbook, procedures or past projects instead of digging through shared drives.
- Customer service. A chatbot on the website, or an assistant for support agents, that answers from FAQs, product sheets and delivery terms.
- Document-heavy work. Questions put to contracts, proposals, technical manuals and policies, for example about notice periods or warranty terms.
- Business data. Questions about orders, customers or invoices, once the AI is connected to your ERP and CRM through system integration.
When the AI also has to act on the answer, for example open a ticket or update a customer record, you are building an AI agent. An agent often uses RAG as its knowledge source and a workflow tool such as n8n to carry out the steps.
What RAG takes and what it costs
There are three main routes, and they differ in time and cost.
1. Built into Microsoft 365
Microsoft Copilot uses a semantic index of your organisation's data in Microsoft 365. Microsoft enables the indexing automatically, and Copilot only surfaces results from content the user already has access to. According to Microsoft, prompts, responses and data accessed through the index are not used to train the underlying language models (Microsoft Learn). If your company already works in Microsoft 365, this is often the simplest place to start.
2. Ready-made cloud building blocks
If the AI should answer customers on your website or pull from several systems, you build with the vendors' ready-made parts. With OpenAI you upload files to a vector store, and the model searches it before answering (OpenAI). The technology itself is rarely the big cost. OpenAI's price list in December 2026 puts storage at $0.10 per GB per day, with the first gigabyte free, and searches at $2.50 per 1,000 tool calls, on top of the normal token cost of the model's answers (OpenAI).
3. A custom RAG solution
A custom build makes sense when you have specific requirements for where data is stored, specialist vocabulary, or many systems to connect.
Whichever route you take, most of the work sits outside the model: cleaning and structuring documents, setting permissions, building connections to your systems, testing, and keeping the content current afterwards. A pilot limited to one use case is therefore far lighter than a knowledge base for the whole company. We have not found reliable published figures for total project costs, so we do not quote any. It helps to settle scope and ownership first, as part of your AI strategy.
Limits and risks
RAG lowers the risk of wrong answers. It does not remove it. The model can still misread a passage or fill a gap with a guess, so answers that matter need checking.
- Wrong retrieval. If the search returns the wrong passage, the answer will be wrong however good the model is. How documents are split matters a great deal, and tables and price lists deserve separate testing.
- Outdated documents. Old versions, duplicates and conflicting documents produce conflicting answers. Someone has to own the content.
- Access rights. The solution must respect existing permissions. Norway's data protection authority examined a Microsoft 365 Copilot rollout at the university NTNU and stressed that Copilot has access to the same information as the person using it, so weak access control is exposed and amplified. Its advice was to get your own house in order first and to introduce the tool in small, controlled steps (Datatilsynet). Microsoft also states that indexing does not change access permissions, and that administrators can exclude sensitive SharePoint sites such as payroll or HR from the index (Microsoft Learn).
- Data protection. If the content contains personal data, the privacy rules that apply to your business apply to the AI's use of it as well. Check where the data is processed and what the vendor contract says. The Norwegian authority singled out HR and personnel management as particularly high risk (Datatilsynet). For customers inside the EU Data Boundary, Microsoft stores the semantic index in a datacentre in the EU or EFTA (Microsoft Learn).
- Transparency. If you serve users in the EU, the EU AI Act says people should be made aware that they are interacting with a machine when they use a chatbot. The transparency rules took effect in August 2026 (European Commission). Telling users is good practice elsewhere too.
The same logic works in the other direction. Public AI assistants retrieve and cite web pages in much the same way, which is why clear, well-structured content matters for how AI chooses which companies to recommend.
How to get started
Start narrow and measure before you widen the scope.
- Pick one limited use case. For example the most common customer service questions, or the staff handbook.
- Clean up the content. Remove old versions and duplicates before anything is indexed.
- Decide who may see what. Start from the permissions you already have and keep sensitive material out from day one.
- Write 30 to 50 real questions with correct answers. Test the solution against them after every change.
- Always show the source. Users should be able to open the document the answer is based on.
- Name a content owner. Without one, answers go stale quickly.











