Your RAG demo is brilliant. Your data is why production won't be.
The demo answered every question. Then it went live and quoted last year's price with total confidence. The model was fine. The documents were the problem.
The demo that lied
A team connects a language model to a folder of company documents and holds a demo. The assistant answers question after question, cites sources and sounds authoritative. Leadership approves the project on the spot.
Three weeks after launch, a customer asks about the price of a service. The assistant replies with a confident, perfectly worded figure from last year's price list. A support agent catches it by chance. A second wrong answer, about a return policy that was changed in spring, surfaces in a complaint.
When a retrieval system fails, the model is rarely the culprit. It is faithfully repeating what it was given.
Retrieval-augmented generation, or RAG, works by finding relevant passages in your documents and handing them to the model to answer from. The model is only as reliable as the passages it receives. That is why the quality of an AI assistant is decided long before anyone writes a prompt.
What a real company's documents look like
The demo folder was tidy because someone curated it. The real archive is different. It contains three versions of the same price list, with names like 'final', 'final_v2' and 'final_USE THIS ONE'. It holds scanned PDFs that are really photographs of paper, with no text for a machine to read. It has policy documents that were superseded, but never deleted, and slide decks whose meaning depends on a speaker who no longer works there.
A retrieval system treats all of this as equally true. Ask it a question and it will pick the passage that sounds most similar, not the one that is most current or most authoritative. Duplicates make it worse: if one old paragraph appears in five files, it is five times more likely to be found.
The cleanup that pays for itself
The unglamorous work before the model is where reliability is made. The steps are not complicated, but they have to be done deliberately, and ideally with someone from the business who knows which document is the real one.
- Decide the source of truth: for each kind of information, which document or system is authoritative.
- Remove or archive outdated versions instead of leaving them to compete with current ones.
- Attach metadata: document type, date, owner, product or region, and an 'effective until' date where one exists.
- Convert scans and images to real text, and check the result, since poor character recognition quietly turns a 0 into an 8.
- Split documents into sensible pieces, such as a whole policy clause or a full table row, rather than arbitrary blocks that cut a sentence in half.
With metadata in place, the system can filter before it searches: only documents marked current, only for this region, only the latest version. A large share of wrong answers vanish without touching the model.
Test it like a customer would
Before launch, collect real questions from support tickets, sales emails and chat logs. Do not write tidy questions yourself, because real ones are vague, misspelled and mixed with context. Build a set of a hundred or so, with the correct answers agreed by the people who know the business.
Run the system against this set every time something changes, whether it is the documents, the retrieval settings or the model. Track not only whether the answer is right, but whether the system cited the right source and whether it said 'I don't know' when it should. A system that admits ignorance is far more trustworthy than one that always sounds sure.
Do the boring part first
It is tempting to start with the exciting part: choosing a model, tuning prompts, building an interface. The teams that end up with an assistant people rely on usually did the opposite. They spent the first weeks reading documents, deleting duplicates, naming owners and agreeing what is true.
That work has a side effect worth noting. The cleaned, labelled archive is useful on its own. Staff find things faster, new hires learn faster, and every future AI project starts from a better foundation. Data cleanup is the one investment in AI that keeps paying even if you change the model next year.
Keep reading
Connecting ERP, CRM and your online shop: the quiet mistakes that cost the most
Integrations rarely fail on day one. They fail in month four, when an order appears twice, a price is stale and nobody can say which system is right.
Read articleBefore the dashboard: what a mid-sized company should build first in its data platform
Everyone wants dashboards and AI. Few want to hear that both depend on a boring layer underneath. Here is the order that keeps a data project from collapsing under its own weight.
Read article