Knowledge assistants

RAG explained: answers grounded in company knowledge

Reading time
9 minutes
Updated
Published
Written by
modernagents editorial teammodernagents is an AI automation agency from Austria for SMEs, based in the Vienna region.
AI-generated image: Removable hard drive in an indigo docking cradle on corrugated cardboard

Perhaps your customer service team searches manuals, folders and old emails every day for the right instructions. An AI assistant is supposed to make that faster, and the vendor says it uses RAG to do so. How does an AI get at the knowledge in your own documents, and when can you trust its answer?

RAG stands for retrieval-augmented generation, roughly "writing text after a search". An AI application searches for relevant information and gives it to a language model as the basis for its answer. In your business, that might mean an assistant finds an internal procedure, explains the steps that matter and shows which source it took them from.

An example: a manufacturer of ventilation units in Zaragoza with 45 employees supports two similar models, Model A and Model B. Maintenance on Model A follows a different sequence from Model B. Today, a technician calls from a customer site, and Pilar from customer service looks up the steps in the right manual. With the assistant, that search should be done for her, and the assistant should say which manual the answer comes from.

Key takeaways

  • The language model does not need to permanently memorize your current documents; instead it receives selected information from them for each question.
  • Whether the answer is correct depends on the search, on your sources and on the wording afterwards, and RAG does not by itself make poor documents accurate.
  • An answer can be wrong even when a source link sits next to it, and privacy and access control do not arise just because you use RAG.
  • Recurring questions, reliable existing documents and an area where searching or explaining takes noticeable time today are a good fit for a first trial.

01 / 11

Why is a language model alone insufficient?

A general language model brings capabilities and knowledge from its training. But that does not mean it knows by itself the current maintenance manual for Model A, the contract version you agreed with a particular customer or the internal access permissions in your business. When the answer sounds fluent, it is easy to miss that the model lacks exactly that access.

RAG adds information at the moment someone asks, from a collection you have set aside for that purpose. The original research approach combined a trained model with an external information store, described in Lewis et al.: retrieval-augmented generation. That publication is an important technical foundation, but its experimental results are not a promise of how well a company assistant works today.

What matters is how your application is actually built: which documents the assistant may search, which version of a manual applies and who is asking right now, Pilar or a first-year apprentice. These are organizational and technical decisions you have to make, and the word RAG does not answer them yet.

02 / 11

What happens when Pilar asks the assistant?

In this made-up example, a technician calls Pilar from a customer site. She asks the assistant: "Which steps do I need before replacing the filter on Model A?"

The application recognizes the model name, searches the approved documentation and finds the relevant section in the manual for Model A. It gives that section to the language model together with its title, version and the important safety instructions. The model turns this into an understandable answer and names the source.

Suppose the search finds only the manual for Model B. Then the assistant must not simply transfer the steps to Model A. And if a safety-critical prerequisite is missing, it should name the gap or direct Pilar to the complete instructions. So the correct response may be a clarification question, even when the software could technically generate an answer.

03 / 11

How does RAG work? The process in five steps

Behind Pilar's question are five steps, and at each one someone has to check something:

Step What happens What needs checking
Prepare sources Collect documents and metadata Validity, permissions and ownership
Make content searchable Extract text and useful sections for search Preserve tables, exceptions and context
Retrieve information Select relevant authorized passages Respect product, period and user
Generate an answer Turn the passages into an understandable explanation Avoid unsupported additions
Display the answer Show answer, source and next step Make verification and limitations clear

The first two steps often run independently of any particular question. When someone changes a manual, the new version first has to reach the search collection. The last three steps happen while Pilar is asking. So if something goes wrong while the manuals are being imported, that can affect today's answers while the chat appears to work normally.

04 / 11

What do chunk, embedding, vector database and reranking mean?

These four words come up often when vendors explain RAG. Here is what they mean for Pilar's question.

A chunk is a section of content that the search can find on its own, for example a paragraph from the manual for Model A. It needs enough context to remain understandable. If a paragraph is separated from its heading or from an exception, its meaning can change or be lost.

An embedding is a representation of content in numbers. With it, a search system can compare meaning even when different words are used. If Pilar asks about "swapping the filter", the search can also find a section on "replacing the filter" this way. But these numbers do not prove that something is true, and they do not by themselves check who may see what.

A vector database stores such numbers and supports similarity search over them. It is one possible technical component, not the whole RAG system. What else belongs to it is described below in the section for your IT team.

Reranking reorders hits the search has already found. It can bring a relevant section to the top, but it cannot use a source that was never found in the first place. The hybrid-search guide explains this selection in more detail.

05 / 11

RAG is not a specific product or a synonym for chat

Behind a chat window there can be a general model, a simple search, RAG or a mix of several tools. You cannot tell the setup from the chat window alone. A button for uploading files also says little about how long the content is stored, who may see it and how it is updated.

