Complete User Guide
Everything you need to set up, configure, and run AI-powered WhatsApp customer support for your business.
Platform Overview
WA Support AI is a multi-tenant SaaS platform that lets e-commerce and service businesses automate WhatsApp customer support using AI. Each business (company) has its own isolated workspace — conversations, customers, knowledge base, and settings are never shared between companies.
End-to-End Message Flow
Customer sends WhatsApp message
→ Meta sends webhook → POST /api/webhooks/whatsapp
→ Message stored · QueueJob created
→ Cron fires every 60s → /api/queue/process
→ Check subscription quota
→ Check escalation keywords → notify agent if triggered
→ Search knowledge base (RAG) → inject matching content
→ Build last-20-message history
→ Call OpenAI GPT-4o
→ Send AI reply via WhatsApp Cloud API
→ Store reply · Increment usage counters
User Roles & Permissions
Every user belongs to a company and has one of these roles:
| Permission | Company Admin | Support Agent |
|---|---|---|
| View dashboard, conversations, analytics | ✅ | ✅ |
| Reply to conversations | ✅ | ✅ |
| Toggle AI per conversation | ✅ | ✅ |
| Close / change conversation status | ✅ | ✅ |
| View customer profiles | ✅ | ✅ |
| Edit customer notes & lifecycle stage | ✅ | — |
| Configure WhatsApp credentials | ✅ | — |
| Configure AI settings & prompt | ✅ | — |
| Upload knowledge base documents | ✅ | — |
| View audit log | ✅ | — |
| Edit company settings | ✅ | — |
| Invite team members | ✅ | — |
| View billing & subscription | ✅ | — |
Getting Started
Create your account
Connect WhatsApp
Configure AI
Upload your knowledge base
Invite your team
Go live
WhatsApp Setup — Step by Step
Create a Meta App
Get your credentials
Enter credentials in dashboard
Configure the webhook
https://your-domain.com/api/webhooks/whatsappmysecret123)Enter verify token in dashboard
Test the connection
ngrok http 3000AI Configuration
| Field | Description | Default |
|---|---|---|
| AI Enabled | Master switch — turns off AI for all conversations when disabled | On |
| Model | OpenAI model to use for replies | gpt-4o |
| System Prompt | Instructions that define the AI's persona, scope, and tone | Generic assistant |
| Temperature | 0.0 = precise/factual · 1.0 = creative/varied | 0.7 |
| Max Tokens | Maximum length of each AI reply | 500 |
| Escalation Keywords | Words that trigger human handoff (comma-separated, case-insensitive) | refund, manager, human, lawsuit, angry |
Example system prompt:
You are a friendly customer support agent for Acme Electronics. Help customers with orders, returns, and product questions. Be concise and professional. If unsure, say so honestly. Do not discuss competitors or make promises about delivery times.
Knowledge Base
Upload documents that the AI uses to answer customer questions. Documents are automatically chunked into ~500-word pieces. When a customer message arrives, the top 3 matching chunks are injected into the AI's context.
| Format | Extension | Best for |
|---|---|---|
| Plain text | .txt | FAQs, policies, general info |
| Markdown | .md | Formatted docs, product guides |
| CSV | .csv | Product catalogs, pricing tables |
| Brochures, manuals (text extraction only) |
Best practices:
Q: ... A: ... format for best matchingConversations
Every WhatsApp conversation with a customer appears in the Conversations inbox.
Inside a conversation you can:
Customers
Customers are automatically created the first time they send a WhatsApp message. Their phone number is the unique identifier.
| Lifecycle Stage | Meaning |
|---|---|
| LEAD | First contact, not yet a buyer |
| PROSPECT | Interested, evaluation stage |
| CUSTOMER | Has made a purchase |
| VIP | High-value or loyal customer |
| CHURNED | Was a customer, no longer active |
Analytics
Messages per Day (Bar Chart)
Last 7 days. Stacked bars show customer messages vs. AI replies. A high AI ratio means the AI is handling most support.
Conversation Status (Donut Chart)
Live breakdown of all conversations by status. A large ESCALATED slice means your escalation keywords may be too broad, or human agents are needed.
Notifications & Escalations
Notifications appear in Dashboard → Notifications. The most important type is ESCALATION — created automatically when a customer message contains an escalation keyword.
| Type | When created |
|---|---|
| ESCALATION | Customer message matches an escalation keyword |
| SYSTEM | Platform events (invites, system messages) |
| AI_FAILURE | AI processing failed for a message |
| BILLING | Quota warnings |
Handling an escalation:
See the notification
Open the conversation
Reply as an agent
Resolve
Settings & Team Management
Company Profile
acme-corp) is set at registration and cannot be changedBilling & Usage
Inviting Team Members
Go to Settings → Invite Team Member
Enter their email, name (optional), and role
Click "Generate Invite Link"
Share the link
Audit Log
Every significant action in your workspace is automatically recorded in the Audit Log at Dashboard → Audit Log. Entries cannot be edited or deleted.
| Action | Triggered when |
|---|---|
| company_registered | New account created |
| settings_updated | Company profile saved |
| ai_settings_updated | AI configuration changed |
| document_uploaded | Knowledge base file processed |
| user_invited | Invite link generated |
| conversation_escalated | Escalation keyword matched |
| conversation_closed | Conversation marked closed/resolved |
| message_sent | Agent sent a manual reply |
How the AI Works
1 System Prompt
Your instructions to the AI — who it is, what it can answer, and how it should respond. Set in AI Settings.
2 Knowledge Base (RAG)
Top 3 document chunks that match the customer's keywords are injected between the system prompt and conversation history, giving the AI factual grounding.
3 Conversation History
The last 20 messages are included so the AI remembers what was already discussed and doesn't repeat itself.
4 Escalation Check
Before calling OpenAI, the platform checks the message for escalation keywords. If found, it skips AI and routes to a human agent.
Troubleshooting
AI is not replying to messages
Check: WhatsApp connected? · AI Enabled toggle ON? · Conversation AI toggle ON? · Subscription quota not exceeded? · Queue running? (visit /api/queue/process in dev)
Login redirects back to the login page
Stop the dev server, delete the .next folder, restart with npm run dev. A stale Turbopack cache can serve old middleware.
Service worker errors in browser console
Open DevTools → Application → Service Workers → Unregister all. Or open an Incognito window.
Knowledge base not being used by AI
Verify the document status is 'Active' in the Knowledge Base page. Try more direct keywords in test messages.
Webhook verification failing
Make sure the Verify Token in the dashboard exactly matches the one entered in Meta Developer Portal (case-sensitive).
Escalation triggered too often
Review your Escalation Keywords list in AI Settings. Remove overly broad words and add more specific phrases.