AIAI Academy

Module 2: Uses · 3 min read

RAG: Giving AI Your Business's Knowledge

How to make a model answer from your documents instead of its memory, and when that beats training a model.

A language model knows a lot about the world, but nothing about your business: what the return policy is, what a contract with a particular customer says, or what the internal procedure is for a system failure. When you ask it, it may make up an answer that sounds reasonable. RAG solves this.

What RAG is

RAG stands for Retrieval-Augmented Generation. The method was introduced in a 2020 paper by researchers at Facebook AI Research (now Meta). The idea is simple: before the model answers, you search your documents for the relevant passages, attach them to the question, and ask the model to answer only on their basis.

It's like the difference between a closed-book exam and an open-book exam.

How it works, in four steps

  1. Chunking: documents are split into small passages, such as a paragraph or a section.
  2. Embedding: each passage becomes a vector, a list of numbers representing its meaning. Passages on the same topic get similar numbers, even if the words differ.
  3. Retrieval: when a question arrives, it also becomes a vector, and the system finds the passages closest in meaning. A question about a "money back" will also find a section on "refunds."
  4. Generation: the passages found go into the context window along with the question, and the model answers based on them, usually with a reference to the source.
🎬 What is Retrieval-Augmented Generation (RAG)? · IBM Technology

RAG or training a model?

A common question in business: why not train the model on our documents? Fine-tuning changes the model itself, while RAG only changes what it reads for each question.

RAG is better when:

  • The information changes. Update a document and the answers update immediately, with no retraining.
  • It matters to know where the answer came from.
  • Not every user is allowed to see every document. With RAG you can filter retrieval by permissions.

Fine-tuning is better when: you need to permanently change the model's style or format, not give it facts. Many systems combine both.

🎬 RAG vs. Fine Tuning · IBM Technology

Where you already meet RAG

When you upload a file to ChatGPT or Claude and ask about it, when you use NotebookLM, and when you talk to a support bot that cites the company's help center. Each of these has some form of RAG built in.

Common mistakes

  • Outdated documents. If the repository has two versions of a policy, the model may cite the old one.
  • Chunks too small or too large. A small chunk loses context, and a large one brings noise.
  • No instruction to admit not knowing. If the answer isn't in the documents, the model should say so and not fill in from its general knowledge.

Bottom line: RAG finds the relevant passages in your documents and lets the model answer based on them. It's the accepted way to build an assistant that knows the business, and the first step in almost every AI customer service project.

Sources

Read next