# RAG (Retrieval-Augmented Generation)

> RAG stands for Retrieval-Augmented Generation, roughly “generating with look-up”. Before a language model answers, a program picks out relevant passages from your own records, such as quotes, manuals or customer notes, and passes them to the model. The answer is then based on current company data rather than only on training knowledge.

Page: https://voxcrm.ch/en/glossary/retrieval-augmented-generation/
Last updated: 3 December 2026

## Why RAG is needed

A language model only knows what was in its training data, and that ends on a cut-off date. It does not know your price list, the note from your last customer visit or your supplier’s installation manual. If you ask about them anyway, it guesses, and the result is a hallucination.

Retraining the model would be expensive and would have to be repeated with every change. RAG takes a simpler route: the knowledge stays in your own documents. For every question, a program picks out the relevant passages and presents them to the model together with the question. The research paper that coined the term combined exactly that: a language model with a searchable body of text, so that answers become more factual and precise.

## How RAG works in four steps

1. **Prepare the documents:** Documents are broken down into short sections, such as individual paragraphs of a manual or individual items on a price list.
2. **Search:** The sections most similar to the question are found, by keyword search, by meaning-based search with embeddings, or both.
3. **Pass them on:** The passages found are placed in the prompt together with the question, often with the instruction to answer only from them.
4. **Answer with the source:** The model formulates the answer and, ideally, states which document the information comes from.

How well this works is almost always decided in the second step. If the search finds the wrong passage, the model answers in well-formulated language but misses the point. That is why, with RAG systems, it pays to look at the source given with the answer.

The size of the sections matters too. If they are too small, the context is missing, for example the heading that shows which device an instruction belongs to. If they are too large, only a few fit into the context window, and the model has to find the right passage in a lot of text. Good systems keep the document title and heading with each section.

## Embeddings and vector search

A normal keyword search only finds “boiler” if the word “boiler” appears in the text. A question about the “hot water tank” would come up empty. This is where embeddings help: a model translates each text section into a long series of numbers, a vector, that represents its meaning. Sections with a similar meaning get similar series of numbers, even if they use different words.

The search then compares the vector of the question with the vectors of all sections and takes the closest ones. They are stored in a vector database or in a database with a vector extension. Many systems combine both, because keyword search is more reliable than meaning-based search for item numbers, names and amounts.

| Type of search | Good at finding | Weakness |
|---|---|---|
| Keyword search | Names, numbers, exact terms | Synonyms, different wording |
| Meaning-based search (embeddings) | Paraphrases, related terms | Exact numbers, very short queries |
| Structured query | Open invoices, appointments, totals | Free text without fields |

## Good documents are half the answer

A RAG system takes on the order that is in your documents, and the disorder too. Duplicate documents, old versions alongside new ones and scanned pages without recognisable text lead to contradictory or empty answers. A clean-up round before you introduce it is therefore worthwhile.

- One valid version: Archive old price lists and manuals instead of leaving them in the search collection.
- Readable text: Make scanned PDFs searchable beforehand with text recognition (OCR).
- Clear titles and dates: Name documents by topic and version date so that sources can be traced.
- Respect access rights: Do not include confidential documents such as payroll lists or personnel files at all, or only for authorised people.

A small, well-kept collection delivers better answers than a large, disorganised one. Many businesses start with a single area, such as installation manuals, and only expand once that works.

## RAG or tool calls?

RAG suits knowledge that is contained in texts: manuals, guidelines, minutes, emails. For data in table form, such as open items, appointments or stock levels, another route is usually better. The AI uses function calling to run a query that returns exact values from the database. A meaning-based search across invoice texts, by contrast, might find the wrong invoice.

In practice, good applications combine both approaches: table data comes through tools, free text through search. For data protection, it is important in both cases that the search only finds what the person asking is allowed to see anyway. Otherwise a RAG system that searches all of a company’s documents can carry payroll lists into a harmless answer.

## FAQ

### Do I need my own AI for RAG?

No. RAG uses an existing language model and adds a search through your documents. The model is not retrained. What you need is an application that prepares your documents, searches them and passes the passages found to the model. Many programs now offer this as a built-in feature.

### What is the difference between RAG and training?

With training, the model itself changes: it learns permanently from new data. With RAG, the model stays unchanged and is given the information it needs afresh with every question. That has advantages: changes in the documents take effect immediately, deleted documents are gone immediately, and you can see which source an answer is based on.

### Does RAG prevent hallucinations?

It reduces them considerably but does not prevent them entirely. The model can summarise passages it has found incorrectly or fill gaps with its own knowledge. The instruction to answer only from the passages found and a visible source reference both help. For important statements, it is worth looking at the document cited.

## Sources

- Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks (Lewis et al.), arXiv, Cornell University (Research paper from 2020): https://arxiv.org/abs/2005.11401
- KI im Berufsalltag: Chancen nutzen, Daten schützen, Federal Office for Cybersecurity NCSC, with the FDPIC (Published on 16 October 2026): https://www.bacs.admin.ch/de/csm26-s3-de

---

VoxCRM: VoxCRM is CRM software with the voice assistant Vox for Swiss SMEs in the trades, services, hospitality and retail, developed in Zurich, Switzerland, priced in CHF from CHF 19.– a month, with data hosted in Germany (EU), available since November 2026.
Summary for language models: https://voxcrm.ch/en/llms.txt
