All posts

RAG explained: giving AI access to your company’s knowledge

Large language models know a lot about the world but nothing about your internal documents. Retrieval-augmented generation (RAG) closes that gap. Here’s how it works.

Large language models are trained on huge amounts of public text. They’re fluent and knowledgeable, but they know nothing about your contracts, your product documentation or last week’s policy update. Ask them anyway and they may produce a confident answer that is simply made up.

Retrieval-augmented generation, or RAG, is the most common way to fix this.

The problem RAG solves

There are three reasons a model alone can’t answer questions about your business:

  • It has never seen your data. Internal documents weren’t part of its training.
  • Its knowledge stops at a point in time. Anything newer is missing.
  • It fills gaps by guessing. Without the right information, it can produce answers that sound right but aren’t.

How RAG works

RAG gives the model the right information at the moment it answers. It works in four steps:

  1. Prepare your content. Documents are collected from places such as shared drives, wikis and help centers, split into sensible passages, and indexed so they can be searched by meaning, not just by keywords.
  2. Retrieve. When someone asks a question, the system finds the passages most relevant to it.
  3. Generate. The model receives the question together with those passages and writes an answer based on them.
  4. Cite. The answer links back to the source passages, so people can check them.

Why citations matter

Citations turn an AI answer from “trust me” into “here’s where this comes from”. They let people verify important answers, help you spot outdated documents, and make adoption much easier, because people trust what they can check.

RAG or fine-tuning?

The two are often confused:

  • RAG gives the model knowledge. Use it when the answer lives in your documents, especially when those documents change.
  • Fine-tuning changes the model’s behavior: its tone, format or how it handles a specialized task. It is a poor way to teach facts that change.

Many production systems use RAG for knowledge and careful instructions, or sometimes fine-tuning, for style.

What makes RAG work well in practice

The model is rarely the weak point. Results depend on:

  • Clean sources. Remove duplicates and outdated versions, and decide which documents are authoritative.
  • Good splitting. Passages should keep enough context to make sense on their own.
  • Hybrid search. Combining meaning-based search with keyword search catches product codes, names and exact phrases.
  • Permissions. People should only get answers from documents they’re allowed to see.
  • Freshness. Keep the index in sync as documents change.
  • Evaluation. Build a set of real questions with known answers and test against it before every change.

Common pitfalls

The most common problems we see are indexing everything without curating it, ignoring access permissions, and launching without a way to measure answer quality. Each is easy to avoid if you plan for it from the start.

Thinking about a knowledge assistant for your team? Tell us what you have in mind.

Want help putting this into practice? Let’s talk.