AI Integration

RAG vs Fine-Tuning: The Enterprise AI Decision Guide Nobody Gives You Straight

Every enterprise AI project eventually hits the same fork: build a RAG pipeline or fine-tune a model? Most advice online is either too theoretical or vendor-biased. This is the practical decision guide — with real numbers, real failure modes, and an ERP-specific lens — built from deployments across Business Central, LS Central, and WhatsApp-based AI systems.

VTVoyager IT TeamJuly 15, 202614 min read

The question enterprises keep asking is: "Should we use RAG or fine-tune our model?" It is the wrong starting point. The right starting point is: "What is the specific failure mode we are trying to fix, and what does our data actually look like?" RAG and fine-tuning solve different problems. Choosing between them without answering those two questions first is how teams end up six months into a fine-tuning project that a RAG pipeline would have solved in three weeks.

This guide is built from real deployments: AI systems layered on Business Central financial data, LS Central retail transaction streams, WhatsApp-based customer service bots, and document-heavy compliance workflows. We will cover what each approach actually does, when each one wins, the ERP-specific complications that generic guides miss, the hybrid pattern that most production systems converge on, and the failure modes we have personally watched kill AI projects.

1. What Each Approach Actually Does

Retrieval-Augmented Generation (RAG)

RAG leaves the base language model unchanged. Instead of teaching the model new knowledge, it gives the model access to a retrieval system at inference time. When a user asks a question, the pipeline retrieves the most relevant chunks of information from an indexed knowledge base, prepends them to the prompt as context, and asks the model to answer using that context. The model's parametric knowledge (what it learned during training) handles language and reasoning; the retrieved context handles facts.

RAG pipeline — request flow
User query: "What is our Q2 gross margin for the Electronics category?"

┌─────────────────────────────────────────────────────┐
│  1. EMBED        query → vector (e.g. [0.42, -0.17, ...])
│  2. RETRIEVE     top-K chunks from vector store
│                  → BC G/L report excerpt, Q2 2026
│                  → Item Category definition: Electronics
│                  → Previous Q1 margin context
│  3. AUGMENT      build prompt:
│                  [system] You are a financial analyst...
│                  [context] <retrieved chunks>
│                  [user] What is our Q2 gross margin...
│  4. GENERATE     LLM produces answer grounded in context
│  5. RETURN       answer + source citations
└─────────────────────────────────────────────────────┘

// The base model weights are NEVER modified.
// Swap the knowledge base → different answers, same model.

The key property of RAG is that knowledge lives outside the model. Update your knowledge base and the model immediately knows the new information — no retraining required. This is why RAG dominates in enterprise settings where data changes frequently: new financial periods, updated product catalogues, revised compliance documents, changing customer records.

Fine-Tuning

Fine-tuning modifies the model's weights. You take a pre-trained base model and continue training it on a curated dataset of input-output pairs that represent the behaviour, format, or domain knowledge you want. The model bakes this into its parameters — it does not need to retrieve anything at inference time because the knowledge or behaviour is now part of the model itself.

The critical distinction is that fine-tuning teaches the model HOW to respond, not WHAT to know. It excels at: consistent output format (always return JSON with these exact fields), domain vocabulary (understanding that "NPT" means Nepal Standard Time in your context, not something else), tone and style (always respond as a professional ERP consultant, never speculatively), and task-specific reasoning patterns (always check both debit and credit sides before stating a G/L balance).

Fine-tuning does not reliably inject factual knowledge. A model fine-tuned on your Q1 2024 financial data will not reliably recall specific figures from that data — it will learn the patterns and vocabulary, but specific numbers hallucinate readily. For factual recall of business data, RAG is the correct tool. Fine-tuning is for behaviour, not for memory.

2. The Numbers: Cost, Time, and Data Requirements

