Guide: AI in business › AI agents and automation
RAG AI (short for retrieval-augmented generation) is a way of working in which a language model first searches for matching passages in the company’s documents and only then writes an answer based on them. As a result, an assistant or chatbot answers in line with the current price list, procedure or contract rather than general knowledge from the internet. There are fewer made-up answers. They don’t disappear, though, which is why the outcome depends on the quality of the documents and human oversight.
In 60 seconds RAG on one page
- How it works: The AI first searches your documents and then answers, ideally citing the source.
- Who it pays off for: companies whose knowledge sits in documents such as price lists, procedures, offers, archives of statements or policies.
- Budget: from a licence for an off-the-shelf tool to search and storage fees in the API, with the biggest share going on organising documents.
- To start: one set of documents and a list of 30–50 real questions the system should answer.
- Risk: out-of-date files, no access control and the belief that RAG guarantees the truth.
RAG explained in simple terms
A large language model (a program that understands and writes text) knows a lot about the world, but nothing about your company: your current price list, warranty terms or what was agreed with a particular customer. Asked about them, it will either refuse or guess. The latter is worse. RAG AI solves this problem simply: before the model answers, the system searches the company’s documents for passages matching the question and gives them to the model as material.
The name comes from a research paper by Patrick Lewis and co-authors published in May 2020. The terms RAG LLM and LLM RAG mean the same thing, i.e. RAG built on a large language model (LLM). In companies people also simply talk about an AI knowledge base or AI on company knowledge.
RAG is often part of an AI agent. An agent that answers customer questions or prepares a briefing note before a meeting treats the knowledge base as one of its tools, just like a search engine or a spreadsheet. We describe how an agent uses such tools and what it costs in our article AI agent in marketing and PR, and we have gathered the other sections of the topic in guide to artificial intelligence for business.
How RAG works under the bonnet
You can leave the technical details to IT. It is worth understanding the four stages, though, because an error can arise at any of them:
- Preparing the documents. Files are split into shorter passages, for example paragraphs or sections of a contract.
- Capturing meaning. Each passage is turned into a sequence of numbers describing its meaning (a so-called embedding) and goes into a vector database, which searches by meaning rather than by exact words. That is what semantic search is: the question “how much does delivery to the Czech Republic cost?” will find a passage about “international transport charges”, even though it contains neither the word “delivery” nor “Czech Republic”.
- Retrieval. When someone asks a question, the system selects a few of the best-matching passages.
- Answer. The model writes an answer based on these passages, and in a well-built system it also states which document the information comes from.
Who RAG is for in a company, and in what situation
RAG makes sense in a company where people search documents for answers every day, or keep asking colleagues at the next desk the same things. Here are typical situations:
- Sales. Sales reps search price lists and specifications, as well as terms of trade, and the assistant answers by pointing to the document.
- Customer service. A RAG chatbot, i.e. a chatbot built on company documents, answers questions about deliveries, returns and warranties. We write about when such a chatbot helps and when it drives customers away in our guide to AI in customer service.
- PR. The communications department searches its archive of statements, positions and media responses in order to speak with one voice. We show, with data, how to write statements that are easy to find and quote in our article the press release in the age of AI.
- HR and internal communications. Employees ask the assistant about policies and benefits or procedures instead of writing to HR.
RAG, fine-tuning or long context: which to choose
RAG is not the only way to “teach” AI your company’s knowledge. Model tuning ( fine-tuning) changes the model itself. Long context means pasting entire documents into the conversation, which works with a few files, but with hundreds of documents that change every month it quickly becomes expensive, slow and hard to repeat. Each method suits a different situation.
| RAG | Fine-tuning | Pasting documents into the conversation | |
|---|---|---|---|
| What for | answers based on many, frequently changing documents | style, format, specialist language | one-off analysis of a few files |
| Updating knowledge | swapping a file in the database | retraining | pasting in the new version |
| Citing the source | yes, easily | no | partly |
| Start-up cost | medium | high | low |
| Risk | poor quality or out-of-date documents | errors becoming baked into the model | length limits, lack of repeatability |
Does RAG eliminate hallucinations?
No. It reduces them, but does not eliminate them. In 2024 Stanford researchers tested legal tools whose makers promised “hallucination-free” answers thanks to RAG, and found that the tools studied were wrong or made things up in 17–33% of cases, i.e. less often than general chatbots, but still too often for uses where every word counts.
Where do these errors come from? The system may retrieve the wrong passage. A document may be out of date, and the model may combine information from two places incorrectly. We break down the causes and ways of reducing fabrications in a separate article on AI hallucinations.
How to implement RAG in your company step by step
This sequence works both with off-the-shelf tools and with a solution built from scratch. If RAG is to be part of an agent, also read our guide on how to build your own AI agent.
- STEP 01Choose one area of knowledge
For example, terms of trade and price lists. Not “the entire company drive”.
- STEP 02Collect real questions
Write down 30–50 questions people really ask, together with the correct answers. This will be your test.
- STEP 03Tidy up the documents
Remove old versions, mark the dates from which documents apply and split large files into logical parts.
- STEP 04Set permissions
Who can ask about what? A sales assistant should not see payroll data.
- STEP 05Build and test
Run the entire list of questions through the system and count how many answers are correct, how many have the right source and how many are simply wrong.
- STEP 06Appoint a knowledge owner
One person makes sure the new price list replaces the old one in the database on the day it takes effect.
How much AI on company knowledge costs
The cost depends on whether you use an off-the-shelf tool or build your own system. In both cases the most expensive element is people’s time. Organising documents and testing eat up most of it, especially in companies where the same price list circulates in five versions across sales reps’ inboxes and nobody remembers which one is current.
| Item | What it depends on | Public reference point (as of 24 September 2026) |
|---|---|---|
| Off-the-shelf tool (e.g. a GPT with knowledge in ChatGPT) | plan and number of users | up to 20 files of 512 MB each per GPT; creating GPTs in Business, Enterprise and Edu plans |
| Document storage in the API | size of the document set | OpenAI: USD 0.10 per GB per day, first GB free |
| Search in the API | number of questions | OpenAI: USD 2.50 per 1,000 searches |
| Language model | length of questions and retrieved chunks | OpenAI: from USD 0.20 per million input tokens |
| Tidying documents and testing | state of the documentation, number of areas | team and specialist time, individual quote |
The quality of documents determines the quality of answers
RAG won’t fix messy documents. It will expose the mess faster. Three versions of the same policy, an undated price list, an offer with an expired discount: the system will find them all, and the model will answer on the basis of whichever version best matches the question, not the one currently in force.
That is why a RAG rollout is half a knowledge-organisation project. The whole company benefits, because a single source of truth on prices and procedures makes it easier internal communication including in departments where nobody uses AI.
When RAG pays off, and when it isn’t worth the effort
RAG pays off when knowledge is written down in documents, changes often and many people look for it every day. A good moment is the period before a price list change, a new offer launch or the arrival of a larger group of new staff, because then the knowledge base has users from day one.
It isn’t worth the effort when there are only a few documents and they rarely change. It is enough to paste them into an assistant, as we show in our article on how an AI assistant works in a company. And don’t start if the knowledge exists only in people’s heads. It has to be written down first. We discuss choosing a tool to fit the company’s ecosystem in our comparison ChatGPT, Gemini or Copilot for business.
Security, permissions and personal data
An AI knowledge base sees as much as you put into it. If contracts with personal data or salary information end up there, anyone with access to the assistant can ask about them, and without any ill intent, with an ordinary question such as “how much does a regional manager earn?”. So set permissions at document level, not just for the system as a whole.
Also check where the provider stores the documents, whether it uses them to train models and whether you have a data processing agreement with it. We write more about the risks in our piece on AI risks and ethics. Want to build an assistant on your company’s knowledge with control over sources and permissions? Talk to Commplace® AI agency.
Where RAG projects most often fall apart
Old versions of documents get mixed up with current ones, and the assistant quotes whatever matches the question rather than what is in force. The result is wrong information for customers and a loss of trust in the tool.
Without a pointer to the document, an employee cannot check the answer. The error goes to the customer. The company is liable for a statement nobody has verified.
A system checked on a few examples looks great, but gets things wrong on the questions people actually ask, because these are shorter, more colloquial and full of abbreviations that appear in no document. A list of 30–50 questions with answers protects against this from day one.
An assistant with access to all documents will reveal payroll data or contract terms to people who should not see them. The risk is both legal and reputational.
Without someone who swaps documents with every change, the database goes stale within a few months. The assistant starts quoting out-of-date prices and the team stops using it.
Questions about RAG we hear from sales and customer service teams
RAG: what is it?
RAG (retrieval-augmented generation) is a technique in which an AI model first retrieves relevant passages from documents and then writes an answer based on them. As a result, it answers in line with company knowledge, not just the general knowledge it was trained on.
How is RAG different from ordinary ChatGPT?
An ordinary chatbot answers from the knowledge the model acquired during training and does not know your company’s documents. RAG adds a stage of searching your documents. The answer is then based on current price lists, procedures or contracts, ideally with the source cited.
Does RAG eliminate AI hallucinations?
No. A 2024 Stanford study showed that RAG-based legal tools were wrong in 17–33% of cases. RAG reduces the number of fabrications, but that requires good documents, cited sources and human oversight from someone who glances at where the assistant got its information before the answer is sent to a customer.
What is a RAG chatbot?
It is a chatbot that answers on the basis of company documents (policies, price lists, manuals) rather than a rigid script. A well-built one shows which document the answer comes from. It hands difficult cases over to a human.
How much does implementing RAG cost?
Technical fees can be modest. In the OpenAI API, document storage costs USD 0.10 per GB per day (first GB free) and search USD 2.50 per 1,000 queries (as at 24.09.2026). The biggest cost is organising documents, setting permissions and testing.
Can I do RAG in ChatGPT without a developer?
Yes. On ChatGPT business plans (Business, Enterprise, Edu) you can create a GPT with attached knowledge, up to 20 files of 512 MB each. For larger document sets, complex permissions and integration with company systems you need a solution built by a specialist, who will also make sure everyone sees only the files they are entitled to.
What is a vector database?
It is a database that stores passages of text as sequences of numbers describing their meaning. This allows it to find a passage whose meaning matches the question, even if it doesn’t contain the same words.
Sources
- SOURCE
- SOURCE
- SOURCEeesel AI: OpenAI Agents API pricing (file search, storage) · 11 September 2026
- SOURCEOpenAI API — pricing · as of 24 September 2026
- SOURCEOpenAI Help Center: Creating and editing GPTs (knowledge limits) · as of 24 September 2026
- SOURCECloudZero: OpenAI API pricing in 2026 · 4 September 2026
Read next
We help build an assistant on your company’s knowledge, with organised documents, source citations and access control. We start with a free diagnosis.
Sebastian Kopiej, CEO of Commplace®. In public relations since 1996. Written with the help of AI tools and editorially verified by the author. Data current as of 24 September 2026.