Skip to content

RAG Explained: How to Make AI Answer From Your Own Data (and When Not to Use It)

RAG lets an AI model look up your own documents before it answers, so replies are current, specific and traceable to a source. Here is how it works and where it goes wrong.

Ask a general AI model about your return policy, your pricing tiers or last quarter’s contract terms and it will either guess or admit it does not know. It was never trained on your data. Retrieval-augmented generation (RAG) is the most practical way to fix that, and it is behind most useful “chat with your documents” systems.

How RAG works

The idea is simple: find the relevant text first, then ask the model to answer using it.

  1. Ingest. Your documents (PDFs, wiki pages, emails, product data) are split into chunks.
  2. Index. Each chunk is converted into an embedding, a numeric representation of its meaning, and stored in a vector database or search index.
  3. Retrieve. When someone asks a question, the system finds the chunks closest in meaning to it.
  4. Generate. Those chunks are handed to the language model along with the question, with the instruction to answer from them and cite the source.

The model does not need to memorise your data. It reads the right pages at question time, like an open-book exam.

Why businesses choose RAG

  • Fresh answers. Update a document and the next answer reflects it. No retraining.
  • Sources you can check. Good RAG systems show where an answer came from, which builds trust and makes errors easy to spot.
  • Access control. Retrieval can be limited to what each user is allowed to see, so staff only get answers from documents they have rights to.
  • Lower cost than training. You use an existing model and pay for indexing and queries.

See how this plays out for internal teams in our post on an AI knowledge base for employees.

RAG vs fine-tuning

These get confused constantly. A rough rule:

  • Use RAG when the problem is knowledge: facts, policies, product details, anything that changes.
  • Use fine-tuning when the problem is behaviour: a consistent tone, a strict output format, a specialised task style.
  • Use both only when you have shown that RAG alone is not enough.

Most business needs are knowledge problems, so RAG is usually the right first step.

Where RAG projects go wrong

Bad source material. Outdated, contradictory or scanned-and-unreadable documents produce confident wrong answers. Clean the content before you blame the model.

Poor chunking. Splitting a table or a numbered procedure in the wrong place destroys its meaning. Chunk by structure (sections, headings), not just by character count.

Retrieval that misses. If the right passage is never retrieved, the model cannot use it. Combining keyword and semantic search, and re-ranking the results, often improves quality more than switching models.

No evaluation. Build a set of real questions with known good answers and re-test after every change. Without it you are guessing whether things improved.

Ignoring privacy. Sending sensitive documents to an external model API may not be acceptable for your data. Options range from enterprise API agreements to running models locally; we compare them in private LLM for business.

When you do not need RAG

If your content fits comfortably in a single prompt (a short FAQ, a one-page policy), just include it directly. And if the AI needs to do things rather than read things, such as creating a booking or updating a record, you need tool access, which is where the Model Context Protocol (MCP) comes in. RAG gives the AI knowledge; MCP gives it hands.

A sensible way to start

  1. Choose one document set with a clear audience (support FAQs, HR policies, product manuals).
  2. Write 30 to 50 real questions people ask about it.
  3. Build a small RAG pipeline with citations and test it against those questions.
  4. Fix content and retrieval problems, then widen the scope.

Want a RAG system that answers from your documents, with sources and proper access control? Tell us about your use case and we will propose a focused first version.

Share
Working on something similar?

I take on a small number of projects at a time. Tell me what you are building and I will tell you honestly whether I am the right person for it.

Get in touch →

1 comment

Leave a Reply

Your email address will not be published. Required fields are marked *