Generic comparisons rarely give real numbers. Here are the figures that actually apply to enterprise AI deployments in 2026.

  • RAG time to production: 2–6 weeks from kickoff to a production-ready system, assuming a reasonably clean knowledge base. The dominant time investment is data preparation and chunking strategy, not model work.
  • Fine-tuning time to production: 4–12 weeks. Data curation is the bottleneck — you need high-quality labelled examples, not just raw data. 500 examples is the practical floor; 2,000+ is where consistent improvement becomes reliable.
  • RAG infrastructure cost: vector database (Pinecone, Weaviate, pgvector in PostgreSQL) plus embedding model API calls plus LLM inference. For most enterprise workloads, $500–$3,000/month depending on query volume and model choice.
  • Fine-tuning cost: training run on a 7B parameter model costs roughly $50–$200 per run on cloud GPU. The real cost is human time for data curation — expect 100–300 hours of expert annotation for a domain-specific dataset. That is the number vendors never quote.
  • Ongoing maintenance: RAG requires keeping the knowledge base current (chunking new documents, re-indexing updated records). Fine-tuning requires periodic retraining runs when the domain shifts significantly. RAG has lower retraining cost but higher indexing cost.
  • Latency: RAG adds a retrieval step — typically 100–500ms depending on index size and retrieval strategy. Fine-tuned models have no retrieval overhead. For sub-200ms latency requirements (e.g. real-time POS interactions), fine-tuning or aggressive caching is necessary.

3. When RAG Wins

RAG is the correct default for the majority of enterprise AI use cases. Pick RAG when:

  • Your knowledge base changes frequently. Financial data updates every posting run. Product catalogues change weekly. Compliance documents are revised quarterly. RAG handles all of this without retraining.
  • You need source attribution. When a user asks why the system gave a particular answer, RAG can cite the specific chunks it retrieved. Fine-tuned models cannot explain where their knowledge came from.
  • You have less than 1,000 high-quality labelled examples. Fine-tuning below this threshold is unreliable and often worse than a well-prompted base model with RAG context.
  • The queries are factual lookups against your specific business data. "What is the outstanding balance on customer account C00142?" should hit your AR ledger via retrieval, not a trained model that may hallucinate a number.
  • You need to control what the model knows. A RAG system can be scoped to retrieve only from approved, audited sources. A fine-tuned model's knowledge cannot be scoped — it will draw on everything it was trained on.
  • Your team has no ML engineering capability. RAG is primarily a software engineering problem (data pipelines, embedding APIs, retrieval logic). Fine-tuning requires ML infrastructure and expertise that most enterprise teams do not have internally.

4. When Fine-Tuning Wins

Fine-tuning has a narrower but clear set of cases where it outperforms RAG:

  • Consistent structured output format. If you need the model to always return a specific JSON schema — field names, data types, nesting structure — prompt engineering and RAG alone are brittle. Fine-tuning enforces format reliably at scale.
  • Domain-specific vocabulary and abbreviations. If your business uses terminology that a general model misinterprets (posting groups, dimension set entries, tender types, mix-and-match offers), fine-tuning on your domain's text teaches the model to parse this correctly.
  • High query volume with latency constraints. At very high query volume, the retrieval step adds cost and latency. A fine-tuned model with no retrieval overhead is cheaper per query at scale — but only if the knowledge it needs is stable enough to have been trained in.
  • Classification and extraction tasks. Routing a customer message to the correct department, extracting structured fields from an invoice, classifying a G/L posting to the correct account type — these are pattern recognition tasks that fine-tuning handles better than RAG.
  • Confidential data that cannot leave your infrastructure. Cloud-based embedding APIs and LLM inference endpoints involve sending data externally. Fine-tuning a model that runs entirely on your infrastructure avoids this for sensitive financial or patient data.

5. The ERP-Specific Problem RAG Guides Don't Cover

Most RAG tutorials are built around unstructured documents: PDFs, knowledge base articles, Confluence pages. Enterprise ERP data is fundamentally different — it is structured, relational, and semantically dense. A chunk from a PDF has natural boundaries (paragraphs, sections). A row from the G/L Entry table is 40 fields of structured data with no natural language equivalent unless you transform it.

The Chunking Problem for ERP Data

Standard RAG chunking strategies (split by paragraph, split by N tokens) do not work on raw ERP records. A G/L Entry record chunked at 512 tokens might contain 30 unrelated transactions — the retrieved context has low signal-to-noise and the model produces poor answers. The correct approach for ERP data is semantic aggregation before indexing: group G/L entries by account, period, and dimension before chunking; represent them as natural language summaries that preserve the financial meaning.

