Skip to content
Ask for a Budget
TechnologyFebruary 24, 202611 min readUpdated on November 11, 2026

RAG in practice: what decides whether the assistant is right or makes things up

A RAG on 374 documents, 638 real questions: content was the bottleneck, not the model. Old text beats new, and the system must know when to be quiet.

RAG in practice: what decides whether the assistant is right or makes things up
Índice do artigo
faltam 10 min de leitura

We built an assistant over 374 documents from our own website and measured it with 638 questions written by the content team. In more than a third of them, the retrieved material did not cover even half of the answer. The model was not to blame at all.

Almost every company that has tried to put an AI assistant on top of its own documentation has gone through the same sequence: the demo impresses, the pilot excites, and real use disappoints. The assistant answers with a policy that was revoked, quotes a price from three years ago, or makes up a polite answer to something nobody ever wrote down.

When that happens, the normal reaction is to switch models. It is the most visible piece and the easiest to swap. And it is almost always the wrong piece.

This article shows what really decides the quality of an assistant connected to a company's knowledge base, with the numbers from a system we built and measured.

Article summary

  • RAG means searching before answering. The model stops writing from memory and starts writing from passages retrieved from your base, with the source cited.
  • The bottleneck is almost never the model or the database. In our measurement, the retrieved material covered on average 54.1% of the terms in the correct answer: a good part of the content did not exist.
  • The number one risk in production is old content. For the question about price, 4 of the top 5 results came from 2019 to 2022.
  • The system needs to be able to say it does not know, and the obvious signal for that does not work: a question about carrot cake scored higher than a question about our own service.

RAG means searching before answering

RAG, short for Retrieval-Augmented Generation, is an architecture with a simple rule: the system searches your base before letting the model write anything. The passages it finds go into the request, and the model drafts the answer from them, citing where each claim came from.

The practical difference lies in what happens when information changes. Without RAG, the knowledge is embedded in the model and changing a policy means redoing an expensive process. With RAG, the knowledge stays outside the model: you fix the document and the next answer already comes out right.

Isometric illustration of a question passing through a shelf of documents before reaching the language model

That is why RAG is the default choice for corporate knowledge. Policies, prices, procedures and catalogs change all the time, and the cost of keeping that up to date needs to be the cost of editing a document, not of reprocessing a model.

The trade-off is that the quality of the answer now depends entirely on the quality of what is written. The system does not fix a poorly written manual. It exposes it.

It is not the same as attaching a PDF in the chat

Attaching a document to a conversation and asking about it solves a problem for one person, at that moment. Many people already do this, and do it well. That is not RAG, and confusing the two is what makes projects start with the wrong expectations.

The difference is the same as between a spreadsheet and a system. Attaching works as long as the volume fits in the conversation, as long as the person asking knows which file to open and as long as nobody needs to audit where the answer came from. None of those three conditions survives the scale of a company.

Attaching the file in the chat

Solves one question
  • The person asking needs to know which document to open
  • Limited to what fits in the conversation
  • No control over who can see what
  • Each person redoes the previous person's work
  • No record of which version was used

RAG

Solves the whole category of questions
  • The system finds the document, not the person
  • Thousands of documents, with no conversation limit
  • The search respects permissions per source
  • A fix in the document applies to everyone
  • Each answer points to its source

In short, attaching is a personal tool and RAG is a piece of infrastructure. Companies that treat the second like the first end up with dozens of outdated copies of the same manual circulating in private conversations.

Where this really applies in a company

The pattern that makes a use case worthwhile is always the same: there is written knowledge, it changes, and qualified people spend time looking for it. Where those three conditions show up together, RAG pays off.

  • Customer serviceAnswer with the policy that applies today, not the one in the old manual.
  • PresalesAnswer a client's security questionnaires and tenders (RFPs) without stopping the team for days.
  • OnboardingGive the new employee answers to the questions they would be embarrassed to ask their manager.
  • Internal help deskAutomatically close the tickets that only ask "where is the procedure?"
  • LegalFind the equivalent clause in a contract base nobody reads in full.
  • ComplianceShow the auditor where it is written that the company does that.
  • Back officeLook up the approval limits and sign-off rules nobody memorizes.
  • Field workLook up a manual of hundreds of pages on a phone, on the client's site.

