DEV Community

Bakri Bitar
Bakri Bitar

Posted on

How We Built an AI Support Chatbot for WhatsApp That Never Hallucinates

Every "AI customer support" demo looks great until a real customer asks something the model doesn't know — and it confidently makes up an answer anyway. On WhatsApp, where a business's reputation lives in a single chat thread, that's not a bug you can shrug off. It's the whole product failing.

That problem is why we built RevoplyAI, and I want to walk through the actual constraints we designed around, not just the pitch.

The constraint: answer only from what the business gave you

Most "AI chatbot" tools are a thin wrapper around a general-purpose LLM. Ask it something outside its training data and it doesn't say "I don't know" — it pattern-matches to something plausible-sounding and ships it straight to a paying customer.

We took the opposite approach: the assistant is scoped to a retrieval layer built from the business's own knowledge base — PDFs, Word docs, website URLs, YouTube transcripts, FAQs — and it is instructed to answer only from that retrieved context. No matching context, no confident-sounding guess. It either escalates to a human or says it doesn't have that information. That single constraint changes almost every downstream design decision: chunking strategy, retrieval thresholds, prompt structure, and the handoff logic when confidence is low.

Why WhatsApp specifically is a harder integration than it looks

If you've never built on it: WhatsApp doesn't let you just spin up a bot with your own number and start sending template-free messages at scale. To do this safely and at scale you need to go through the official WhatsApp Business API as a verified Meta Tech Provider — which is the path we built on, instead of the unofficial browser-automation approach a lot of "WhatsApp bot" tools quietly rely on (and which gets numbers banned).

That decision meant:

  • Session-window rules (24-hour customer service windows vs. template messages)
  • Rate limits and quality-rating mechanics that Meta enforces per phone number
  • A "number warm-up" flow, because a business number that suddenly blasts high volume looks like spam to Meta's systems, even if every message is a legitimate reply

None of that is glamorous, but it's the difference between a demo and something a business can run production traffic through without getting their number flagged.

The architecture, briefly

  • Ingestion: business docs/links get parsed and chunked into a knowledge base per workspace
  • Retrieval: incoming message → embed → retrieve relevant chunks → confidence check
  • Generation: LLM answers strictly from retrieved context, in the customer's language (Arabic dialects and English are first-class, not an afterthought — this was one of the harder NLP problems, since a lot of models handle formal Arabic fine but fall apart on dialectal WhatsApp-style text)
  • Escalation: low confidence or explicit request → handoff to a human agent in a shared team inbox, with full conversation context carried over
  • Channels: same knowledge base and logic power WhatsApp, Telegram, and a website widget, so a business trains once and deploys everywhere

What this actually gets a business

Setup is under 15 minutes with no code, which mattered to us because most of our users are small teams, not engineering orgs. In practice this replaces a big chunk of repetitive first-line support (roughly 80% of inbound volume in our data) while keeping a human in the loop for anything nuanced, at a fraction of the cost of scaling a support team linearly with message volume.

Try it

There's a free plan (no credit card) if you want to see how it handles your own docs: revoplyai.com. Happy to answer questions in the comments about the retrieval setup, the WhatsApp API integration, or anything else — this is very much a "here's what we learned building it" post, not a sales pitch.

Top comments (0)