ERP data — raw record vs RAG-ready representation
// RAW: what a G/L Entry looks like in the database
{
  "Entry No.": 48291,
  "G/L Account No.": "4010",
  "Posting Date": "2026-06-30",
  "Document Type": "Invoice",
  "Amount": -142500.00,
  "Dimension Set ID": 847,
  "Source Code": "SALESPOST"
}

// RAG-READY: semantically aggregated, natural language chunk
// (generated by a pre-processing pipeline before indexing)
"For the period April–June 2026 (Q2), G/L Account 4010
(Sales Revenue - Electronics) recorded net revenue of
NPR 4,217,500 across 31 posted sales invoices.
Breakdown by dimension: DEPT=RETAIL NPR 2,840,000,
DEPT=WHOLESALE NPR 1,377,500. This represents a 12.4%
increase vs Q1 2026 (NPR 3,752,000). Margin impact:
corresponding COGS (Account 5010) was NPR 2,545,000,
giving gross margin of 39.6% vs 38.2% in Q1."

// The chunk answers financial questions correctly.
// The raw record answers almost nothing without joins.

Access Control at the Retrieval Layer

In an ERP context, different users have permission to see different data. A sales rep can see their own customer accounts but not the full debtor ledger. A store manager can see their store's inventory but not the group margin report. Standard RAG implementations ignore this — the retrieval layer returns whatever is most similar to the query, regardless of the requester's permissions.

For production enterprise RAG, access control must be implemented at the retrieval layer as a metadata filter applied before semantic similarity search — not as a post-processing step that strips results after retrieval. Post-processing is insufficient because the LLM has already seen the retrieved chunks when generating its response; it can leak information from documents the user should not have access to, even if those documents are stripped from the final citation list.

6. The Hybrid Pattern: What Production Systems Actually Look Like

The canonical enterprise AI architecture in 2026 is not pure RAG and not pure fine-tuning. It is a fine-tuned small model behind a RAG pipeline. The fine-tuned model provides consistent behaviour, domain vocabulary, and output format. The RAG pipeline provides current, factual, scoped knowledge. Together, they cover what neither does alone.

Hybrid architecture — production pattern
User query
    │
    ▼
┌──────────────────┐
│  Query Routing   │  ← classify: factual lookup vs reasoning task
└──────────────────┘
    │                │
    ▼                ▼
┌─────────┐    ┌──────────────────────────────┐
│  Tools  │    │         RAG Pipeline          │
│ (APIs,  │    │  embed → retrieve → re-rank  │
│  DBs)   │    │  → top-K chunks with ACL     │
└─────────┘    └──────────────────────────────┘
    │                      │
    └──────────┬───────────┘
               ▼
    ┌─────────────────────┐
    │  Fine-Tuned Model   │  ← domain vocabulary, output format,
    │  (7B–13B params,    │     consistent reasoning style
    │   hosted on-prem    │
    │   or private cloud) │
    └─────────────────────┘
               │
               ▼
    Structured response + citations

// Fine-tune once for behaviour. Update the RAG index for knowledge.
// Retraining is only needed when the desired behaviour changes,
// not when the underlying data changes.

For most Voyager IT client deployments, the fine-tuned model is a 7B or 13B parameter open-weight model (Llama 3.1, Qwen 2.5, or Mistral variants) running on a private cloud instance. This keeps sensitive financial data from leaving the client's infrastructure. The RAG pipeline indexes data from Business Central and relevant documents. The fine-tuning dataset is typically 800–2,000 examples of correctly formatted responses in the client's domain vocabulary — a one-time investment that does not need to be repeated unless the response format or business vocabulary changes significantly.

7. Failure Modes We Have Seen in Production

