RAG

Definition

RAG (Retrieval-Augmented Generation) is a method in which a language model first retrieves the relevant passages from a company's documents and then builds its answer on them, with a link to the source. This lets the model answer from current policies, contracts and data without fine-tuning.

Free to quote with a link to initask.com · Author: Vitalii Miniailo · Updated:

Key traits

RAG
01
Search before answering
02
Answers with sources
03
Freshness
04
Access control
RAG
01
Search before answering
02
Answers with sources
03
Freshness
04
Access control

Search before answering

The query first becomes a search over the company's document base.

Answers with sources

Every statement can be checked via a link to the document.

Freshness

A new document in the base is available to the model at once, without retraining.

Access control

The model sees only the documents the user is allowed to see.

Comparison

CriterionRAGFine-tuningPlain chat with a model
Source of knowledgeYour documents at query timeModel weights after trainingThe model's general knowledge
UpdatesAdd a document to the baseRetrainNot possible
CitationYesNoNo
Start-up costLowHighMinimal

Source of knowledge

RAG
Your documents at query time
Fine-tuning
Model weights after training
Plain chat with a model
The model's general knowledge

Updates

RAG
Add a document to the base
Fine-tuning
Retrain
Plain chat with a model
Not possible

Citation

RAG
Yes
Fine-tuning
No
Plain chat with a model
No

Start-up cost

RAG
Low
Fine-tuning
High
Plain chat with a model
Minimal

How to implement

  1. Collect documents: policies, contracts, manuals, FAQs.
  2. Split them into passages and index them in a vector database.
  3. Set up retrieval that respects access rights.
  4. Connect the model with the rule to answer only from retrieved text, with citations.
  5. Test on 50-100 real questions and tune retrieval.

Common mistakes

  • Loading outdated and conflicting document versions together.
  • Hiding the source of the answer, so nobody trusts it.
  • Chunking documents without respecting their section structure.
  • Exposing restricted documents to every employee.
Example from a project

A company's legal AI workflow works with a register of 12 contracts and 14 lawyer scenarios: the agent finds the right contract clause and tracks deadlines 120 days ahead.

Case: legal AI workflowCase: legal AI workflow

Questions and answers

Which is better for business: RAG or fine-tuning?

For answers based on company documents, almost always RAG: it is cheaper, documents update instantly and every answer has a source. Fine-tuning fits style or a narrow classification task.

Can RAG run on confidential data?

Yes. The vector database and the model can be deployed on the company's own server, so documents never leave its perimeter.

How many documents does RAG need?

It works with a few dozen documents. What matters more is that they are current and free of conflicting versions.