RAG is not limited to custom-built software either. Microsoft describes such retrieval and answer workflows in Copilot Studio. There, as with custom software, what matters are the sources actually connected and their properties.

When you choose a product, ask how the data actually flows: where an answer comes from, whose identity the system searches with, for example Pilar's permissions, and how a manual disappears from the answers when you delete it. A technical term for the architecture is not a substitute for those answers.

Got a workflow like this?

Tell me about it. Honest take and a rough price, usually within a day.

06 / 11

How do search, RAG, fine-tuning and a database query differ?

Ordinary search returns results, meaning documents and the places in them. RAG also turns these into a written answer. That can help when several sections have to be combined or technical texts explained in plain words. If Pilar just wants to open a known file anyway, such as the wiring diagram for Model B, a good search may already be enough.

Fine-tuning changes a model through additional training. That can make sense if the model should learn something for a recurring task or in its style of answering. But it does not by itself replace access to current documents the person asking is allowed to see. You can combine both approaches, but first be clear about which problem you want to solve.

For exact quantities, totals or the current status of a transaction, such as a payment, a direct database query is often more suitable. If Pilar wants to know how many replacement filters for Model A are in stock today, she may need a current query in the inventory system. A text passage from an older PDF is not an equivalent source for that.

07 / 11

What does RAG not guarantee?

Suppose the assistant shows Pilar an answer with a source link, and the answer is still wrong. That can happen. The source may be out of date, the key sentence may concern another variant of the unit, or the model may draw a conclusion the source does not support. So check individual claims against the section the assistant actually used.

You also have to arrange privacy and access control yourself. Documents must be limited to what is allowed before the answer is written. If an apprentice who may not see the salary list asks, the model must not receive it for its answer either. Sources may also contain manipulated instructions, and the assistant must not treat them as commands.

And knowledge needs maintenance. When responsibilities or policies change, the application must take in the new versions and handle older content according to its validity. At the ventilation manufacturer, Pilar makes sure that a new manual for Model A replaces the old one. An assistant whose sources nobody is responsible for will get worse over time, even if its model remains just as capable.

08 / 11

When is a first RAG trial worthwhile?

Areas like Pilar's customer service are a useful starting point. The same questions come back, there are reliable manuals, and searching and explaining take noticeable time today. An area where knowledge exists only in people's heads, or where every decision requires a lot of personal judgement, is less straightforward.

You can start on this week. Collect the real questions your team asks and write the authoritative source next to each one. Then check whether your existing search or a product you already use covers the need. For the gaps that remain, a limited RAG trial can make sense.

The trial should include four kinds of questions. At the ventilation manufacturer, it might look like this:

  • a question about Model A that the assistant should answer correctly
  • a question for which no instructions exist yet
  • a question where a wrong version of the manual is found
  • the same question from two people with different reading permissions, such as Pilar and an apprentice

Measure the time until a checked solution is in place, including checking and rework. The RAG acceptance plan helps with this. If the need is confirmed, the architecture guide covers the technical decisions.

Rather than a new assistant, a useful first outcome may also be a better collection of sources. Suppose Pilar notices while collecting questions that two manuals contradict each other, and both are considered authoritative. That finding is valuable. Resolve the contradiction before you expect a language model to turn it into dependable working instructions.

09 / 11

For your IT team

Conventional text search and metadata filters are often also useful, meaning filters on additional information about a document. This applies, for example, to exact product numbers or to periods and areas of validity, such as whether a section applies only to Model A.

Limit the documents to what the person asking may see before they reach answer generation. Text from sources may contain manipulated instructions. It must not get the authority of a system command.

Changes to the sources have to reach the search collection after import. An import failure can affect answers while the chat interface looks normal. Clarify with the vendor which identity is used for the search and how a deleted source disappears from the search collection.

10 / 11

Take the worksheet

Worksheet

Download the editable CSV table

StepJobFailure
Interpret questionForm search requestMisread abbreviation
RetrieveFind relevant permitted contentMissing policy
Select contextSupply useful excerptsException omitted
GenerateExplain supported answerUnsupported inference
CiteEnable inspectionInaccessible source

Columns to fill in, in the file: Your value / observation, Owner, Next action.

Download the editable CSV table (CSV). Add your own values, owners and open actions. This worksheet contains no measured client results.

11 / 11

These modernagents guides cover related decisions about AI knowledge assistants:

If we are to review a specific workflow with you, start with a description of the task, the systems involved and typical exceptions. Discuss it with modernagents.

ShareEmail

Related reading

AI knowledge assistants

Got a workflow like this?

Tell me about it. Honest take and a rough price, usually within a day.

Robert Van Ysendyck · Founder & Managing Director