Skip to content

Article · 11 min read · Updated Oct 22, 2026

RAG vs fine-tuning vs prompting: how to give AI your company's knowledge

Use RAG when the AI must answer from changing company documents and cite sources, and fine-tuning when it must behave consistently, such as a fixed format or narrow classification. Start with prompting, because a small, stable body of context often needs neither. This guide is written for business buyers at companies of roughly 20 to 200 people.

Farzan AnsariCofounder and CTO

Key takeaways

  • Prompting gives the model instructions and context in the request itself, and it is the cheapest approach to try first.
  • Retrieval (RAG) looks up your documents at question time, so answers stay current and can cite their sources.
  • Fine-tuning changes how a model behaves, not what it knows, so it is a poor way to teach it company facts.
  • Retrieval must respect document permissions, or the assistant will show people content they were never allowed to read.
  • The approaches are additive, and most business systems end up with prompting plus retrieval, and fine-tuning only for a specific, proven need.

Almost every company that wants AI to "know our business" ends up in the same conversation. Someone has heard that you have to train the model on your documents, someone else says you only need search, and a vendor proposes a project that costs more than either. The choice matters because the three common approaches fail in different ways, and the wrong one is expensive to unwind.

RAG vs fine-tuning vs prompting: how do they compare?

Use prompting when the context is small and stable, RAG when the AI must answer from large or changing documents and show its sources, and fine-tuning when the model must behave the same way every time.

  • Use prompting when everything the AI needs fits in the request and rarely changes.
  • Use RAG when answers must come from documents that change, differ by user permission or need a citation.
  • Use fine-tuning when the answers are right but the format, tone or category is inconsistent.
PromptingRAGFine-tuning
What it changesWhat the model is toldWhat the model can look upHow the model behaves
Best forSmall, stable context; formatting and tone instructionsLarge or changing documents; answers that need citationsConsistent format, style or narrow classification
Handles changing factsYes, if you edit the promptYes, re-index the changed documentsNo, requires retraining
Time to updateMinutes, edit the promptA few minutes to re-index, according to AWSA few hours to days, according to AWS
Can cite sourcesIf the sources are in the promptYes, by designNo
Hallucination riskDepends on the prompt and the context suppliedReduced, because answers are grounded in retrieved textCan increase when used to answer questions
Document permissionsWhatever is pasted in is visible to the userEnforced in the retrieval step, per userAnything in the training data can surface for any user
Effort to startHoursWeeks, mostly search quality and permissionsWeeks, mostly preparing and labeling examples
Ongoing upkeepEdit the promptKeep the index and permissions in syncRetrain when behavior or the base model changes
Typical mistakePasting too much and paying for it every callWeak search that retrieves the wrong passagesUsing it to teach facts

What are prompting, RAG and fine-tuning?

Each approach answers a different question about where the AI gets its information and its habits.

  • Prompting means writing instructions and supplying context in the request itself. You tell the model its role, the format you want, and paste in the material it needs for this task.
  • Retrieval-augmented generation (RAG) means the system first searches your documents for the passages relevant to the question, then gives those passages to the model along with the question. The model answers from what was retrieved.
  • Fine-tuning means training an existing model further on examples you supply, so that it behaves in a particular way without being told each time.

A useful way to hold the difference: prompting and RAG change what the model sees. Fine-tuning changes how the model behaves. OpenAI's guidance frames it the same way, describing RAG as giving the model access to domain-specific context, and fine-tuning as making sure the model can learn a task so it performs it consistently and reliably.

When is prompting enough?

More often than people expect. OpenAI's accuracy guide says prompt engineering is typically the best place to start, and notes that tasks such as summarization and translation can reach production accuracy with prompting alone.

Prompting fits when the context is small, stable and the same for everyone. A twelve-page policy, a pricing sheet that changes twice a year, a house style guide, a fixed set of product descriptions: all of these can sit directly in the request. Modern models accept long inputs, so "small" is generous. You get the simplest possible design, nothing to index, and nothing to keep in sync.

It stops being enough in three situations: the material is too large or varies too much to include every time, different users are allowed to see different documents, or the answers need to cite a specific source.

What are the advantages of RAG over fine-tuning?

RAG is the right default when the AI has to answer from facts that change, from more material than fits in one request, or with a source the user can check.

The practical advantages over fine-tuning are the ones a business reader cares about. AWS's guidance for choosing between the approaches notes that RAG can incorporate the latest documents in a few minutes, that its responses can point to the information source, and that grounding the answer in retrieved text reduces the risk of hallucination, where a model produces a plausible but wrong answer. A fine-tuned model, by contrast, does not provide a reference to the source in its responses.

That makes retrieval the natural fit for questions like "what is our current returns policy for wholesale customers" or "which clause in this contract covers early termination." The answer lives in a document, the document gets updated, and the user wants to see where it came from. Our guide to building an AI assistant on your company knowledge covers this pattern end to end.

RAG has limits worth knowing. AWS points out that it does not work well for summarizing information from entire documents, because retrieval returns passages rather than the whole file. And irrelevant retrieved content can make answers worse, which is why the quality of the search step, not the model, usually decides whether a RAG system is any good.

