RAG vs fine-tuning vs prompt engineering: how to customise an LLM for your business

When to use prompt engineering, RAG or fine-tuning to adapt an LLM, compared on accuracy, freshness, cost, data needs and privacy.

INDI TECHNOLOGY4 min read

"We want the AI to know our business" is one of the most common requests we get. There are three main ways to do it, and they solve different problems. Choosing the wrong one wastes months. The most common mistake is fine-tuning a model to teach it facts, when retrieval would have been cheaper, faster and more accurate.

The three approaches

Prompt engineering RAG Fine-tuning
What it changes The instructions and examples you send The context: relevant documents retrieved for each question The model's weights, trained on your examples
Good for Format, tone, rules, simple tasks Knowledge: facts, policies, documents, data that changes Behaviour: style, format, specialised tasks, smaller faster models
Freshness Instant Instant (update the index) Needs retraining
Citations No Yes, from retrieved sources No
Data needed A few examples Your documents Hundreds to thousands of quality examples
Cost to start Lowest Low to moderate Moderate to high
Running cost Longer prompts cost more Retrieval plus longer prompts Can be lower if a smaller tuned model replaces a big one
Hallucination control Limited Strong, when grounded with citations Limited for facts
Access control — Filter documents per user Hard: knowledge is baked into the model

Start with prompt engineering

Clear instructions, a defined output format (structured outputs), and a few good examples solve more problems than people expect. Always start here, and build an evaluation set while you do (see taking an LLM feature from demo to production). It gives you a baseline that tells you whether anything else helps.

Use RAG for knowledge

If the model needs to know your information (product details, policies, contracts, regulations, case histories, customer records), use retrieval:

  • answers stay current: update a document and the next answer uses it
  • every answer can cite its sources, which reviewers, compliance teams and customers need
  • permissions work naturally: retrieve only what the user is allowed to see
  • nothing sensitive is baked into a model that might leak it to the wrong user

For regulated domains such as compliance, legal, finance and healthcare, RAG is almost always the right foundation, because traceability to sources is required. See LangChain vs LlamaIndex and pgvector vs Pinecone vs Qdrant for building it.

Use fine-tuning for behaviour

Fine-tuning shines when you want the model to behave differently in a consistent way:

  • produce a very specific output format or style reliably (for example, clinical note structure, legal drafting conventions)
  • handle a narrow classification or extraction task with high accuracy
  • make a small, fast, cheap model match a large model on one task, cutting latency and cost at high volume
  • adapt to domain language that general models handle poorly

Fine-tuning needs good training data: hundreds to thousands of high-quality input-output examples, reviewed by people who know the domain. Poor examples teach poor behaviour.

Fine-tuning is a poor way to add facts. Models don't reliably memorise facts from training, facts go stale, there are no citations, and you can't restrict who sees what.

Combining them

Mature systems often use all three:

  • prompts for rules and format
  • RAG for knowledge and citations
  • fine-tuning a small model for one high-volume step, such as classifying incoming documents or extracting fields, while a larger model handles reasoning over retrieved content

Privacy and compliance

  • With RAG, sensitive data stays in your systems and is sent per request, so retention controls and access rules apply normally.
  • With fine-tuning, your training data is used to build a model. Check where training happens, who can access the tuned model, and how you'd handle an erasure request under DPDP or GDPR. Removing one person's data from a trained model isn't practical, so don't train on personal data unless you have to.

Choose prompt engineering if…

  • the task is general and the model already knows enough
  • you need quick results and a baseline

Choose RAG if…

  • answers depend on your documents or data
  • information changes over time
  • you need citations and per-user access control

Choose fine-tuning if…

  • you need consistent specialised behaviour or format
  • a high-volume task would be cheaper on a small tuned model
  • you have quality training examples and an evaluation set

Recommendation by use case

Use case Approach
Customer support assistant using help-centre articles RAG
Compliance Q&A over regulations and internal policies RAG with citations
Classifying incoming emails or tickets at high volume Fine-tuned small model (or prompts first)
Extracting fields from invoices or KYC documents Prompts with structured outputs; fine-tune if accuracy or cost requires
Writing in a strict house style Prompts with examples, then fine-tuning if needed
Assistant over a customer's own account data RAG or tool calls to your APIs; never fine-tune on it

Summary

Prompts first. RAG for knowledge. Fine-tuning for behaviour and efficiency. Measure each step against an evaluation set, and only add complexity when the numbers justify it.

We design and build RAG systems, fine-tuning pipelines and evaluation frameworks through our data and AI team. Talk to us about customising AI for your business.

Any idea in mind? Let's make it real.

Tell us what you're building. You'll hear back from an engineer, not a sales team, usually within one working day.

Book a 30-min call