The first three concentrate volume, because they involve many people asking the same thing. The last ones concentrate value per query, because each answer saves hours of an expensive professional.

We built one and measured it: the numbers

To write this article based on something other than theory, we built a RAG over X-Apps public content: blog articles, service pages, case studies and FAQs. It is an institutional corpus in Portuguese, the kind every company has.

374Documents indexed
2,563Passages generated
638Questions evaluated
0.4 sTo build the index

The test simulates the real situation: the question exists and was written by a person, but its text is not in the index. It is the unseen question, which is the only case worth measuring. Asking something that is already written with the same words proves nothing.

First result48.6%
In the top 362.2%
In the top 568.0%
In the top 1074.9%
In the top 2078.5%
How often the right document appears in the list handed to the model. Doubling the list from 10 to 20 passages bought 3.6 points.

The important reading of this curve is not the top number, it is its shape. Between 10 and 20 results the curve flattens: handing the model twice as much material bought 3.6 percentage points. That means what is missing is not further down the list. It is outside the base.

The bottleneck is content, not the algorithm

There is a second metric, and it is the one that changes the conversation. Besides asking whether the right document showed up, we measured how much of the correct answer was actually present in the retrieved material. The result was 54.1% on average, and only 63% of the questions had at least half of the answer covered.

Translated into project language: in 37% of the questions, more than a third of the total, the retrieved material did not cover even half of the answer. In those cases, no model in the world would produce a good answer, because much of the necessary information was not written anywhere in the material. The system was working. The base was incomplete.

This has a good practical consequence. Measuring content coverage is cheap, runs without hiring anything and points out exactly which questions in your business have no documented answer. That list is often worth more to operations than the assistant itself.

Old content beats new content

This is the risk that shows up most in production and is the least anticipated. We asked the system how much it costs to develop an app, which is one of the most frequent commercial questions there is.

PositionDocument retrievedYearScore
1UX best practices for apps201914.26
2Is it worth investing in wearable apps201913.58
3Current software development page202612.50
4How much it costs to build an app for your startup201911.90
5How much it costs to host a system202211.85

Query to the prototype index on August 31, 2026. Lexical search score, no date filter.

Four of the top five results are from 2019 to 2022. The only current document came third. A naive assistant would put together a convincing answer about app pricing using material from the time when the iPhone 11 was a new release.

The fix is not sophisticated, and that is exactly why it needs to be decided in the project and not discovered later. Each document enters the index with a freshness tag, derived from its date. Content below a threshold is left out of answers, and time-sensitive content, such as price and timelines, is always left out.

The system needs to be able to say it does not know

An assistant that answers everything is worse than an assistant that answers little, because it destroys trust with the first wrong answer and nobody comes back. The ability to abstain is the system's most important safety behavior, and the most neglected in prototypes.

The intuitive way to implement this is to look at the search score: if the best passage scored low, the question is out of scope and the system stays quiet. We tested it, and the result was the opposite of what we expected.

QuestionSituationTop scoreConfidence (top over median)
"what is the best carrot cake recipe"Out of scope9.521.13
"do you develop AI chatbots"In scope8.881.01

The question about carrot cake scored higher than the question about our own service, on both metrics. The reason becomes visible when you open the results: in Portuguese, "there is no cake recipe" (a set formula) is a common expression in corporate text, and "receita", the word for recipe, also means revenue. With a few hundred texts in Portuguese, almost every frequent word appears somewhere.

Isometric illustration of a filter that sorts questions before they reach the document shelf

The project conclusion is direct: the decision to answer or stay quiet needs to happen before the search, and it needs to understand the question, not count words. In practice this becomes a cheap classifier, with an input of a few dozen tokens, that decides whether the topic is the company's business before any significant cost.

It is a small piece, and it is what separates a reliable assistant from a generator of plausible answers.

The three pieces of a RAG that works

The design that survived the measurement has three stages, and each one uses the cheapest tool that solves that problem.

1. Gatekeeper, a fast model decides whether the question is the company's business and whether it asks for time-sensitive data
2. Search, retrieves the passages, limits how many come from the same document and excludes old content
3. Writer, a better model writes the answer using only the retrieved material, citing the source
The expensive model is only called when the question has passed the two previous filters.

