RAG (Retrieval-Augmented Generation) is the technique that lets an AI assistant answer using your company's documents: when a question comes in, the system searches for the relevant passages in manuals, procedures, contracts or catalogs and provides them to the model, which formulates the answer citing the sources. There is no need to train a model: you just need to organize the documents well.
Let's look at how it works, what it is for, how to prepare the documents, how to protect information and how to measure the quality of the answers.
Why an AI model on its own does not know your company
The language models from OpenAI, Anthropic, Google, Mistral and open models are trained on huge amounts of public text. They can write and reason, but they do not know your price list, your internal procedures or the terms of your contracts. When asked about these topics, they may answer generically or, worse, make things up.
There are two ways to give the model knowledge: train it on your own data (fine-tuning), which is expensive and hard to update, or give it the right information at the moment of the question. RAG does the latter, and it is the best fit in the vast majority of business cases.
How RAG works, step by step
- Collection and preparation: reliable, up-to-date documents are selected (PDFs, web pages, text files, sheets, FAQs).
- Chunking: each document is split into chunks of suitable length, keeping titles and context.
- Semantic indexing: each chunk is turned into a numeric vector (embedding) that represents its meaning, and stored in a vector database.
- Retrieval: when a question comes in, the system looks for the chunks closest in meaning, often combining semantic search and keyword search.
- Generation: the retrieved chunks are passed to the model with precise instructions: answer only from these sources, cite where the information comes from, say so if you cannot find the answer.
The result is an assistant that answers in the language of whoever is asking, but with content taken from company documents, which can be verified.

What it is used for in a company: practical use cases
- Internal assistant for staff: procedures, policies, operating instructions, technical sheets. Especially useful for onboarding new colleagues.
- Sales support: quick answers on product features, compatibility and terms, with reference to the product sheet.
- Customer service: the knowledge base for an AI chatbot for your website or an assistant on WhatsApp.
- Technical and administrative offices: search across contracts, specifications and industry regulations, pointing to the exact passage.
- Tourism: a digital concierge that knows services, opening hours, rules and local information, as described in the article on AI for hotels and tourism.
Quality depends on the documents
RAG does not fix wrong documents: it repeats them. Before the technical work, editorial work is needed.
- A single version of each document: remove duplicates and outdated versions.
- Dates and owners: knowing when a document was updated and by whom.
- Clear structure: headings, paragraphs, readable tables. Scanned PDFs need to be converted and checked.
- Explicit content: what "everyone knows" but nobody has written down must be written, otherwise the assistant will not know it.
- Update process: whoever edits a document needs to know that it also changes the assistant's answers.
The most common mistakes in RAG projects
- Loading everything: indexing entire shared folders, with drafts, duplicates and outdated documents, produces contradictory answers. It is better to start from a small, reliable set.
- Chunks too small or too large: if passages are short they lose context, if they are long the search becomes imprecise. Chunking should be tuned to the type of document.
- Tables and price lists treated as text: structured data (prices, codes, availability) is better read from the management software than from a PDF.
- No testing: without a set of test questions, you cannot tell whether a change improved or worsened the answers.
- No owner: an assistant without someone updating the sources becomes outdated within a few months.
A practical example: in a company with a technical manual hundreds of pages long, the assistant works well if each chapter keeps its title and the product model it refers to. Without this metadata, when asked "how do I reset model X?" it might answer with the procedure for model Y, which is similar but different.
Security, permissions and privacy
An assistant on company documents must respect the same permissions as the documents. If a staff member cannot open personnel contracts, the assistant must not answer them using those contracts. That is why permissions must be applied already at the search stage, not left to the model's instructions.
Other points to cover:
- Personal data: assess whether the documents contain it and whether it needs to be indexed; apply the GDPR (privacy notice, contracts with providers, retention).
- Where the data lives: the vector database and the model can be in the cloud on European servers or, for special requirements, on your own infrastructure with open models.
- Business contracts with model providers that exclude the use of submitted data for training.
- Log of questions and sources used, for review and improvement.
On the regulatory side, keep in mind that internal assistants are also among the tools for which the AI Act requires adequate staff competence: we explain this in the guide to the AI Act for businesses.
Costs: the line items of a RAG project
| Item | Notes |
|---|---|
| Document analysis and preparation | Often the most underestimated item |
| Pipeline development | Import, chunking, indexing, automatic updates |
| Interface | Internal chat, integration into intranet, website, WhatsApp or management system |
| Embeddings and vector database | Costs usually modest, growing with document volume |
| Model usage | Proportional to the questions and the length of the passages provided |
| Maintenance | Updating sources, testing, reviewing answers |
A first assistant on a limited set of documents can be built quickly; projects with many sources, complex permissions and integrations take several weeks.
How to measure answer quality
- Set of test questions with expected answers, to repeat after every change.
- Source accuracy: does the answer cite the right document?
- Faithfulness: does the answer say only what is written in the sources?
- Rate of correct "I don't know" answers, i.e. when the information really is not there.
- User ratings and time saved searching for information.
How we work at NEXO
At NEXO we build RAG assistants starting from the documents: we analyze them with the people who use them, reorganize them, define permissions and sources, develop the assistant and connect it where it is needed, from the intranet to the website to the company management system. We work for businesses in Naples, Ischia and all over Italy; you can find the full picture on the page about artificial intelligence services for businesses. When the assistant also needs to act, not just answer, the next step is AI agents. If you want to apply the same principle to an app for your customers, see our app development service.
Frequently asked questions
What is the difference between RAG and fine-tuning?
RAG provides the model with information at the moment of the question; fine-tuning changes the model through training. RAG is cheaper, is updated by replacing documents and allows sources to be cited.
Are my documents used to train the model?
With the business contracts of the main providers, no, and RAG itself does not train anything. In any case, it should be checked in the terms of the chosen provider.
How many documents can a RAG assistant handle?
From a few dozen to many thousands. With high volumes, the quality of search and metadata matters more, such as date, department and document type.
Can the assistant still make mistakes with RAG?
Yes, but much less and in a more controllable way: if retrieval does not find the right passage or the document is ambiguous. That is why sources are cited and testing is done with real questions.
Want an AI assistant that truly knows your company? Message us on WhatsApp or by email from the contact page: we start from the documents you use every day.


