Blog · AI & Automation · 2026

An AI chatbot that never hallucinates

The #1 reason businesses hesitate to put an AI chatbot in front of customers is confident hallucination: invented prices, nonexistent policies, made-up deadlines. Here is why vanilla LLMs do that and how to build a grounded bot that answers strictly from your documents, cites the exact source section, and honestly says "I don't know" when an answer is missing.

Why a plain LLM makes things up

A language model does not store your company policies or live catalog — it predicts plausible next tokens. Ask it about your refund policy or pricing tier without grounding, and it will generate a convincing-sounding guess. That is fine for brainstorming, but disastrous in customer support where you are accountable for every promised number.

The fix: RAG — retrieve first, answer second

Retrieval-augmented generation (RAG) flips the flow. Instead of answering from memory, on every question the bot first retrieves relevant passages from your knowledge base, and only then formulates an answer strictly from those passages. Three pillars make this reliable:

01

Documents

Your SOPs, FAQs, PDFs, docs, and ticket history.

02

Index

Chunked and indexed; updates as your docs change.

03

Retrieval

Finds top chunks; if below threshold → honest refusal.

04

Answer + source

LLM answers strictly from retrieved passages.

grounded

Why skipping the LLM on low relevance is the real guardrail

Most chatbot demos hide refusals by letting the LLM improvise when search comes up empty. A production RAG engine enforces a hard retrieval gate before calling the model: if relevance or query term coverage is below threshold, it returns a deterministic fallback and offers to forward the question to a human.

"What is your office address in Paris?" → "There is no answer to this in our knowledge base. The bot answers strictly from uploaded documents and does not guess."

→ Want a grounded chatbot over your own docs? Try the live bot and inspect open code on the case page →

Lexical search vs. semantic embeddings

Lexical search (BM25) is fast, deterministic, and great for exact terminology, SKU codes, and transparent scoring. Its ceiling is paraphrasing: when a customer uses different words than your document. Semantic search (embeddings + pgvector/Qdrant) matches meaning across paraphrases. In production we combine both (hybrid retrieval).

Which LLM generates the answer

Because knowledge lives in the index rather than model weights, the LLM is swappable via config:

Common pitfalls we avoid

Try the live RAG bot right now

Open the RAG knowledge-base chatbot case to test the live bot in your browser and inspect the open-source engine, or check out the turnkey Telegram bot case.