#AI Auto-Replies for WhatsApp: Complete Setup Guide
The 24/7 Response Problem
Your customer messages at 2 AM: "What's your refund policy?"
Your competitor's AI responds instantly with the exact answer. You respond at 9 AM. The customer already bought from your competitor.
82% of customers expect replies within 10 minutes. Miss that window, and they're gone. But hiring 24/7 support costs $15-30/hour per agent. That's $10,800-21,600 per month for round-the-clock coverage.
Basic auto-responders ("Thanks, we'll respond soon") don't help—they just delay the inevitable. Your customer still waits. They're still frustrated.
AI auto-replies solve this completely. Intelligent responses that understand context, pull from your business knowledge base with RAG, and actually resolve customer questions—not just acknowledge them. MoltFlow's field-level encryption keeps customer data secure while our anti-spam throttling prevents account bans.
This guide walks you through setting up AI auto-replies with MoltFlow, from basic configuration to advanced prompt engineering that makes your AI sound like your best customer service rep.
How AI Auto-Replies Work
Before diving into setup, here's what happens when a customer messages you with AI auto-replies enabled:
- Message arrives via WhatsApp → MoltFlow receives it through your connected session
- Context retrieval → System loads recent conversation history and relevant business documents (if you've enabled RAG)
- AI processing → Your custom prompt combines with context to generate a relevant response
- Safety checks → Output filtering ensures the reply is appropriate and doesn't leak sensitive data
- Response sent → Reply is delivered to the customer, typically within 2-3 seconds
The entire pipeline runs automatically. You can review all AI-generated responses in your dashboard and adjust your prompts based on real performance data.
Key difference from basic auto-responders:
- Basic: "Thanks for your message. We'll respond soon." (useless)
- AI-powered: "Hi! I can help with pricing. Our Pro plan is $29.90/month and includes AI auto-replies, RAG knowledge base, and up to 5 WhatsApp sessions. Would you like details on what each feature does?"
One solves the problem. The other just acknowledges it exists.
Step 1: Enable AI Auto-Replies
AI auto-replies require the Pro plan ($29.90/month) or higher. If you're on Free or Starter, you'll need to upgrade first at molt.waiflow.app/billing.
Once you're on Pro, configure auto-replies via the API. Here's the complete setup request:
curl -X POST https://apiv2.waiflow.app/api/v2/ai/generate-reply \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"contact_id": "[email protected]",
"context": "Hi, what are your business hours?",
"use_rag": true,
"apply_style": true
}'Parameters explained:
contact_id: The WhatsApp contact JID (phone number format:{country_code}{number}@c.us)context: The customer's message or conversation threaduse_rag: Set totrueto search your knowledge base for relevant informationapply_style: Set totrueto use your trained style profile (Learn Mode)
Expected response:
{
"reply": "We're open Monday-Friday 9AM-6PM EST. For urgent matters outside business hours, you can reach our on-call team at +1-650-555-0123.",
"rag_sources": ["business-info.pdf"],
"style_applied": true,
"model": "gpt-4o-mini",
"tokens_used": 156
}The response includes source attribution (which documents were referenced) and token usage for tracking costs. Most auto-replies cost less than $0.01 per response with GPT-4o-mini.
Step 2: Write Your AI Prompt
This is where most people fail. Bad prompts produce bad responses. Period.
Here's a bad prompt:
"You are a helpful assistant. Answer customer questions."
Here's why it's bad: It gives the AI no context about your business, no tone guidance, no boundaries on what topics to handle, and no escalation rules for complex issues.
Here's a good prompt for a fitness studio:
You are the AI assistant for Peak Performance Gym in Austin, Texas.
BUSINESS CONTEXT:
- We offer 24/7 gym access, personal training, and group classes (yoga, spin, HIIT)
- Membership: $49/month standard, $89/month with unlimited classes
- Location: 123 Fitness Drive, Austin, TX 78701
- Hours: 5 AM - 11 PM daily, 24/7 key card access for members
TONE:
- Friendly and motivational
- Use "we" not "I"
- Keep responses under 3 sentences when possible
- Never use gym jargon without explaining it
YOU CAN ANSWER:
- Pricing and membership options
- Class schedules (refer to our website for live schedule)
- General facility questions
- Guest pass information ($20 for a day pass)
YOU MUST ESCALATE TO HUMAN:
- Injury or medical concerns
- Billing disputes
- Complaints about staff
- Requests for personal training packages (need custom quote)
When you need to escalate, say: "Let me connect you with our team for personalized help. They'll respond within 2 hours during business hours."
BOUNDARIES:
- Don't make up class times or trainer availability
- Don't promise discounts or deals not listed above
- Don't give medical or fitness advice
- If you're unsure, escalateThis prompt works because it:
- Defines who you are and what you do
- Sets clear tone expectations
- Lists what the AI can and can't handle
- Provides specific escalation language
- Prevents hallucination with explicit boundaries
You'll store this prompt in your MoltFlow dashboard settings (coming in a future API update) or pass it as a system message in your integration.
Step 3: Test and Refine
Don't deploy to production without testing. Here's my recommended testing workflow:
Test message 1: Simple FAQ
curl -X POST https://apiv2.waiflow.app/api/v2/ai/generate-reply \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"contact_id": "[email protected]",
"context": "What are your prices?",
"use_rag": true,
"apply_style": false
}'Expected: Clear pricing info from your prompt.
Test message 2: Edge case
curl -X POST https://apiv2.waiflow.app/api/v2/ai/generate-reply \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"contact_id": "[email protected]",
"context": "I hurt my back doing deadlifts, should I come in?",
"use_rag": true,
"apply_style": false
}'Expected: Escalation to human with empathetic language (no medical advice).
Test message 3: Off-topic
curl -X POST https://apiv2.waiflow.app/api/v2/ai/generate-reply \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"contact_id": "[email protected]",
"context": "Can you recommend a good pizza place?",
"use_rag": true,
"apply_style": false
}'Expected: Polite deflection back to gym topics.
Common issues and fixes:
| Issue | Cause | Fix |
|---|---|---|
| Too verbose | No length guidance | Add "Keep responses under 3 sentences" to prompt |
| Makes up info | Unclear boundaries | Add "Don't make up X, Y, Z" section |
| Doesn't escalate | No escalation rules | List specific scenarios that need human |
| Wrong tone | Generic tone guidance | Give 2-3 example responses in your prompt |
I usually need 3-5 iterations to dial in a prompt. That's normal.
Step 4: Handle Edge Cases
Real customers are unpredictable. Here's how to handle the weird stuff:
Profanity and abuse: MoltFlow's content filter blocks offensive outputs by default (Pro plan feature). If a customer swears, the AI won't mirror that language. You can configure stricter filtering in your A2A content policy settings if needed.
Sensitive topics (medical, legal, financial): Add explicit escalation rules to your prompt:
NEVER provide:
- Medical advice ("see a doctor" is OK, diagnosing isn't)
- Legal advice
- Financial advice beyond our published pricing
- Investment recommendations
For these topics, always escalate.Auto-escalation config: Set up a webhook to notify your team when the AI escalates:
curl -X POST https://apiv2.waiflow.app/api/v2/webhooks \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"url": "https://yourapp.com/webhooks/escalations",
"events": ["ai.escalation"],
"enabled": true
}'Your webhook will receive the full conversation context so your team can jump in with full background.
Advanced: Context-Aware Replies with RAG
The real power of MoltFlow's AI auto-replies comes from RAG (Retrieval-Augmented Generation)—your AI can pull information from uploaded documents to answer questions it wasn't explicitly trained on.
New to RAG? Our Build a Knowledge Base AI guide walks you through document upload, chunking strategies, and testing retrieval quality.
Upload business documents:
curl -X POST https://apiv2.waiflow.app/api/v2/ai/knowledge/ingest \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-F "[email protected]"MoltFlow chunks your document, creates vector embeddings, and indexes it for semantic search. When a customer asks a question, the AI searches your knowledge base first, then generates a response grounded in your actual documentation.
Want to understand how RAG works under the hood? Check out our RAG Knowledge Base Deep Dive for technical details on chunking, embeddings, and vector search.
Example conversation:
Customer: "Do you have student discounts?"
Without RAG: "I don't have information about student discounts. Let me connect you with our team."
With RAG (after uploading your pricing policy): "Yes! Students get 15% off with a valid .edu email address. The discounted rate is $41.65/month instead of $49. Want to sign up?"
The AI cites the source document in the response metadata, so you can verify it's not hallucinating.
RAG best practices:
- Upload PDFs, not Word docs (better parsing)
- Keep documents focused (one topic per file)
- Update documents when policies change
- Review RAG sources in responses to catch outdated info
Pro plan includes 10 documents, Business plan includes 50.
Production Deployment Tips
Before going live with AI auto-replies:
1. Set business hours: You probably don't want AI responding during your normal work hours when humans are available. Configure auto-reply timing:
- Only outside 9 AM - 6 PM
- Only when no human has responded in 5 minutes
- Never for VIP contacts (set a label filter)
2. Monitor quality: Check the AI dashboard daily for the first week. Look for:
- Escalation rate (should be 10-20% for most businesses)
- Customer satisfaction scores (if you send follow-up surveys)
- Repeat questions the AI struggles with
3. A/B test prompts: Run two prompts simultaneously (different sessions or time periods) and compare metrics:
- Response time
- Escalation rate
- Customer satisfaction
- Conversion rate (if selling)
4. Cost management: At scale, AI responses cost money. Track usage in your MoltFlow dashboard:
- Pro plan: 1,000 AI messages/month included
- Overage: $0.01 per message with GPT-4o-mini
If you're hitting limits, consider:
- Using GPT-3.5-turbo for simple FAQs (60% cheaper)
- Caching common responses
- Stricter triggering rules (only when X happens)
Real-World Use Cases
E-commerce store: "When do you ship?" → AI checks order status via API, responds with tracking info.
Real estate agent: "Is the 3BR house still available?" → AI searches MLS integration, provides listing status and link to photos.
Healthcare clinic: "I need to reschedule my appointment" → AI offers available times from calendar API, books appointment on confirmation.
Each requires custom integration work, but the MoltFlow API supports it all.
What's Next?
You've got AI auto-replies working. Here's what to explore next:
Improve AI quality:
- Train AI to Write Like You — Make responses sound like your actual voice with Learn Mode
- Build a Knowledge Base AI — Upload PDFs and let AI answer from your documentation
- AI Model Comparison for WhatsApp Bots — Choose the right model for your use case
Scale your automation:
- Send Bulk Messages — Campaign automation with anti-spam protection
- Schedule Recurring Messages — Appointment reminders and follow-ups
- Connect MoltFlow to n8n — Visual workflow builder for complex automation
Ready to deploy 24/7 intelligent support? Upgrade to Pro — 14-day free trial, no credit card required. Get AI auto-replies, RAG knowledge base, and unlimited messages for $29.90/month.
Wrapping Up
AI auto-replies aren't magic—they're as good as your prompts, your data, and your testing process. Spend time upfront getting the prompt right, upload good documentation to your RAG knowledge base, and monitor performance weekly.
Done right, AI can handle 70-80% of routine customer questions, freeing your team to focus on complex issues that actually need human judgment. That's the win.
Questions or stuck on something? Join our Discord community or check the API docs.
> Try MoltFlow Free — 100 messages/month