← All posts

RAG & AI Architecture

Stopping AI Chatbot Hallucinations: Seven Controls That Work

Updated 31 August 2026

An AI chatbot hallucination is a fluent, confident answer that is not supported by any source the system actually retrieved. In enterprise deployments it is almost never a mysterious property of the model. It is a retrieval failure that the generation step politely covered up: the assistant did not find the right passage, and rather than saying so, it produced the most plausible-sounding text it could.

That reframing matters, because it changes where you spend effort. Teams that treat hallucination as a model problem rewrite prompts for six months and plateau. Teams that treat it as a pipeline problem fix chunking, retrieval, conflict handling and refusal behaviour, and get measurable improvement. This guide covers the seven controls that work, in the order they pay off.

Why it is expensive, not just embarrassing

The Canadian case of Moffatt v. Air Canada, decided by the British Columbia Civil Resolution Tribunal in February 2024, is the reference point most legal teams now cite. The airline’s website chatbot described a bereavement fare policy incorrectly. Air Canada argued it should not be responsible for the chatbot’s statement. The tribunal disagreed and held the airline liable for the information its own chatbot gave.

The principle generalises: an assistant speaking on your behalf is you speaking. Internally the stakes are quieter but real – a wrong retention period, a wrong statutory entitlement, a wrong deployment runbook. This is why grounding is a control, not a feature, and why it belongs in the same conversation as enterprise AI chatbot security and compliance.

The five real causes

CauseWhat it looks likeWhere to fix it
The answer is not in the corpusConfident invention on a topic you never documentedRefusal behaviour, plus a content gap list
Retrieval missed itThe document exists; the assistant never saw itChunking, embeddings, hybrid search, reranking
Sources conflictBlended answer from two policy versionsVersion metadata and explicit precedence rules
Chunk boundaries broke the meaningHalf a table, a clause without its exceptionStructure-aware chunking, larger overlap
The question was ambiguousAnswered a different question wellClarifying questions before answering

Note that only the first is a genuine knowledge gap. Three of the five are retrieval engineering, and one is conversation design. None of them is fixed by a better model.

Control 1: ground it, and mean it

Grounding means the model is instructed to answer only from the passages supplied to it, and that this instruction is enforced rather than suggested. Three things make the difference between real grounding and the appearance of it:

  • Retrieved passages are supplied as clearly delimited data, separate from the instruction channel, so the model can tell corpus from command.
  • The instruction includes an explicit escape hatch: if the passages do not contain the answer, say so and stop. Without a named alternative behaviour, a model asked not to guess will still guess.
  • The output is post-checked for support. Every factual sentence should map to a retrieved passage; unsupported sentences are flagged, dropped or trigger a regeneration.

That third step – automated groundedness checking, sometimes run by a second cheaper model – is the highest-leverage thing most teams have not implemented. It converts hallucination from an invisible failure into a measurable one.

Control 2: fix retrieval before you touch the prompt

If the correct passage is not in the top results, no prompt will save you. Diagnose retrieval first, and diagnose it separately from generation: take fifty real questions, and for each, check whether the correct passage appears in the retrieved set at all. If recall is 60 percent, your ceiling is 60 percent, whatever the model.

The usual fixes, in order of payoff:

  1. Hybrid search. Combine dense vector similarity with keyword matching. Pure vector search is weak on exact identifiers – error codes, policy numbers, product SKUs – which is exactly what enterprise users search for.
  2. Reranking. Retrieve broadly, then rerank the candidates with a cross-encoder. Retrieve for recall, rerank for precision. This is usually the single largest quality jump per unit of effort.
  3. Structure-aware chunking. Split on headings, list boundaries and table rows rather than a fixed character count. A clause severed from its exception is worse than no clause.
  4. Metadata filtering. Version, effective date, region, entity, document type. Most enterprise wrong answers are right answers from the wrong context.

The underlying architecture is set out in what retrieval-augmented generation is.

Control 3: design the refusal

An assistant that never says “I do not know” is not accurate; it is untested. A healthy internal assistant abstains somewhere between 5 and 15 percent of the time. An abstention rate near zero is the clearest signal that a system is guessing, and it should be treated as an alarm rather than a KPI.

A good refusal does four things: states plainly that the answer is not in the available documentation, says what it did search, offers the closest related material it did find, and routes to a human or a ticket. A bare “I cannot help with that” trains people to stop using the tool almost as fast as a wrong answer does.

Control 4: cite at the claim, not at the bottom

A list of three links under a four-paragraph answer is decoration. Useful citation attaches to the specific claim, links to the exact section rather than the document, and shows the document’s version or last-updated date so the reader can judge freshness themselves.

