RAG, fine-tuning or prompting: which approach to connect AI to your documents?

RAG lets an AI assistant answer from your internal documents. It first retrieves the relevant passages, then writes its answer based on them. Compared with fine-tuning and plain prompting, RAG AI is often the best option when information changes quickly and must stay under control.

Which approach will make your documents talk?

Five questions to choose between prompting, RAG and fine-tuning.

1 / 5 — How many documents should the AI read?

Summary

  1. Without RAG, an AI assistant does not know your documents
  2. RAG AI explained simply
  3. Fine-tuning: when to retrain a model
  4. RAG vs fine-tuning vs prompting: the comparison
  5. Running a RAG project: data, access rights and updates
  6. The limits of RAG
  7. Conclusion
  8. FAQ

team browsing a document base on a large screen in a bright office

Ask a public AI assistant about your internal rules. Or about your service catalogue, or the latest version of a quality procedure. At best, it will tell you it does not know. At worst, it will invent a plausible answer. After all, it has never seen those documents.

There are three ways to make an AI answer from your own content. First, you can paste the document into the conversation. Second, you can retrain a model on your data. Finally, you can set up RAG. Each option has its own uses, costs and risks. Here is how to choose without getting lost in jargon.

Without RAG, an AI assistant does not know your documents

A model learns once. It trains on a very large volume of text collected up to a certain date. After that, its knowledge is frozen. So it sees neither your intranet, nor your shared folders, nor the contracts signed last week.

Yet companies want to use exactly that kind of text. According to INSEE, France’s national statistics office, written-language analysis is the most widespread AI technology. In 2024, 44% of French companies using AI relied on it. In other words, getting a machine to read documents is already the number one use.

The model therefore needs the right information at the right moment. The three approaches below each do this in their own way.

Why not paste everything into the chat?

It is tempting. However, a model can only process a limited amount of text at once. This limit is called the context window. It has grown a lot in recent years, but it will never hold an entire intranet.

Moreover, the more text you supply, the more likely the model is to miss the useful passage. The cost of each question also rises with length. Finally, copying documents by hand does not scale. A team of twenty cannot paste the same files every day. This is precisely the problem RAG solves: it sends the model only the few relevant passages.

RAG AI explained simply

employee searching for a passage in documents on his computer

RAG stands for retrieval-augmented generation. The term comes from a research paper published in May 2020 by Patrick Lewis and his co-authors, later accepted at the NeurIPS conference. The authors combined a model’s internal memory with an external memory. That memory was an index of Wikipedia, queried by a neural retriever.

In a company, the principle is the same. When an employee asks a question, the system works in three steps:

  1. Retrieve: it searches your documents for the passages closest to the question.
  2. Augment: it adds these passages to the instructions sent to the model.
  3. Generate: the model writes its answer from these extracts, ideally citing its sources.

The model itself does not change. Only the information supplied changes with each question. So when a document is updated, you simply re-index it. The answers follow straight away.

You may already use this principle. For example, assistants that answer from your SharePoint files search your content first. Our article on Copilot Studio also shows how to build an agent connected to your Microsoft content.

An example in customer support

Take a Geneva SME that sells IT services. Its support team answers the same questions every day about contracts, response times and procedures. The answers already exist, but they are scattered across terms and conditions, internal sheets and old emails.

With RAG, an employee types the question into the assistant. The system then finds the right clause in the terms and the current procedure sheet. Next, the model writes a short answer and cites both documents. The employee checks it, adjusts if needed and sends it. As a result, the main gain is the time saved on searching.

Fine-tuning: when to retrain a model

Fine-tuning extends training. You continue training an existing model with your own examples. The model then adjusts its internal parameters. As a result, it adopts a style, an answer format or a business vocabulary for good.

This approach suits a few specific needs:

  • enforcing an output format that never changes, such as a structured sheet;
  • adopting the tone and vocabulary of a highly specialised sector;
  • handling a narrow, repetitive task, such as classifying requests against an internal grid.

On the other hand, fine-tuning copes poorly with knowledge that changes. Every new price, procedure or org chart would require new training. It also needs a good set of examples, technical skills and a computing budget. Finally, it does not tell you which document a piece of information came from. Checking answers therefore becomes harder.

Here is a concrete case. A fiduciary firm wants its summary notes to always follow the same structure and vocabulary. Fine-tuning makes sense here, because form matters more than content. For current rates or legal deadlines, however, RAG remains the better choice. That information changes too often to be learned once and for all.

RAG vs fine-tuning vs prompting: the comparison

IT manager comparing several options on a whiteboard with blank shapes

Prompting remains the simplest option. You copy the relevant document into the instructions, then ask your question. For a one-off need, this works very well. However, the method soon reaches its limits as documents pile up. It also struggles when several people ask the same questions.

CriterionPrompt with documentRAGFine-tuning
Typical useOne-off question on one documentRepeated questions on a document baseStyle, format or highly specialised task
Updating informationManual, every timeRe-indexing changed documentsNew training run
Volume of documentsLowLargeNot directly relevant
Sources citedYes, the document is knownYes, if the system is built for itNo
Set-up effortNoneMedium: indexing, rights, testsHigh: data, computing, expertise

