Skip to content

Term

What is RAG? AI that looks it up before it answers

How a language model learns to use your manuals and contracts without retraining, what a question costs, and where it breaks.

The OpenAI business plans page, where a company assistant on your own documents starts
RAGstands for Retrieval-Augmented Generation
RAG is a technique in which an AI language model first retrieves the relevant passages from your own documents and then answers from those passages, citing the source.
Also calledretrieval-augmented generationretrieval augmented generationgrounded generation

By , Founder and CEO

6 min read
On this page
  1. 01Why a language model does not know your price list
  2. 02Five steps between a question and a sourced answer
  3. 03One manual set in three languages
  4. 04Retrieve, retrain or send everything
  5. 05The bill per question: usually cents
  6. 06Where an assistant on your own documents goes wrong

Why a language model does not know your price list

With RAG an AI assistant answers from your manuals, contracts and procedures instead of from memory. That memory is what a large language model learned in training: plenty of general knowledge, nothing about the terms you agreed with a supplier last month. Ask such a model about your own rates anyway and you get an answer that sounds right and is not. That is an AI hallucination.

Think of an open-book exam. The model stays the same, but for every question it gets the right pages in front of it. The idea comes from a paper by Patrick Lewis and eleven colleagues, with researchers at Facebook AI, first published in May 2020. In September 2020 Facebook AI spelled out what it means for a business: you change what the system knows by swapping the documents, without retraining the model. It has since become the standard way to put AI to work on company knowledge.

Five steps between a question and a sourced answer

  1. Chunking. Your documents are cut into passages of a few hundred tokens each, about a paragraph or half a page, each with its source.
  2. Embedding. An embedding model turns every passage into a list of numbers that captures its meaning; Voyage AI returns 1,024 by default. Passages on the same subject sit close together, across languages too.
  3. Storing. Text, source and numbers go into a database that searches by similarity.
  4. Retrieving. The question becomes a list of numbers as well, and the system pulls the passages closest to it. A second search on exact words catches part numbers and error codes that a meaning-based search can miss.
  5. Generating. The best three to ten passages go to the model with the question and an instruction to answer only from them and cite the source. How to write that instruction is in prompt.

Retrieval decides the quality, not the model. Anthropic measured that passages with a line of added context, plus a search on exact words, cut failed retrievals by 49%; with an extra ranking step (reranking), by 67%.

Index once, retrieve on every question

Once per document: indexing

  1. 2,000 pagesDocumentsManuals in Dutch, German and French, plus service reports.
  2. ChunkingPassagesA paragraph or half a page each, with the source attached.
  3. EmbeddingNumbersEach passage becomes a list of 1,024 numbers that captures its meaning.
  4. IndexDatabaseText, source and numbers together, searchable by similarity.

Every question: retrieve, then answer

Asked in German: “Fehler F28 an der Siegeleinheit, was jetzt?”

  • Service manual (FR), p. 140.86

    The page on F28, written in French.

  • Service report, last visit0.79

    Which machine this customer runs and what was replaced.

  • Operator manual (DE), p. 30.52

  • Returns procedure0.31

Only passages above the line go to the model

F28 means the sealing jaws do not reach temperature. Check the heater connector first; if the fault returns, replace the heating element, as on the last visit.

  • Service manual (FR), p. 14
  • Service report, last visit

The model stays the same. What changes is the text it gets to read for each question.

One manual set in three languages

Take a maker of packaging machines with 2,000 pages of manuals in German, French and English, plus service reports from customers across Europe. A field engineer types in German: "Error F28 on the sealing unit, what now?" The system finds the French page that describes F28 and the report from the last visit to that customer, and the answer names both sources. A multilingual embedding model makes that work: meaning lies close together even when the words differ.

When a new machine ships, you index its manual. Nobody retrains anything, which is the real difference with fine-tuning.

Retrieve, retrain or send everything

