GUIDE · AI AGENTS

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

MeasureWhat it doesIts limit
RAG over your documentsGives the model the right passagesSometimes misses the right passage
Mandatory citationsMakes every statement checkableA citation can be misread
Permission to say I don’t knowReplaces a guess with an admissionSomeone has to take over
Extract passages firstAnchors the answer in exact textSlower on long documents
Numbers read from your systemsRemoves invented amountsNeeds an integration
Test question setMeasures quality after every changeOnly covers expected cases
Targeted human reviewCatches errors before they commit youTakes time: keep it for real risk

Use cases

Where RAG helps

Anywhere the right answer already exists in a company document.

Questions about your policies
Searching contracts
Product specs
Internal procedures
Customer service
Responses to tenders
Searching client files
Onboarding new staff

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.

Get started

Ready to automate your first operational workflow?

30 minutes. Free diagnostic. We identify one real workflow to automate: volume, tools, exceptions, guardrails and operational ROI.

No commitment Confidentiality scoped Measurable objectives