Ask a general AI chatbot about your company's refund policy and it will give you a confident, reasonable-sounding answer. It may also be completely wrong, because the model has never seen your refund policy.
Retrieval-augmented generation (RAG) fixes that. Instead of relying on what the model learned during training, a RAG system first looks up the relevant parts of your documents, then asks the model to answer using only those passages. It's the technique behind most useful "chat with your documents" tools.
How RAG works, step by step
A RAG system has two halves: preparing your documents ahead of time, and answering questions when they come in.
Preparing the documents (indexing):
- Collect the sources: policies, manuals, help-centre articles, contracts, product sheets.
- Split each document into small passages, typically a few paragraphs each.
- Embed each passage: convert it into a list of numbers (a vector) that captures its meaning, so passages about similar topics end up close together.
- Store the vectors in a search index, often called a vector database.
Answering a question (retrieval and generation):
- The user's question is embedded the same way.
- The system retrieves the passages whose meaning is closest to the question, usually combined with ordinary keyword search, which is better at exact names and codes.
- Those passages are placed into the prompt with an instruction along the lines of: "Answer using only the sources below. If the answer isn't there, say so."
- The model writes the answer and cites the passages it used.
Why not just fine-tune a model?
Fine-tuning changes a model's behaviour: its tone, format or specialised skills. It is a poor way to teach it facts that change. Your price list will be out of date next quarter, and retraining a model every time a document changes is slow and expensive.
With RAG, updating the knowledge is as simple as updating the document. Answers can also point to their source, so people can check them, which matters a lot in legal, medical, financial and support settings.
| RAG | Fine-tuning | |
|---|---|---|
| Best for | Answering from specific, changing information | Changing style, format, or narrow skills |
| Updating knowledge | Re-index the changed document | Retrain the model |
| Shows sources | Yes | No |
| Typical starting cost | Lower | Higher |
In practice, most business assistants start with RAG, and many never need fine-tuning at all.
Where RAG projects go wrong
The model is rarely the problem. Most failures come from the retrieval step:
- Messy source documents. Scanned PDFs, duplicated versions and outdated pages produce bad passages. Garbage in, garbage out.
- Poor splitting. Cutting a table or a numbered procedure in half separates the question from its answer.
- Retrieval that misses. If the right passage isn't retrieved, the model can't use it. Combining semantic and keyword search, and re-ranking results, usually helps a lot.
- No "I don't know". The assistant must be told, and tested, to admit when the documents don't contain the answer, instead of filling the gap with a guess.
- Ignoring permissions. If HR documents are in the index, the system must make sure people only get answers from files they're allowed to see.
- No measurement. Without a set of real test questions with known correct answers, every change is guesswork.
How to tell if you need it
RAG is a good fit when:
- People repeatedly ask questions whose answers are buried in documents.
- The information changes often enough that people struggle to keep up.
- Answers need to be traceable to a source.
Common examples include internal help desks for policies and IT, customer support assistants grounded in your help centre, sales teams searching product specs and past proposals, and staff onboarding.
A sensible way to start
Pick one narrow use case with a clear owner, for example "answer questions about our HR policies". Collect 30–50 real questions people have asked, along with the correct answers. Build a small prototype against just those documents and measure how many it gets right, with citations. That number tells you more than any demo.
We build RAG assistants and knowledge bases that cite their sources and know when to say "I don't know". If you're weighing one up, tell us what you're working with.
The RightNow Tech designs and builds AI, web, and cloud systems that hold up in production.
Seven business tasks you can automate this month
Most teams lose hours every week to copy-paste work between tools. These seven automations are quick to set up, low-risk, and pay for themselves fast.
Website builder or custom website? How to choose for your business
Wix, Squarespace, WordPress, Shopify, or a custom-built site: an honest comparison of cost, speed, flexibility and ownership, and how to pick the right one.
