RAG
An assistant answers questions about policies, contracts or product documentation. The content changes, and every answer is to name its source.
Insights
RAG fits when the model is to answer questions from company knowledge that changes and has to be backed by sources: at run time the application retrieves the relevant passages and passes them to the model. Fine-tuning fits when the model is to master a behaviour reliably, such as a format, a style or a classification. The two can be combined. For company knowledge, RAG is usually the starting point.
Background
A language model does not know a company’s documents, policies and data. RAG (retrieval-augmented generation) closes this gap at run time: for each question the application retrieves the relevant passages from the connected sources and passes them to the model together with the question. The model itself stays unchanged.
Fine-tuning changes the model: it is further trained with examples of input and desired output and thus adopts a behaviour permanently.
Both are preceded by prompt engineering: clear instructions and examples in the prompt. Often only then does it become clear what is still missing.
Comparison
| Criterion | RAG | Fine-tuning |
|---|---|---|
| What changes | The context of the request. The model stays as it is. | The model itself: it is further trained with examples. |
| Currency | New documents are usable as soon as they are in the index. | New knowledge requires retraining. |
| Sources | Answers can be backed by the retrieved passages. | The model names no source for what it has learned. |
| Access rights | Can be applied per user at retrieval. | What has been learned is available to all users of the model. |
| Strength | Questions about knowledge that changes. | Consistent behaviour: format, style, terminology, classification. |
| Effort | Prepare data, operate search and index. | Create training examples, training and tests per model version. |
General classification, not a statement about individual providers.
Decision
An assistant answers questions about policies, contracts or product documentation. The content changes, and every answer is to name its source.
The model is to classify inputs by the same scheme every time or produce text in a fixed format and terminology.
RAG supplies the current knowledge, a fine-tuned model keeps to format and terminology.
Approach
Check how far an unchanged model gets with clear instructions.
Prepare sources, build search and return answers with sources.
Test the results on concrete tasks from daily work and record where they fall short.
Fine-tune when a behaviour is not stable despite good prompts and suitable sources.
Digital David
RAG systems, fine-tuning, prompt engineering, model selection and vector database integration.
We work with models from OpenAI, Anthropic and Mistral as well as Azure OpenAI, plus LangChain, LlamaIndex, Pinecone and Weaviate. The selection follows your requirements.
Factify supports research and customer processes with open interfaces and traceable processing logs.
Good to know
Answers from our AI engineers to questions that come up before a project.
Discuss your questionFine-tuning is suited to behaviour, less so to facts. Learned knowledge cannot be backed by a source and cannot be restricted per user. For knowledge, RAG is the right route.
For semantic search, content is stored as vectors. This is done by a dedicated vector database or by an extension of an existing database.
The selection follows your requirements. At Digital David, model selection is part of LLM engineering.
We clarify data sources, access rights, hosting and review processes as part of the architecture. Requirements for data protection, governance and human approvals are taken into account in the specific project.
Our AI engineers discuss sources, quality criteria and the right route with you.