What are the advantages of fine-tuning over RAG?

Fine-tuning beats RAG when the problem is consistency of behavior rather than missing information. AWS lists two advantages: a model trained without labels on your own content can create text that more closely matches your organization's style, and one trained on proprietary or regulatory data can help follow in-house or industry-specific standards. OpenAI ties it to cases where you need consistent format, tone and reasoning, and it notes that the quality of training data matters more than the quantity.

Good candidates:

  • A fixed output format. Every extraction must return the same fields in the same structure, and prompting still produces occasional drift.
  • A narrow classification. Routing support requests into twenty internal categories, or tagging documents with your own taxonomy, where you have hundreds of labeled examples.
  • A house voice or style. Drafts that must match how your company writes, at volume, without a long prompt on every call.
  • Shorter prompts at scale. When a very long instruction set is repeated on millions of calls, training the behavior in can reduce what you send each time.

The mistake to avoid is fine-tuning to add facts. Training bakes in a snapshot of whatever the data said on the day you trained. It cannot cite a source, it does not update when a policy changes, and it can raise the risk of confident wrong answers. AWS lists the same drawbacks: fine-tuning can take hours to days, so it is a poor solution when your documents change frequently, and it can increase the risk of hallucination when used to answer questions.

Illustrative example: Consider a distributor whose customer service team answers questions from a large pricing and returns policy that is revised every month. An early proposal suggests fine-tuning a model on the policy so it "knows" it. The first version works on the day it is trained. Three weeks later a returns window changes, the model keeps quoting the old one, and nobody can tell which answers are out of date because none of them cites a source. Rebuilding the same assistant with retrieval fixes both problems: the policy document is re-indexed when it changes, and every answer links to the paragraph it came from. Fine-tuning is only worth revisiting later, if the replies are accurate but inconsistent in tone.

Can you combine RAG and fine-tuning?

Yes, RAG and fine-tuning can be combined, and the approaches are additive rather than exclusive. OpenAI's guide describes them that way, and the AWS guidance notes that you can combine fine-tuning and RAG in a single system, with the model both trained for the task and given retrieved context. In practice, start with prompting, add retrieval when the context outgrows the prompt, and fine-tune only when you have measured a behavior problem that the other two did not solve.

What drives the cost of RAG, fine-tuning and prompting?

Each approach spends money in a different place, and the cheap one to build is not always the cheap one to run.

  • Prompting costs are mostly per-call. Every token you paste in is billed on every request, so a large static prompt on a high-volume workflow adds up. Some providers discount repeated prompt prefixes, which is worth checking.
  • RAG has setup costs (connecting sources, cleaning documents, building the index) and running costs (storage and search for the index, plus the longer model input that retrieved passages create). The largest ongoing cost is human: someone has to own document quality, because stale or contradictory source files produce stale or contradictory answers.
  • Fine-tuning has up-front costs for preparing and labeling training data and running the training, then a recurring cost every time the base model is retired or your requirements change, because the tuned model has to be rebuilt. Fine-tuned models also tie you more tightly to one provider, which adds to vendor lock-in.

No honest price exists for any of the three without knowing your volume and data, so treat anyone who gives you a number before seeing your documents with caution. A discovery call is the right place to size it against your own workload.

How do you keep retrieval inside document permissions?

Document permissions are the control most RAG pilots skip, and skipping them causes the worst incidents. If a RAG assistant searches across every document in the index, it can quote an HR file, a board paper or a salary table to anyone who asks the right question. The model is not the control. Access has to be enforced in the retrieval step, before the passages ever reach the model.

Microsoft's documentation for Azure AI Search describes the pattern: permission metadata is stored alongside each indexed document, and at query time the search service compares the caller's identity to that metadata and returns only the documents the caller is authorized to read. Several mechanisms exist, including simple security filters, access control lists from file storage, Microsoft Purview sensitivity labels and SharePoint permissions. The same documentation is explicit about a trade-off that applies to any RAG design: permission changes in the source system only show up in search results after that metadata is synchronized into the index.

That gives you a short checklist for any retrieval project:

  1. Decide which sources are in scope, and leave out anything you cannot permission correctly.
  2. Carry each document's access rules into the index, not only its text.
  3. Filter by the signed-in user's identity on every query, never by a shared service account.
  4. Set how quickly permission changes in SharePoint, a file share or a CRM must reach the index, and test that a revoked user loses access in that time.
  5. Log what each user asked and which documents were returned, so an access question can be answered later.

Fine-tuning has the opposite problem. Anything in the training data can surface in any answer to any user, and you cannot remove one document after the fact. Do not train on content that only some people are allowed to see. For the wider controls, see data security and governance for AI.

How do you decide which approach to use?

Work through these questions in order and stop at the first one that applies.

  1. Does everything the AI needs fit in one request and rarely change? Use prompting.
  2. Does the AI need to answer from documents that are large, change often, differ by user, or must be cited? Use RAG, with permissions designed in from the start.
  3. Are answers correct but inconsistent in format, tone or category? Add fine-tuning, with a test set that proves it helped.
  4. Is the goal to make the model "know" a body of facts? Go back to question 2. That is a retrieval problem.

