When a company decides to build an AI system on its own data, one of the first technical questions is how to make a general model know about the business. Two techniques come up again and again: RAG and fine-tuning. They are often presented as alternatives, and teams sometimes choose between them based on what sounds more advanced. That usually leads to the wrong choice.
This guide explains what each technique actually does, when each one fits, what they cost, and how to decide with measurements rather than intuition. If you are new to retrieval, our RAG architecture guide covers how it works in detail.
What RAG Does
RAG stands for retrieval augmented generation. The idea, described in the original research paper by Lewis and colleagues, is simple: before the model answers, the system searches your documents for the passages most relevant to the question and adds them to the prompt. The model then answers using that material.
In practice, a RAG system has a few parts:
- Ingestion. Documents are collected from their sources, cleaned and split into passages.
- Indexing. Each passage is turned into a numerical representation, called an embedding, and stored in a search index, often together with keyword search.
- Retrieval. When a question arrives, the system finds the most relevant passages, sometimes re-ranking them for precision.
- Generation. The model receives the question and the passages, with instructions to answer only from them and cite its sources.
The model itself does not change. What changes is what it sees at the moment it answers.
What Fine-Tuning Does
Fine-tuning continues the training of an existing model on your own examples: pairs of inputs and the outputs you want. The model's internal weights change, so it learns to behave in a certain way without needing long instructions every time.
Fine-tuning is good at teaching behavior: a format, a tone, a classification scheme, a way of extracting fields from documents. It is much less good at teaching facts. A tuned model may remember some of what it saw, but it cannot tell you where an answer came from, it may mix facts up, and every change in the underlying information requires new training.
Model providers document the process and its limits, for example in OpenAI's fine-tuning guide, which itself recommends trying prompts and retrieval first.
The Core Difference in One Table
| RAG | Fine-tuning | |
|---|---|---|
| What it changes | What the model sees per question | How the model behaves |
| Best for | Knowledge, especially when it changes | Format, tone, narrow repeated tasks |
| Updating knowledge | Update the documents | Retrain the model |
| Citing sources | Natural | Not possible |
| Data needed | Your documents | Many curated input and output examples |
| Upfront cost | Pipeline and index | Data curation and training runs |
| Main risk | Poor retrieval returns the wrong passages | Model learns the wrong things, drifts with new base models |
| Access control per user | Possible at retrieval time | Very hard |
Why Most Business Projects Should Start With RAG
Most business AI problems are knowledge problems. Customers ask about products, prices and policies. Employees ask about procedures, contracts and past decisions. That knowledge changes every week, it differs between departments, and some of it must not be seen by everyone.
RAG fits this naturally:
- Fresh answers. When a policy changes, you update the document and the next answer reflects it.
- Traceable answers. Each answer can show the sources it used, which builds trust and makes errors easy to diagnose.
- Access control. Retrieval can filter documents by the user's permissions, so a sales rep and an HR manager see different sources.
- Lower cost to start. No training runs, and the same pipeline serves many use cases.
- Model independence. When a better model appears, you can switch with relatively little work, because your knowledge lives in the index, not inside one model.
Most of the quality gains in a typical project come from better retrieval and better prompts: cleaning documents, choosing how to split them, combining keyword and semantic search, re-ranking results and writing precise instructions. These are less glamorous than training a model, and far more effective.
When Fine-Tuning Earns Its Place
Fine-tuning is the right tool in specific situations:
- Strict, consistent output. For example, extracting the same twenty fields from thousands of invoices in an exact structure, where prompts alone produce occasional format errors.
- A distinct style or voice that must be held across very many outputs and is hard to describe in instructions.
- Narrow, high-volume tasks. Classifying tickets into categories or detecting intent, where a small tuned model can match a large general one at a fraction of the cost and latency.
- Domain language that general models handle poorly, when you have many high-quality examples.
Notice that none of these is "teach the model our knowledge". They are about behavior and efficiency.
Cost and Effort Compared
RAG costs are mostly engineering: building the ingestion pipeline, setting up the index, tuning retrieval and writing prompts. Running costs include the index and the extra tokens of retrieved passages in each request. Keeping it current means keeping documents current, which is often a process question more than a technical one.
Fine-tuning costs start with data. You need hundreds to thousands of high-quality examples of the exact behavior you want, and creating them is usually the biggest expense. Then come training runs, evaluation and, later, repeating the process when the base model is retired or the task changes. In return, a tuned smaller model can reduce per-request costs at high volume.
Our guide on how much an AI agent costs explains how to estimate running costs per task for either approach.
Using Both Together
RAG and fine-tuning are not rivals. Mature systems often combine them:
- Retrieval supplies the facts.
- A tuned or smaller model handles a specific step, such as classifying the request or formatting the output.
- A general model handles reasoning and drafting.
The order matters. Build and measure retrieval with prompts first. Add fine-tuning only for a specific step where measurements show a persistent gap, and where you have the data to close it.
Deciding With Measurements
The honest answer to "RAG or fine-tuning?" is: measure. A practical process:
- Build an evaluation set. Collect real questions or inputs with the expected answers or outputs, including hard and adversarial cases.
- Start simple. A strong general model with good prompts. Measure.
- Add retrieval. Improve ingestion, splitting and search. Measure after each change.
- Find the remaining gap. Is it missing knowledge, wrong format, inconsistent tone, cost or latency?
- Choose the fix that matches the gap. Missing knowledge points to better retrieval. Format, tone or cost at volume may point to fine-tuning.
- Measure again. Keep the change only if the numbers improve.
Without an evaluation set, every choice is a guess, and the more impressive-sounding technique tends to win the argument.
A Worked Example: An Insurance Agency
Here is how the decision plays out in a typical project. The details are illustrative.
An insurance agency wants an assistant that helps its staff answer customer questions about policies, coverage and claims procedures. It has hundreds of policy documents from several insurers, internal procedures and a few years of answered customer emails.
The first idea on the table is to fine-tune a model on all the documents and emails, so that it "knows insurance". The team builds an evaluation set first: two hundred real questions with correct answers, written with two senior agents, including tricky cases where two policies differ only in small print.
With a strong general model and no retrieval, the assistant answers about half the questions correctly and invents details for the rest. Adding retrieval over the policy documents, split by section and filtered by insurer and policy type, raises the score sharply, and every answer now shows the clause it relied on. Improving how tables in the policies are extracted and adding keyword search for policy numbers closes most of the remaining gap.
What is left is a formatting issue: staff want answers in a fixed structure, with coverage, exclusions and next steps, and the model sometimes drifts from it. Better instructions and a few examples in the prompt fix most cases. Fine-tuning is kept as an option for later, if volume grows and a smaller, cheaper model needs to hold the format on its own.
The whole process took a few weeks, and each decision was backed by a number on the same evaluation set. The project never needed to teach the model insurance. It needed to give the model the right page at the right moment.
Questions to Ask Your Development Team
If a vendor or an internal team proposes one approach, these questions show whether the choice is grounded:
- What evaluation set will we use, and who writes the expected answers?
- What score do we get with prompts alone, and with retrieval?
- What exactly is the gap that fine-tuning would close?
- How many training examples would we need, and who would create them?
- How will we keep the system current when documents change?
- How do we make sure users only see information they are allowed to see?
A team that answers these with numbers and a plan has thought the problem through. A team that answers with the name of a technique has not.
Common Mistakes
- Fine-tuning to add knowledge. The model answers confidently, cannot cite sources and goes stale as soon as information changes.
- Blaming the model for retrieval problems. When answers are wrong, the cause is usually that the right passage was never retrieved.
- Skipping document quality. Outdated and contradictory documents produce outdated and contradictory answers, whatever the technique.
- No access control. A RAG system that lets every user retrieve every document can leak sensitive information.
- No evaluation. Changes are judged by a few manual tries instead of a stable test set.
- Tuning too early. Training data is collected before anyone knows which behavior is actually missing, so the effort goes into the wrong examples.
- Ignoring maintenance. A tuned model is tied to a base model that will eventually be retired, and the training has to be repeated and re-evaluated on the new one.
How Agentixly Approaches It
As a software house in Israel, we start almost every knowledge-based AI project with retrieval and careful prompts, built on an evaluation set from your real data. We invest in the parts that usually decide quality: document pipelines, hybrid search, re-ranking and access control by user. When measurements show a gap that tuning can close, such as strict extraction at high volume, we fine-tune a model for that step and keep everything else model-independent.
If you are planning an AI project and wondering which approach fits, read our guide on choosing a software house for AI, see how we work as a software house and our web development services, or tell us about your data and your goal. An engineer will get back to you within 24 hours.
FAQ