AI Hallucinations: Why They Happen and How RAG Keeps an Agent on Its Sources
A language model predicts the most likely text; it does not check facts. So it sometimes makes things up, confidently. Retrieval-augmented generation (RAG) has it search your documents first and answer from what it finds. That reduces AI hallucinations without eliminating them: a business agent cites its sources, and what matters gets checked.
- Hallucinations: reduced, never eliminated
- Every answer points to its source
- Allowed to say it does not know
- Numbers come from your systems
A hallucination
A plausible but false answer, stated with confidence. NIST calls it confabulation: erroneous or false content, confidently presented.
RAG
Retrieval-augmented generation: the system first finds the relevant passages in your documents, then the model answers from them.
What is still needed
Up-to-date documents, checkable citations, tests on real questions, and a check on answers that commit the business.
Why does AI hallucinate?
A large language model is trained to predict the next word. It learns the shape of a good answer very well: tone, structure, vocabulary. But a rare fact cannot be inferred from a statistical pattern. OpenAI’s example is a pet’s birthday: no pattern predicts it.
NIST’s generative AI profile, published in July 2024, describes these confabulations as a natural result of how generative models are designed. The model can even invent citations or reasoning that seem to justify a wrong answer.
OpenAI adds a second cause, in a September 2025 paper: training and evaluation reward guessing over admitting uncertainty. A model graded on accuracy alone is better off guessing, like a student on a multiple-choice test.
What is retrieval-augmented generation (RAG)?
RAG stands for retrieval-augmented generation. The approach was described in 2020 by Patrick Lewis and colleagues: combine the model’s own memory, learned in training, with an external memory it searches at answer time.
In a business, it works in three steps. A question comes in. The system searches your documents for the relevant passages: policies, contracts, product specs, procedures. Then the model gets the question with those passages and the instruction to answer only from them, saying where each statement comes from.
Two practical benefits. You update what the system knows by changing a document, with no retraining. And every answer can point to its source, which makes it checkable.
Can AI hallucinations be eliminated?
No. They can be reduced a great deal, not eliminated. OpenAI writes that accuracy will never reach 100%, because some questions have no possible answer, but that a model can abstain when unsure. Anthropic, which makes Claude, says its techniques significantly reduce hallucinations but do not eliminate them entirely, and advises always validating critical information.
RAG has its own failure modes. Retrieval can miss the right passage or return an old version of a document. The model can misread a correct passage. And a booby-trapped document can hide instructions. OWASP lists misinformation among the top ten risks for language model applications: the danger is that false output gets trusted and acted on.
How a business agent is kept to its sources
Simple rules, applied everywhere. The agent answers only from the documents provided, not from general knowledge. It has explicit permission to say it does not know, or to hand off. With a long document, it first extracts the exact passages, then reasons from them. Every statement cites its passage; a statement with no passage is removed. These are the techniques Anthropic’s documentation recommends.
Numbers never come from the model. A price, a balance or a delivery date is read from the system of record, the CRM, ERP or accounting software, then inserted into the answer. The model writes; it does not invent the amount.
Finally, the knowledge base is maintained: one version of each policy, a date on every document, old price lists removed.
How do you check an AI agent’s answer?
Open the cited source and confirm the passage says what the answer claims. For a number, compare it with the source system. An answer with no source is a guess.
For an agent in production, checking also happens upstream. Build a set of real questions with known answers, including some your documents cannot answer, and run it after every change. Ask the same question several times: answers that disagree point to a likely hallucination. And keep human review for what commits the business: a price, advice, a decision about a person.
When the chatbot is wrong, the business answers for it
In February 2024, British Columbia’s Civil Resolution Tribunal decided Moffatt v. Air Canada. The airline’s website chatbot said a bereavement fare could be claimed after travel, while the policy page said otherwise. Air Canada argued it was not liable for what its chatbot said. The tribunal found the company responsible for all the information on its website, whether it comes from a static page or a chatbot, and ordered it to pay $650.88 in damages.
The lesson for a small business: what your agent says on the company’s behalf commits the company. An agent that cites the current policy, or says it does not know, stays out of that kind of dispute. Castor IA, based in Québec City, builds AI agents for businesses across Canada.
What reduces hallucinations, and the limits
| Measure | What it does | Its limit |
|---|---|---|
| RAG over your documents | Gives the model the right passages | Sometimes misses the right passage |
| Mandatory citations | Makes every statement checkable | A citation can be misread |
| Permission to say I don’t know | Replaces a guess with an admission | Someone has to take over |
| Extract passages first | Anchors the answer in exact text | Slower on long documents |
| Numbers read from your systems | Removes invented amounts | Needs an integration |
| Test question set | Measures quality after every change | Only covers expected cases |
| Targeted human review | Catches errors before they commit you | Takes time: keep it for real risk |
Sources
- NIST AI 600-1: Generative AI Profile, section 2.2 Confabulation (July 2024)
- OpenAI: Why language models hallucinate (September 5, 2025)
- Lewis et al.: Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks (arXiv, 2020)
- Anthropic: Reduce hallucinations (Claude documentation)
- OWASP: LLM07:2026 Misinformation
- Moffatt v. Air Canada, 2024 BCCRT 149 (CanLII)
Use cases
Where RAG helps
Anywhere the right answer already exists in a company document.
Frequently asked questions
Why does ChatGPT make things up?
Because it predicts the most likely text rather than checking facts, and its training often rewards a guess over an admission of uncertainty. Rare facts are the most exposed.
What is RAG in AI?
Retrieval-augmented generation: before answering, the system searches a document base for relevant passages, then the model answers from those passages and can cite them.
Does RAG eliminate hallucinations?
No. It reduces them by giving the model the right text, but retrieval can miss a passage and the model can misread it. You still need citations, tests and a check on important answers.
How can I tell if an AI answer is reliable?
Check that it cites a specific source, open the source and compare. An answer without a source, especially a number or a legal reference, must be confirmed before use.
Is a company liable for what its chatbot says?
In Moffatt v. Air Canada (2024), a British Columbia tribunal held that the company is responsible for all the information on its website, whether it comes from a page or a chatbot.