The detail that saves money is using different models in different roles. The gatekeeper processes a few dozen tokens and runs on every question, including those that will be refused. The writer is expensive and only comes in when there is already good material on the table. Reversing that order, which is what a naive prototype does, means paying writing prices to answer about carrot cake.

The limit on passages per document is the other detail that looks bureaucratic and is not. Without it, a single long page takes over the whole context and the rest of the base becomes invisible to the model.

How much of this is software and how much is curation

The software part of a RAG is smaller than the industry suggests. The index of our entire corpus, with 2,563 passages, is built in 0.4 seconds and fits in a file of a few megabytes. No database, search server or paid service was involved in getting to the numbers in this article.

Isometric illustration of a small closed machine next to a large library being constantly tended

The curation part is the one with no shortcut. It is made of decisions only someone who knows the business can make: which document is the official version of each topic, what is obsolete and should go, which frequent question still has no written answer, and who owns keeping that up.

It is the difference between a system that is delivered once and a system someone takes care of.

In practice, this turns into a short, verifiable routine that fits in five points.

  • There is a person responsible for reviewing the questions the assistant could not answer
  • Each relevant topic has a document declared as the official source
  • Obsolete content is removed from the index, not just left behind on the site
  • Price, timelines and SLA have their own treatment, separate from the rest of the knowledge
  • There is a set of real questions that runs with every change, to detect regressions

When the list above has no owner, the assistant degrades on its own: the base ages, answers slowly get worse and nobody notices until a customer complains.

When RAG is not the answer

Not every AI problem is a retrieval problem, and insisting on RAG where it does not fit produces complicated systems that solve things poorly.

RAG is the way

  • The knowledge changes often
  • The content is private and cannot leave the company
  • The answer needs to cite the source to be accepted
  • The volume of documents exceeds what one person can know
  • Many people ask the same questions

Look for something else

  • The problem is tone of voice or format, not knowledge
  • The task is classifying or extracting fields from one document at a time
  • The content is small and stable, and fits entirely in the request
  • The answer depends on a number that lives in a system, not in a text
  • The question requires carrying out an action, not just informing

The last two items in the right column are the most common boundary in practice. When the answer depends on a contract balance or an order status, the data is in the ERP and not in any document, and the design starts to require querying a system. When the user wants something to happen, not just to be informed, the subject becomes an agentic system.

Where to start without spending

The first step costs little and answers the most expensive question: does your base support the questions your business receives?

Gather the real questions operations already answer in writing today, in customer service, sales and help desk. Build a simple index over the documents that exist. Run the questions and read the retrieved passages, without asking any model for an answer. If the passages answer, the project is viable and the technology choice becomes a detail. If they do not, you have just found out, for free, that the project was about content and not software.

This test is what separates the assistants that make it to production from the ones that only looked good in the demo.

Sources and method

The numbers in this article come from a retrieval prototype built on X-Apps public content, run on August 31, 2026. The corpus has 374 documents and 2,563 passages, with a target of 350 words per passage and overlap between neighboring passages.

The evaluation used 730 questions written by the content team, each with a known source document. We discarded 5 with no document body and 87 that carried no distinctive term from the expected document, leaving 638 questions. The test setup removes the text of the questions themselves from the index, to simulate an unseen question.

Two honest caveats about the scope of these numbers. The first is that they measure retrieval, that is, whether the right material reaches the model, and not the final quality of the written answer. The second is that the corpus is institutional content in Portuguese: bases of another nature, such as code, case law or multilingual documents, may behave differently.

Frequently asked questions

It is an architecture in which the system first searches the company's knowledge base for relevant passages and only then asks the model to write the answer using those passages, with the source cited.

Previous post
KYC and document verification: what drives cost and complexity
Next post
Sensitive data in RAG: how to prevent leaks in AI chatbots
Newsletter

One email a month, no noise

What we learn shipping custom software and applied AI.

Related articles

Cerebras model for fast RAG: which one to use and what the pipeline needs12 min · Technology
Local LLM for law: running models on a Mac with Apple Silicon15 min · Technology
Regression testing for prompts and RAG: how to keep AI from getting worse3 min · Technology
The AI ecosystem for building software: how the pieces connect6 min · Technology
What is a web app and what are its benefits?9 min · Technology

Accelerate your business with X-Apps

Ask for a Budget
X-Apps is an IT provider partner and advised by
Gartner
Receive our e-mails
News on software and applied AI.
Follow X-Apps