
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
- Prepare the documents
Documents are broken down into short sections, such as individual paragraphs of a manual or individual items on a price list.
- Search
The sections most similar to the question are found, by keyword search, by meaning-based search with embeddings, or both.
- Pass them on
The passages found are placed in the prompt together with the question, often with the instruction to answer only from them.
- 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.
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
partlyVox 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.