Whichever you choose, measure it. Build a set of real questions with agreed answers before you build, and rerun it after every change to the prompt, the index or the model. Our guide to testing AI before it touches your operations explains how. Without that, the choice between these approaches becomes an argument about opinions instead of results.

Common mistakes

  • Fine-tuning to add facts. It produces answers that sound authoritative, cannot cite a source and go stale silently.
  • Skipping the prompting baseline. Teams jump to retrieval or training without finding out what a good prompt already does.
  • Indexing everything. More documents do not improve answers. Duplicates, drafts and outdated versions make retrieval worse.
  • Ignoring permissions until after the pilot. Retrofitting access control onto an index built without it usually means rebuilding the index.
  • No owner for the content. Retrieval is only as current as the documents behind it, and someone named has to keep them accurate.
  • Treating the choice as permanent. Models and tooling change quickly, so keep the approach behind a clean interface and keep your test set portable.

How Kastling approaches this

Choosing between these approaches is part of the design work in AI & Cloud Infrastructure: cloud architecture and deployment on AWS or Azure, AI application deployment, and the data connections and pipelines behind them.

In practice that means starting from the business task and the documents involved, rather than from a preferred technique. Kastling connects the systems a client already runs, agrees data access and ownership up front, designs permissions into any retrieval layer, and tests the result against real business scenarios before it goes live. Where a workload needs it, the team brings in AWS and Azure specialists. The team is founder-led, and the scope, responsibilities and operating costs are set out in the proposal rather than assumed.

AI data readiness check

Check the data behind one workflow across five areas, and get the three steps that would make it ready for AI.

Open the tool

Questions

Is a long context window a replacement for RAG?

Only for small collections. If everything the AI needs fits comfortably in one request, pasting it in is the simplest design and needs no search system. Once the material is large, changes often or differs by user permission, you still need retrieval to decide what goes into each request, and sending everything every time raises cost and latency.

Can we fine-tune on our documents so the AI knows them?

It is rarely the right tool. Fine-tuning teaches patterns of behavior, and the result is fixed at training time, so it cannot show a source and goes stale as your documents change. If the goal is answers from your documents, build retrieval first and only consider fine-tuning if the answers are right but the format or tone is inconsistent.

Is RAG cheaper than fine-tuning?

It depends on volume and data, so no honest number exists without seeing your documents. RAG costs more to set up in connecting sources and building the index, and then costs search storage and longer model inputs to run. Fine-tuning costs money to prepare and label training data and to retrain whenever behavior or the base model changes, which is why RAG is usually cheaper to keep current when documents change often.

Does RAG stop hallucinations?

No, it reduces the risk. AWS describes the reduced risk of hallucination as a benefit of grounding the answer in retrieved text. If the search step retrieves the wrong passages, the model can still answer wrongly with confidence, so test the answers against real questions with agreed answers.

Where does our data go when we use these approaches?

With prompting and retrieval, the relevant passages are sent to the model provider with each request, so the contract terms on retention and training matter. With fine-tuning, your training data is uploaded to the provider, which then hosts the resulting model for your organization. Read the data processing terms for the specific service before choosing, and see our guide on AI data security and governance.

Sources

  1. OpenAI: Optimizing LLM accuracy
  2. AWS Prescriptive Guidance: Comparing Retrieval Augmented Generation and fine-tuning
  3. Microsoft Learn: Document-level access control in Azure AI Search

Guide · 16 min read

Running AI in production on AWS and Azure: architecture, security, cost and operationsRunning AI in production on AWS or Azure means giving a model the same controls as any business system: identity, secrets, logging, cost limits, fallbacks and a named owner for every operating task. Managed services such as Amazon Bedrock and Azure OpenAI in Microsoft Foundry host the models, but the architecture, data boundaries and day-to-day operations remain your decisions to make and assign. This guide is for IT and operations leaders at companies of roughly 20 to 200 people.Read

Guide · 11 min read

How to write an AI acceptable use policy for employeesAn AI acceptable use policy tells employees which AI tools they may use, what data may go into them, how closely to check the output, and who to ask when a new tool shows up. This guide for companies of roughly 20 to 200 people includes a sample policy you can copy, a plan-by-plan comparison of vendor data terms and a rollout plan. A workable policy fits on two pages, matches its rules to how sensitive the data is, and names one owner who keeps it current.Read

Article · 10 min read

AI data security and governance for mid-size companies: a practical checklistAI data security and governance means knowing which data each AI workflow touches, approving the sources it may use, checking what your AI provider does with prompts and outputs, and making the AI respect the same permissions as the person using it. This guide for companies of roughly 20 to 200 people also covers defenses against prompt injection, logging with sensible retention and human approval for consequential actions, with frameworks such as the NIST AI RMF and ISO/IEC 42001 giving that work a structure.Read

One useful email a month.

New guides, tools and practical notes on putting AI to work. No sales sequences.

See how an idea becomes a working solution.

Explore how we scope, build and hand over AI projects, with clear decisions at each stage.