A two-number Twilio communication system that answers WhatsApp questions from approved business documents, records voicemail, transcribes messages, and hands uncertain conversations to a person.
The Best AI Chatbot for WhatsApp is a deployable support system for a Canadian business that wants to remove a personal mobile number from public channels. It combines a dedicated Twilio WhatsApp sender, a separate Twilio Programmable Voice number, an editable RAG knowledge base, and controlled escalation. One number receives voicemail only; the other handles customer conversations through the WhatsApp Business Platform.
Why Best AI Chatbot for WhatsApp Uses Two Numbers
A shared number creates routing ambiguity and makes ownership changes harder. This project keeps Number A for public voice contact and Number B for WhatsApp, so voicemail behavior cannot interfere with messaging registration, templates, webhooks, or sender reputation.
Number A can replace the personal number on the Google Business Profile and other public business records after the relevant platform verifies the change. Number B is registered through Twilio Self Sign-Up, connected to the business portfolio, and reserved for WhatsApp conversations.
Best WhatsApp Chatbot Platform for a Two-Number Setup
The best WhatsApp chatbot platform for this workflow must control sender registration, inbound webhooks, message status callbacks, and human handoff without mixing voice and chat traffic. Twilio provides those channel primitives, while the application owns retrieval, confidence checks, logging, and document updates.
The design also reflects channel behavior in Canada. Statistics Canada reported that 76% of Canadians used instant messaging apps in 2020, supporting a messaging-first support path without removing a public phone option. The Canadian Internet Use Survey provides the underlying benchmark.
Core Features
| Feature | Description |
|---|---|
| Dedicated Public Voicemail Number | Personal-number exposure disappears because incoming calls never ring a private device. The voice flow plays a greeting, records the message, transcribes it, then sends the transcript by SMS, email, or both. |
| Separate WhatsApp Business Sender | Registration conflicts are avoided by assigning WhatsApp its own Twilio number. The sender profile includes the approved business name, description, image, and webhook endpoint. |
| Document-Grounded RAG Answers | Guesswork is reduced because responses are generated only after retrieving relevant passages from approved PDF or Markdown files. Each answer stores source references for review. |
| Confidence-Based Human Escalation | Uncertain answers do not reach customers as confident statements. A configurable threshold routes low-confidence questions into an escalation queue with the transcript, sender, and retrieved context. |
| Editable Knowledge Base | Repeated developer involvement is removed through an upload screen for replacement PDF and Markdown files. The system reprocesses, chunks, embeds, and versions the content. |
| Website Click-to-Chat Entry | Visitors do not need to copy a number. A prefilled WhatsApp link opens the registered sender with an optional starter message from the website button. |
| Delivery and Audit Logging | Missing replies are easier to diagnose because webhook receipts, retrieval scores, outbound message IDs, delivery callbacks, errors, and escalations are timestamped. |
Best AI Chatbot for WhatsApp Retrieval and Escalation
The incoming webhook is acknowledged quickly, its signature is verified, and the message is normalized before retrieval. The RAG service searches the approved knowledge base, sends the most relevant passages to the answer model, and returns a response only when the score clears the configured threshold.
A low score creates a human-review item instead of inventing an answer. The customer receives a brief acknowledgement, while the business receives the original question, phone number, retrieval score, and conversation history. This is the practical difference between the best chatbot for WhatsApp Business and a generic auto-reply flow.
System Architecture
- WhatsApp path: Twilio webhook request validation message queue RAG retrieval response or escalation delivery callback.
2. **Voice path:** incoming call
voicemail greeting
recording
transcription callback
SMS or email notification.
3. **Content path:** authenticated upload
file parsing
chunking
embeddings
versioned vector index.
- Website path: click-to-chat button WhatsApp conversation the same webhook and RAG controls.
OpenAI embeddings convert approved document chunks into searchable vectors. FastAPI handles signed webhooks and health checks, while PostgreSQL stores conversations, document versions, retrieval scores, and escalation status. These choices keep the message path inspectable and allow a later model or document-source change without replacing Twilio routing.
Best AI WhatsApp Chatbot Number and Public Contact Routing
The best AI WhatsApp chatbot number is a dedicated business sender, not the owner’s personal mobile and not the voicemail line. Separation makes testing safer, keeps public voice behavior predictable, and lets WhatsApp profile or template changes proceed without changing the Google-listed contact number.
Use Cases
- Answer routine product and ordering questions: Customers receive document-grounded replies about products, shipping within Canada, ordering, and technical details.
- Capture wholesale enquiries: Bulk-order questions are answered when the knowledge base contains the policy; incomplete requests are queued with contact details for follow-up.
- Replace a personal public number: The voicemail-only line becomes the published contact across the website, Google profile, and supported business-account fields.
- Connect website visitors to WhatsApp: The best chatbot platforms for website and WhatsApp integration 2026 should preserve one conversation path; this build sends website clicks directly into the same audited webhook.
- Support a small operating team: Among searches for best WhatsApp chatbot builders for small businesses 2025 2026, the useful distinction is editable content and reliable escalation rather than a large support dashboard.
Operational Acceptance Targets
| Check | Target |
|---|---|
| Webhook acknowledgement | Under 2 seconds before background processing |
| RAG response latency | Under 6 seconds at the 95th percentile for normal text questions |
| Escalation threshold | Configurable; initial validation begins near 0.72 retrieval confidence |
| Knowledge refresh | New document version searchable within 5 minutes |
| Delivery traceability | 100% of outbound replies linked to a webhook event and status callback |
These are deployment acceptance targets, not universal platform guarantees. Test sets should include at least 30 known-answer questions, 10 deliberately unsupported questions, duplicate webhook events, malformed signatures, and document-version rollbacks.
Twilio’s 2025 engagement study surveyed 7,640 consumers and 637 business leaders across 18 countries, a useful reminder that automation quality must be measured alongside trust and relevance. The methodology is documented in the State of Customer Engagement report.
Project Directory
kookabe-whatsapp-rag/
├── app/
│ ├── main.py
│ ├── api/
│ │ ├── whatsapp_webhook.py
│ │ ├── voice_webhook.py
│ │ ├── delivery_callbacks.py
│ │ └── admin_routes.py
│ ├── services/
│ │ ├── rag/
│ │ │ ├── ingest.py
│ │ │ ├── chunker.py
│ │ │ ├── embeddings.py
│ │ │ ├── retriever.py
│ │ │ └── answer_guard.py
│ │ ├── messaging/
│ │ │ ├── whatsapp_sender.py
│ │ │ ├── voicemail_notifier.py
│ │ │ └── escalation.py
│ │ └── security/
│ │ └── twilio_signature.py
│ ├── models/
│ │ ├── conversation.py
│ │ ├── knowledge_document.py
│ │ └── escalation_case.py
│ └── templates/
│ └── admin_dashboard.html
├── knowledge/
│ ├── source/
│ └── processed/
├── tests/
│ ├── test_rag_answers.py
│ ├── test_escalation.py
│ ├── test_whatsapp_webhook.py
│ └── test_voice_flow.py
├── scripts/
│ ├── ingest_documents.py
│ └── smoke_test.py
├── docs/
│ ├── number_configuration.md
│ ├── knowledge_updates.md
│ └── operations_runbook.md
├── Dockerfile
├── docker-compose.yml
├── requirements.txt
└── .env.example
CogworkLabs supports WhatsApp chatbot development and Twilio workflow automation when the installed project needs additional integrations, monitoring, content sources, or channel rules.
How to Answer Customer Questions Using Best AI Chatbot for WhatsApp
Download & Set Up the Project
Download, set up, and install Best AI Chatbot for WhatsApp to get the project running. If you hit any difficulty, contact us here.
Open the Admin Dashboard
Sign in to the dashboard, confirm both Twilio numbers, and verify that WhatsApp, voicemail transcription, email, and SMS status indicators are healthy.
Load Approved Knowledge
Upload the current PDF or Markdown files, choose the confidence threshold, and run the built-in question test against known and unsupported enquiries.
Activate Customer Messaging
Select Enable WhatsApp Bot, publish the click-to-chat link, and review replies, retrieval sources, delivery states, and escalated questions from the conversation log.
FAQs
How to route conversations in WhatsApp chatbots best practices?
Route every incoming message through one webhook, then branch by confidence, intent, and conversation state. Known questions should use RAG; unsupported or sensitive questions should create a human-review case with the full context and a clear acknowledgement to the sender.
What are the best practices for WhatsApp chatbot development?
Use a registered business sender, verify webhook signatures, store idempotency keys, ground answers in approved documents, and define measurable escalation rules. Test unsupported questions and delivery failures before publishing the website button, then review retrieval scores and unresolved conversations regularly.