In most projects, the three approaches follow one another. You start with well-written prompts. Then you move to RAG as soon as a document base has to serve several people. Fine-tuning comes later, only for a style or format need that RAG does not cover. To write better instructions, also read our advice on prompting mistakes to avoid.

Running a RAG project: data, access rights and updates

hands sorting documents in an expanding file folder

Everything starts with the documents. A RAG system is only as good as the documents it reads. For instance, if your base holds three versions of the same procedure, the assistant may cite the wrong one. So sort things out first: remove duplicates and archive outdated versions. Also name an owner for each set of documents.

Access rights deserve the same care. An assistant connected to all your folders must not show salary slips to everyone. The same goes for disciplinary files. The system must therefore respect existing permissions. That way, each user only finds the documents they can already open.

Next, plan how often the index is updated. When a document changes, the index must follow. Otherwise, the assistant keeps answering with the old version. Finally, build a set of about thirty real questions with the expected answers. You will use it to measure quality before launch, then after every change.

Four criteria to judge the answers

For each test question, rate the answer on four simple criteria:

  • was the right source retrieved?
  • does the answer say exactly what the source says?
  • is the answer complete, with nothing invented?
  • can the user check it easily thanks to the link to the document?

Business teams can understand these criteria easily. Moreover, they quickly show where a problem lies. A wrong source points to the search step, whereas a poor summary points to the instructions given to the model.

The limits of RAG

employee checking the source of an answer on a tablet

RAG makes AI more reliable, but not infallible. If the retrieved passage is wrong, incomplete or poorly chosen, the answer will be too. In addition, the model can summarise a correct extract badly. That is why showing sources matters so much. It lets users check in one click.

Personal data also raises questions. The Federal Data Protection and Information Commissioner makes this clear on its page AI and data protection. Indeed, the Federal Data Protection Act applies directly to AI-supported data processing. The Commissioner stresses transparency in particular: purpose, how it works and the data sources used. If your base contains customer or HR data, ask a few questions before choosing a solution:

  • in which country are the documents and questions processed?
  • how long are they kept, and by whom?
  • can the data be used to train the provider’s model?
  • do users know they are talking to an AI?

Lastly, a robust RAG system requires development skills. You need to split documents, choose the search method, orchestrate calls to the model and evaluate the answers. Our Developing LLM and RAG Applications with LangChain course is designed for developers and architects. It lasts two days and runs in Geneva, in Lausanne or as a virtual class.

Developing LLM and RAG Applications with LangChain training

Conclusion

RAG is often the right starting point. After a phase of well-written prompts, it lets an AI answer from your documents. It keeps information up to date, cites its sources and leaves the model untouched. Fine-tuning still has a role for very specific style or format needs.

To get started, keep the scope small: one document base, one pilot team and about thirty real questions. Then measure answer quality for a few weeks. You will then know whether the project deserves to grow, and on what terms.

In every case, success depends above all on document quality and on respecting access rights. To go further, explore our artificial intelligence courses.

FAQ

What is RAG in AI?
It is a method that lets a language model search your documents for relevant passages before answering. The model then writes its answer from those extracts.

What is the difference between RAG and fine-tuning?
With RAG, the model receives information with each question and is not modified. By contrast, fine-tuning retrains the model to change its style or format for good.

Does RAG eliminate hallucinations?
It reduces them when the right passages are retrieved, but does not eliminate them. A wrong extract produces a wrong answer. Hence the value of showing sources.

Do you need a developer to set up RAG?
For a simple assistant, some tools offer ready-made RAG. However, a custom application with access control and evaluation requires development skills.

Do my documents stay confidential with RAG?
It depends on the hosting and settings you choose. Check where documents and questions are processed, how long they are kept and who can access them.

Can RAG work with scanned documents?
Yes, provided the text is first extracted with character recognition. Then check the quality of that extraction on a few documents, especially for tables.

Facebook
Twitter
LinkedIn
Email
About the author

ITTA is the leader in IT training and project management solutions and services in French-speaking Switzerland.

Our latest posts

Subscribe to the newsletter

Confirmed training courses

Consult our confirmed trainings and sessions

ORG-CONF
Fundamental
2
days
In class, Virtual
Dès CHF 1'300.-
ORG-STRS
Fundamental
1
day
In class, Virtual
Dès CHF 800.-
COM-NONV
Fundamental
0.5
day
In class, Virtual
Dès CHF 500.-
TEAM-CVS
Fundamental
2
days
In class, Virtual
Dès CHF 1'300.-

Opening hours

Monday to Friday
8:30 AM to 6:00 PM
Tel. 058 307 73 00

Contact-us

ITTA
Route des jeunes 35
1227 Carouge, Suisse

Make a request

Contact

ITTA
Route des jeunes 35
1227 Carouge, Suisse

Opening hours

Monday to Friday, from 8:30 am to 06:00 pm.

Contact us

Your request