Search

What are you looking for?

Search our services, use cases and practical insights.

Enter at least 2 characters

Popular starting points

Knowledge, data and RAG

RAG, fine-tuning or a direct API: Which should you use?

The three approaches solve different problems: RAG supplies knowledge, fine-tuning changes model behaviour, and an API provides structured current data or executes controlled actions.

The short answer

RAG is suitable for current, source-based knowledge from documents. Fine-tuning is suitable for recurring tasks or consistent desired behaviour learned from strong examples. A direct API is appropriate when the application needs exact live values, structured records or transactions from a business system. Many enterprise solutions combine these approaches.

In brief

  • RAG retrieves relevant content and provides it to the model as context.
  • Fine-tuning adapts a model's behaviour using training examples.
  • APIs provide authoritative live data and enable controlled actions.
  • The choice follows the type of information required, not a preferred AI tool.

First determine what the application must know or do

Architecture should follow the task. An application that explains policies needs traceable document sources. One that reports a current delivery status must query the system of record. If thousands of texts must always be classified using the same specialised scheme, an adapted model may become useful.

  • Does the information change frequently or remain stable?
  • Must an answer show its source?
  • Is an explanatory response sufficient, or is an exact value required?
  • Will the system only read information or also change it?
  • Are enough high-quality examples available for the desired behaviour?

Compare RAG, fine-tuning and APIs directly

The approaches are not interchangeable product options. They solve different parts of an application and can be used together. The table shows which question each approach should answer reliably.

Compare RAG, fine-tuning and APIs directly
CriterionRAGFine-tuningDirect API
Type of knowledgeUnstructured documents and approved knowledge collectionsRecurring behaviour, format or classification patterns learned from examplesStructured records and functions in a system of record
FreshnessUpdated by re-indexing sourcesChanges require new training data, training and evaluationCan return the value supplied by the system of record at query time, together with its timestamp and documented cache semantics
Source evidenceSupporting passages can be displayed directlyLearned output normally has no traceable supporting passageThe value or record comes from a named business system
ActionsPrimarily supplies context; changes use a separate toolChanges model behaviour but does not safely execute transactions by itselfCan read or write in a controlled way when permissions and business rules pass
Typical effortSource maintenance, chunking, permissions, retrieval and answer evalsHigh-quality training data, training, versioning and regression testsInterface design, authorisation, validation, error handling and operations
ExampleExplain a repair instruction with a citationClassify incident reports consistently using a company-specific schemeRetrieve current stock or prepare a controlled change

Use RAG for current, traceable document knowledge

With RAG, the application first retrieves relevant passages from approved sources and provides them to the model together with the question. Knowledge remains outside the model and can be updated or filtered by permission. RAG is particularly useful for policies, manuals, product documentation and internal knowledge collections.

  • Content changes and must remain updateable without retraining a model.
  • Answers should display sources or supporting passages.
  • Knowledge is mainly stored in unstructured documents.
  • Different users are allowed to access different content.
  • The application should recognise questions that lack supporting evidence.

Use fine-tuning for recurring desired behaviour

Fine-tuning adapts an existing model to a task using many high-quality input and output examples. It can improve consistency for a format, classification scheme or specialised writing behaviour. It is not, however, a reliable replacement for a continuously updated knowledge source.

  • The task occurs frequently and can be learned from clear examples.
  • Prompting does not achieve sufficient consistency despite evaluation.
  • The desired output format or behaviour is relatively stable.
  • Representative training data and separate test examples are available.
  • Training, evaluation, versioning and future retuning are justified.

Use direct APIs for exact data and actions

If an application needs an account balance, stock level, order status or price, it should query the responsible business system through a defined API. The model can understand a natural-language request or explain the result, but the authoritative value comes from the system of record. Changes should likewise occur only through narrowly scoped and validated functions.

  • Live values or complete structured records are required.
  • The business system remains the authoritative source.
  • Inputs, permissions and permitted actions require technical validation.
  • Transactions require confirmation, logging or approval.
  • Error responses and missing data must not be replaced by invented values.

Combine the approaches and test the whole system

Enterprise applications often need more than one approach. An assistant can interpret a question, retrieve the relevant policy through RAG and query the current case through an API. A fine-tuned model can additionally perform a narrowly defined classification task. Each component and the complete workflow must be evaluated.

  1. Step 1

    Separate information types

    Identify document knowledge, live data, desired behaviour and actions.

  2. Step 2

    Choose the simplest approach

    Begin with prompting, search or an existing API.

  3. Step 3

    Add components deliberately

    Use RAG for sources, fine-tuning for proven behavioural gaps and APIs for system data.

  4. Step 4

    Test components

    Measure retrieval, model answers, data access and permissions separately.

  5. Step 5

    Evaluate end to end

    Include real cases, errors, missing data and prohibited actions.

Example from day-to-day business

Example: Technical support assistant

A support employee asks how to resolve an error and whether a replacement part is available. RAG finds the approved repair instruction and displays the supporting passage. An API queries the current stock and delivery date in the ERP system. If thousands of incoming fault reports must also be classified according to a stable company-specific scheme and prompting is insufficient, a fine-tuned model can handle that separate task. No single technology needs to perform all three jobs.

What to remember

Use RAG for traceable document knowledge, APIs for authoritative live data and actions, and fine-tuning only when a measured behavioural gap can be addressed with high-quality examples.

Sources and further reading

These primary sources provide further detail on definitions, technical foundations or responsible use.

Content reviewed

Would you like to apply this to your situation?

Together, we clarify what makes sense for your process, data and systems – in plain language and without unnecessary complexity.

Discuss Your Project