Get started

Glossary · AI and digital

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.

Updated on 27 November 2026

A question on the left, a stack of documents with three highlighted sections in the middle and an answer card with references to the sources on the right

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 [1].

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 searchGood at findingWeakness
Keyword searchNames, numbers, exact termsSynonyms, different wording
Meaning-based search (embeddings)Paraphrases, related termsExact numbers, very short queries
Structured queryOpen invoices, appointments, totalsFree 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.

A practical example

Example: heating engineers in the Emmental

The fictitious heating firm Heizungsbau Muster AG in the Emmental has around 300 installation and maintenance manuals from various manufacturers as PDFs. Young fitters often cannot find the right passage quickly enough. A RAG system answers questions such as “How often does the filter on this heat pump need cleaning?” and gives the manual and page.

The answer is only as good as the documents: if an outdated manual sits in the folder, the system quotes it just as convincingly. The business therefore clears old versions out of the collection once a year.

Invented example.

How VoxCRM helps

partly

Vox works on the basic idea of RAG: before Vox answers, it looks things up in your contacts, quotes, invoices, projects and notes instead of answering from memory, always with only the access rights of the person asking. It searches by names, numbers and keywords. VoxCRM does not offer meaning-based search across your own documents such as manuals or PDFs. Find out more under Vox.

FAQ

Frequently asked questions

Can’t find your question? Write to us at hello@voxcrm.ch.

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 and date

Sources

  1. Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks (Lewis et al.) (opens in a new window), arXiv, Cornell University. Version: Research paper from 2020, retrieved on 3 November 2026.
  2. KI im Berufsalltag: Chancen nutzen, Daten schützen (opens in a new window), Federal Office for Cybersecurity NCSC, with the FDPIC. Version: Published on 16 October 2026, retrieved on 3 November 2026.

Last updated:

Free handbook as a PDF

The VoxCRM Handbook for SMEs

Everything VoxCRM can do at a glance, plus exactly the areas you are interested in, in depth. Compiled for you and sent by email straight away.

  • Product, workflow, security and prices
  • Your modules with real screenshots from the app
  • With an industry part for trades, services, hospitality and retail
Free, no account needed
Cover of the VoxCRM Handbook for SMEs as a book

Try it free for 14 days.

Every feature, 60 minutes of Vox, no credit card. Then you choose a plan. Without a plan the account is paused, and you can export your data until it is deleted on day 60.

Go to the plan finder: which plan fits and what it costsBook a demoDemo