Most AI project failures are not model failures. They are data, architecture, or expectation failures. These are the specific failure modes we have encountered across deployments:

  • Hallucination from RAG noise: when the retrieval step surfaces low-quality chunks (duplicates, stale data, incorrect aggregations), the model generates confident-sounding answers based on bad context. The fix is not a better model — it is better chunking, re-ranking, and a retrieval quality score threshold below which the model should say "I cannot find reliable data for this query."
  • Fine-tuning on the wrong examples: teams curate examples that represent the easy cases, not the edge cases. The fine-tuned model performs well in demos and breaks on real queries that do not resemble the training distribution. Example curation must deliberately include hard cases, ambiguous queries, and the refusals you want the model to learn.
  • No access control in the retrieval layer: a user with limited permissions asks a question, the retrieval step surfaces a sensitive document, the model uses it in the response. The document is then stripped from the citation list, but the information is already in the output. Catastrophic in regulated industries. Fix: ACL filter before retrieval, not after.
  • Embedding model mismatch: the embedding model used at indexing time must be identical to the one used at query time. Teams that update their embedding model without re-indexing the knowledge base get degraded retrieval quality that looks like a model problem but is actually a vector space mismatch.
  • Context window overflow: a RAG system that retrieves too many chunks overwhelms the model's context window. Performance degrades sharply when the prompt exceeds 60–70% of the context window. The fix is a re-ranking step that compresses retrieved chunks to the most relevant subset before passing to the model.
  • Treating fine-tuning as a knowledge injection tool: the most common misuse. Teams attempt to "teach" the model their proprietary data via fine-tuning and are surprised when it hallucinate specific numbers it was trained on. Fine-tuning compresses knowledge statistically — specific figures do not survive reliably. Use RAG for facts, fine-tuning for behaviour.

8. The Decision Framework: Five Questions Before You Choose

Before committing to either approach, answer these five questions. They will tell you what you actually need.

  • Does the problem require factual recall of specific, changing business data? → RAG. If the data is static and you have training examples, fine-tuning can supplement.
  • Do you need the model to consistently produce a specific output structure? → Fine-tune for format. Add RAG for the knowledge that fills those structures.
  • How often does your knowledge base change? More than monthly → RAG. Stable for 6+ months → fine-tuning can be considered.
  • What is your query volume and latency requirement? High volume, sub-200ms → fine-tuned model, no retrieval. Lower volume, latency tolerant → RAG is fine.
  • Do you have 1,000+ high-quality labelled examples you can curate? → Fine-tuning is viable. Fewer than 500 examples → start with RAG plus prompt engineering.

Our default recommendation for enterprise teams starting their first AI project: build a RAG pipeline first. Get something working in 4–6 weeks. Measure where it fails. The failure analysis will tell you whether those failures are knowledge gaps (fix with better indexing) or behavioural gaps (fix with fine-tuning). Do not fine-tune to solve a problem you have not yet measured. The cost of RAG first is low; the cost of fine-tuning first on the wrong hypothesis is 3–4 months and significant budget.

9. Getting Started Without Over-Committing

The most expensive mistake in enterprise AI is investing in infrastructure before validating the core use case. Before you stand up a vector database, choose an embedding model, or commission a fine-tuning dataset, run a manual simulation of the system you want to build: take 20 real user queries, retrieve the relevant context manually (from your actual data sources), paste it into a system prompt with a base model, and evaluate the output quality. If the output quality is already acceptable with a good base model and manually retrieved context, your problem is an engineering problem — build the RAG pipeline. If the output quality is still poor despite good context, your problem is a model behaviour problem — now the fine-tuning conversation is worth having.

This manual simulation takes one day. It will save months. We have run this exercise with clients who were convinced they needed a custom fine-tuned model and discovered that a RAG pipeline over their existing BC data — properly chunked and indexed — solved 90% of their use case with no model training at all. We have also run it with clients who had a well-indexed knowledge base but a base model that consistently misformatted their domain-specific output — and the fine-tuning decision was clear and quick to validate.

If you are building AI on top of Business Central, LS Central, or a document-heavy operations workflow and are not sure which path fits your use case, this is exactly the kind of conversation we have before any project starts. The analysis is free. The outcome is a clear recommendation with a validated rationale — not a proposal to build the most expensive option.

AIRAGFine-TuningLLMEnterprise AIERP AIMachine Learning