ApproachWhat it doesChoose it whenWhat you pay
RAGFinds the matching passages per question and passes only those to the modelYou have more than a few hundred pages that keep changingIndexing once, then a few thousand tokens per question
Everything in the promptSends the whole knowledge base with every questionYour knowledge stays under about 500 pages, such as a price list and ten proceduresThe full text per question, cheaper with prompt caching
Fine-tuningTrains a model further on examples so it learns a style or formatYou want a fixed tone or output, not new factsA training run plus pricier use, again after every change
A plain chatbotAnswers from its training and whatever you paste inYou write general text without your own data; see ChatGPT vs ClaudeA subscription per user

Fine-tuning teaches a model how to write; RAG gives it what to know. Facts that change, such as prices, stock and rules, belong in RAG.

The bill per question: usually cents

For the machine maker above, in US dollars before tax:

ItemHow it is countedCost
Indexing 2,000 pages, onceabout 800,000 tokens with voyage-4 at 0.06 dollars per million5 cents, and the first 200 million tokens are free
One question on Claude Sonnet 5.53,000 tokens in (question, instruction, five passages) and 400 outabout 1 cent
The same question on Claude Haiku 5.5same tokens at 0.10 and 0.50 dollars per millionabout 0.05 cents
1,000 questions a monthSonnet 5.5about 10 dollars
Everything in the prompt, for comparison200,000 tokens per question from the Sonnet 5.5 cacheabout 2.4 cents per question

So the model is rarely the big line. The real work is cleaning documents, making scanned PDFs readable, setting permissions per employee and testing until the answers hold. Run your own volume through the AI cost calculator; what the build itself costs is in AI chatbot cost.

Where an assistant on your own documents goes wrong

  • Scanned PDFs without textA scan is a picture; without text recognition there is nothing to find.
  • Tables split in twoA price table cut across two passages gives half answers. Split on headings and keep tables whole.
  • Old versions next to newWith the 2024 and the 2026 rates both indexed, the model sometimes picks the wrong one. Keep one source per subject.
  • Everyone sees everythingAn assistant that also searches payslips must know who is asking. Permissions belong in retrieval, not in the prompt.
  • Documents from outsideA supplier's PDF can carry hidden instructions; see prompt injection.
  • Personal dataWhen a provider processes your documents you need a data processing agreement. The full roadmap is in implementing AI in your business.

Ready for a pilot? Bring these

  • Fifty real questions your team asked last month, each with the right answer.
  • The documents those answers live in, latest version, as text rather than scans.
  • A list of who may see what: office, field staff, management.
  • Which provider processes your data, and in which region.
  • An agreement on what happens when the answer is not in the documents.

Questions buyers ask before a pilot

Do I need to train my own AI model?

Almost never. You use an existing model and hand it the right passages for each question. Indexing a new manual costs a few cents; retraining a model takes days and has to be repeated after every change.

From how many documents does this pay off?

Below roughly 500 pages you can send the full text with every question, especially with prompt caching. Above that, or when documents change often, retrieval is cheaper and faster.

Do my documents stay private?

That depends on where it runs. Pick an environment where your data is not used to train models, sign a data processing agreement with the provider, and set permissions per employee so an intern never sees payslips.

Does it work across languages?

Yes. A multilingual embedding model places meaning close together even when the words differ, so a question in German finds a French manual and the answer comes back in German.

AI for business

How VBS builds an assistant on your documents

We start from the questions your team asks every day, run a pilot on part of your documents and measure per answer whether it is right and where it came from. Only then do we build on: a custom ChatGPT for your team or an AI chatbot on your site, with permissions per employee. Showing sources is a habit with us: for Business Centrum every figure on the site sits in a register with its official source, more than 6,800 of them. See AI for business or book a call.

Which documents does your team search every day?

We run a pilot on part of your own documents and show you, per answer, where it came from.

Optional, if you prefer a call.

What do you want to achieve, and what is already there?

We only use your details to reply to you.