← 返回
未分类 Key 中文

WhatsApp Business Al Assistant

Automates WhatsApp conversations for local businesses — replies, bookings, lead capture, and follow-ups. Designed for gyms, restaurants, salons, clinics, and...
自动化本地企业的 WhatsApp 对话—回复、预约、线索获取与跟进。适用于健身房、餐厅、美容院、诊所等。
marcvanstad
未分类 clawhub v1.0.0 1 版本 99655.2 Key: 需要
★ 0
Stars
📥 289
下载
💾 0
安装
1
版本
#latest

概述

WhatsApp Business AI Assistant

Name & Purpose

Automates WhatsApp conversations for local businesses — handling replies, booking inquiries, lead capture, and intelligent follow-ups without requiring 24/7 human attention. Designed for gyms, restaurants, salons, clinics, and service-based businesses in South Africa.

Prerequisites

RequirementVersion/Detail
------
OpenClawv2.4+
Node.jsv18+
WhatsApp Business API (Meta)Approved business account
Meta Developer AppWith WhatsApp product configured
Python 3v3.10+ (for NLP pipeline)
wacli CLIInstalled on host
ngrok or static IPFor webhook callback

Installation

1. Copy skill files

cp -r streams/01_ClawHub_Skills/01_WhatsApp_Business_AI_Assistant/* ~/.openclaw/skills/

2. Install dependencies

cd ~/.openclaw/skills/whatsapp-business-ai
npm install
pip install -r requirements.txt

3. Configure environment

Create ~/.openclaw/skills/whatsapp-business-ai/.env:

WHATSAPP_PHONE_NUMBER_ID=your_phone_number_id
WHATSAPP_ACCESS_TOKEN=your_permanent_token
WHATSAPP_VERIFY_TOKEN=your_webhook_verify_token
WHATSAPP_BUSINESS_ACCOUNT_ID=your_business_account_id
BUSINESS_HOURS_TIMEZONE=Africa/Johannesburg
DEFAULT_LANGUAGE=en
NLP_MODEL_PATH=./models/za_intent_classifier
LEAD_DB_PATH=./data/leads.db
BOOKING_CALENDAR_ID=your_google_calendar_id

4. Link to wacli

# Verify wacli is available
which wacli || brew install wacli
wacli --configure

5. Set up webhooks

# Start webhook receiver (uses ngrok for dev)
./scripts/start-webhook.sh

# Register webhook with Meta
curl -X POST "https://graph.facebook.com/v18.0/$WHATSAPP_PHONE_NUMBER_ID/subscriptions" \
  -H "Authorization: Bearer $WHATSAPP_ACCESS_TOKEN" \
  -d "object=whatsapp_business_account&callback_url=https://your-ngrok-url.ngrok.io/webhook&verify_token=$WHATSAPP_VERIFY_TOKEN"

Usage

Start the assistant

# Production mode
openclaw skill run whatsapp-business-ai

# Development / dry-run
openclaw skill run whatsapp-business-ai --dry-run

The assistant runs as a persistent OpenClaw process that:

  1. Listens for incoming WhatsApp messages via webhook
  2. Classifies intent (booking, inquiry, complaint, lead)
  3. Generates context-aware replies
  4. Logs leads to the local database
  5. Schedules follow-ups based on business rules

Workflow Overview

Incoming Message → Intent Classifier → Response Generator → Send Reply
                                       ↓
                                  Booking Detected?
                                  ├── Yes → Check Calendar → Confirm Slot → Add Booking
                                  └── No  → Lead? → Log Lead → Schedule Follow-up

Available Commands

CommandDescription
------
/statusShow assistant health, queue depth, message count today
/leadsExport leads as CSV or JSON
/analyticsLast 24h: sent/replied/followed-up counts
/blacklist Block a number
/broadcastSend bulk message to all leads (ask first)
/pauseStop accepting new messages (resume with /resume)

Workflow Templates

Auto-reply templates are in ./templates/. Customise per business type:

templates/
├── auto_replies/
│   ├── booking_gym.yaml
│   ├── booking_restaurant.yaml
│   ├── booking_salon.yaml
│   ├── greeting_day.yaml
│   ├── greeting_night.yaml
│   ├── hours_inquiry.yaml
│   ├── pricing_inquiry.yaml
│   ├── complaint_acknowledgement.yaml
│   └── out_of_hours.yaml
├── follow_ups/
│   ├── no_reply_24h.yaml
│   ├── abandoned_booking.yaml
│   ├── post_service_feedback.yaml
│   └── promotion_blast.yaml
└── intents.yaml

Example: booking_gym.yaml

name: gym_booking
trigger:
  intents: [booking, tour_inquiry, membership_inquiry]
  confidence_threshold: 0.75
response:
  template: |
    Hi {{customer_name}}! 👋

    Thanks for reaching out to {{business_name}}.

    I can help you book:
    🏋️ A free trial session
    📋 A membership consultation
    🎯 A personal training intro

    What time works for you? Our hours are:
    Mon–Fri: 5:00 AM – 9:00 PM
    Sat: 6:00 AM – 6:00 PM
    Sun: 7:00 AM – 2:00 PM

    Just tell me your preferred day and time!
  buttons:
    - "Book Trial"
    - "See Pricing"
    - "Ask a Human"

Prompt Configuration

Edit ./config/prompts.yaml:

classifier_prompt: |
  Classify the incoming WhatsApp message into exactly one intent.
  Intents: [booking, pricing_inquiry, hours, complaint, lead, general, spam]
  Context: {business_type} in {location}
  Message: {text}
  Respond with only the intent name and confidence score.

response_prompt: |
  You are {assistant_name}, the friendly AI assistant for {business_name}.
  Location: {location}
  Business type: {business_type}
  Business hours: {hours}

  Customer message: {text}
  Detected intent: {intent}

  Reply in a warm, professional tone. Be concise. If it's a booking,
  ask for time and contact info. Never give away pricing you're unsure of.
  Use South African English.

Example Prompts for Human Operators

> "Hey Marvis, can you check on the gym assistant? How many unqualified leads are waiting?"

> "Set up a new WhatsApp assistant for 'Jozi Cuts Barbershop' in Randburg."

> "What's the reply rate on the restaurant assistant this week?"

> "Add a 'Student Discount' promotion template to the gym assistant's broadcast queue."

Directory Structure

whatsapp-business-ai/
├── SKILL.md
├── README.md
├── config/
│   ├── business.yaml          # Business profile (name, hours, location, type)
│   ├── prompts.yaml           # LLM prompts for classification & reply
│   └── webhooks.yaml          # Webhook routing rules
├── templates/
│   ├── auto_replies/          # Pre-written reply templates
│   ├── follow_ups/            # Scheduled follow-up templates
│   └── intents.yaml           # Intent definitions & training data
├── scripts/
│   ├── start-webhook.sh       # Start webhook listener with ngrok
│   ├── register-webhook.sh    # Register with Meta APIs
│   └── export-leads.py        # Export leads to CSV
├── workflows/
│   ├── booking.yaml           # Booking: detect → confirm → create
│   ├── lead.yaml              # Lead: capture → enrich → follow-up
│   └── complaint.yaml         # Complaint: acknowledge → escalate → resolve
├── data/
│   ├── leads.db               # SQLite lead database
│   └── conversation_logs/     # Raw conversation transcripts (rotated)
├── requirements.txt
└── package.json

Integration Options

  • Google Calendar — auto-check and book appointment slots
  • Square / PayFast — send payment links for deposits
  • CRM webhooks — POST leads to HubSpot, Pipedrive, or custom API
  • Slack — notify human agent when escalation needed
  • Twillio — fallback SMS for low-signal areas

Troubleshooting

SymptomLikely CauseFix
---------
Assistant not replyingWebhook not registeredRun register-webhook.sh
Replies go to wrong chatWrong phone_number_id in envCheck .env values
"Message not allowed"Sender hasn't opted inSend template message first
Low confidence on intentTrained on wrong business typeUpdate config/business.yaml
Calendar sync failsMissing Google Calendar scopeRe-auth with https://www.googleapis.com/auth/calendar scope
Leads not savingSQLite path not writablechmod 755 ./data/
ngrok URL changedFree ngrok rotates on restartUse paid plan or static IP

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-21 15:16 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 676 📥 325,397
ai-agent

self-improving agent

pskoett
捕获经验教训、错误及修正内容,以实现持续改进。适用于以下场景:(1)命令或操作意外失败;(2)用户纠正Claude(如“不,那不对……”“实际上……”);(3)用户请求的功能不存在;(4)外部API或工具出现故障;(5)Claude发现自身
★ 4,081 📥 809,805
ai-agent

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,378 📥 320,392