Claim-level citation has a second effect that is easy to miss: it changes user behaviour. People spot-check the one claim that matters to them, catch errors early, and report them. Document-level citation gives them nothing to check, so they either trust everything or nothing.

Control 5: gate on retrieval confidence

Before generating, look at the retrieval scores. If the best candidate is weak, or if the top candidates are all mediocre and mutually unrelated, that is a signal to abstain or ask a clarifying question rather than to generate. Tune the threshold against a labelled evaluation set, and expect to tune it differently per content domain – a policy corpus and a troubleshooting corpus do not behave the same way.

Control 6: surface conflicts instead of resolving them silently

When two retrieved documents disagree, the worst behaviour is to blend them into one confident paragraph. The correct behaviour depends on why they disagree. If one supersedes the other, encode that as version metadata and apply it deterministically. If both apply to different populations, use metadata filters so the right one is retrieved for the right asker. If they genuinely conflict, say so, show both, and name the owner who can settle it.

Every surfaced conflict is a content defect the assistant found for you. Route them to the document owner. Over a year this is one of the most valuable side effects of deploying an assistant at all.

Control 7: build the evaluation harness before you launch

You cannot manage what you do not measure, and hallucination is invisible without a fixed test set. The minimum viable harness:

ComponentWhat it isWhat it catches
Golden set100 to 200 real questions with hand-written correct answers and source citationsRegressions on the questions that matter
Retrieval recall testDoes the correct passage appear in the retrieved set at all?Retrieval failures, isolated from generation
Groundedness scoreShare of answer sentences supported by a retrieved passageFluent invention
Unanswerable set30 to 50 questions your corpus genuinely cannot answerWhether refusal actually works
Adversarial setLeading, false-premise and out-of-scope questionsSycophancy and premise acceptance

The unanswerable set is the one teams skip and the one that predicts production behaviour best. Run the whole harness on every change to prompts, chunking, embedding model or retrieval parameters. Treat a groundedness drop as you would treat a failing unit test. The production-side instrumentation is covered in monitoring internal AI assistants, and the rollout sequence in running a 30-day pilot.

What prompting cannot fix

  • Content that does not exist. Write the document.
  • Content that is wrong. The assistant will faithfully repeat it, with a citation, which is worse.
  • Retrieval recall below your target accuracy. That is a hard ceiling.
  • Genuinely contradictory policies. That is an organisational decision, not a modelling one.
  • Questions that need current data from a live system. Connect the system, or refuse the question.

Frequently asked questions

What causes AI chatbot hallucination in enterprise deployments?

Most commonly a retrieval failure rather than a model defect: the answer is not in the corpus, retrieval missed the right passage, two sources conflict, chunk boundaries severed the meaning, or the question was ambiguous. Only the first is a knowledge gap; the rest are pipeline engineering and conversation design.

Does RAG eliminate hallucinations?

No. Retrieval-augmented generation reduces them substantially by grounding answers in real documents, but it introduces its own failure modes: retrieving the wrong passage, retrieving an outdated version, or generating beyond what the retrieved text supports. RAG plus groundedness checking, refusal design and claim-level citation is what actually gets the rate low.

What is a good abstention rate for an internal assistant?

Roughly 5 to 15 percent for a mature internal deployment. A rate near zero almost always means the system is guessing rather than that it is exceptionally well informed. Measure abstention separately from accuracy and treat a sudden drop as a regression signal.

Can we just use a bigger or newer model?

It helps at the margin and does not address the dominant causes. If the correct passage never reaches the context window, model capability is irrelevant. Fix retrieval recall, chunking and conflict handling first; changing model usually produces a smaller improvement than adding a reranker.

How do we measure hallucination rate?

Score groundedness: the share of factual sentences in an answer that are supported by a retrieved passage, evaluated against a fixed golden set and an unanswerable set. Automate it with a checking model, sample and review manually each week, and run the whole harness on every pipeline change.

Is a company legally responsible for what its chatbot says?

Courts have held so. In Moffatt v. Air Canada, decided by the British Columbia Civil Resolution Tribunal in February 2024, the airline was held liable for incorrect fare policy information given by its own website chatbot. Treat assistant output as a statement made by your organisation, and get jurisdiction-specific advice from counsel.

Next step

Build the golden set and the unanswerable set first – a hundred real questions with correct answers, and forty your documents genuinely cannot answer. Then measure any platform, IntelloWork included, on groundedness and honest refusal rather than on demo polish. It is a week of work that will tell you more than any vendor evaluation matrix.