Public MIT
WhatsApp Business Safe Bot × SlimeTree-RLM Pre-processing
On the WhatsApp Cloud API the RLM classifies customer messages up-front — D = instant (FAQ) / µ = suppressed reply / R = LLM delegation (Claude). With Phone Number ID + Access Token you can really Send; without them the simulator runs standalone. The 24h window + template constraints are spelled out.
1. WhatsApp Cloud API credentials
Set up a WABA (WhatsApp Business Account) + Phone Number at developers.facebook.com/docs/whatsapp/cloud-api/get-started → "Get started" gives you the Access Token + Phone Number ID + Business Account ID.
Required permissions: whatsapp_business_messaging + whatsapp_business_management.
- 24-hour window: Free-form text replies are allowed only within 24 hours of the customer's last message. Beyond that, only pre-approved template messages may be sent
- Opt-in required: The customer must have actively messaged your number first (you cannot send unsolicited messages)
- E.164 format:
+819012345678(country code + number, no hyphens or spaces) - Phone Number ID is not the phone number: The Phone Number ID is the WhatsApp Graph API object ID, not the actual phone number itself
2. Inbound message simulator
Type as the "customer" → the bot pre-processes via RLM → an automatic reply is generated.
Examples:
営業時間は? (What are your business hours?) → D /
あ → µ /
3 業界での導入事例を比較してほしい (Please compare case studies across 3 industries) → R.
3. LLM API key (called only on R verdict)
R-verdict replies are delegated to an LLM (browser-direct). Keys stay in localStorage only and never traverse JAVATEL servers.
3.5 Operating mode NEW: Pattern B (cross-vendor) — via the shared module
4. API call log
(nothing has run yet)
Pricing example: 10,000 inbound messages/month
Monthly cost of the same workload across 6 LLM tiers. The RLM filters 73%, so the reduction ratio is the same on every provider. See the service page for details.
| Tier | Class | No filter | With RLM | Savings/month | Annual |
|---|---|---|---|---|---|
| Gemini 2.5 Flash | Everyone | $7.50 | $2.03 | $5.47 | $66 |
| Gemini 2.5 Pro | Everyone | $103 | $28 | $75 | $900 |
| GPT-5 mini | Business | $26 | $7 | $19 | $228 |
| GPT-5 | Business | $310 | $84 | $226 | $2,712 |
| Claude Haiku 4.5 | Business | $42 | $11 | $31 | $372 |
| Claude Opus 4.7 | Business | $1,530 | $413 | $1,117 | $13,404 |
* 200 in / 1,000 out tokens. "No filter" = all 10,000 messages go to the LLM; "With RLM" = only the 2,700 R-verdict messages do. Prices reflect public unit rates as of 2026-05; industry mix is adjustable.
5. Why the RLM works for WhatsApp Business
- D verdict for instant reply inside the 24h window: Boilerplate FAQs are answered with 0 tokens, no waiting for template approval → 100% in-window response rate
- µ verdict suppresses spam / speculative-investment chats / identity probes: Even at the high inbound volumes seen in LATAM / India / SEA, abuse blowback and policy violations are prevented
- R verdict delegates to the LLM + audit chain: For regulated industries (medical / finance / insurance) the fact that the request "was delegated to an LLM" is itself recorded in a SHA-256 chain → meets audit requirements
- Detection after the 24h window has lapsed: The RLM immediately spots "expired conversations" and recommends switching to a template (feasible to wire up; not connected in this demo)
- Browser-only: The WhatsApp Cloud API is hosted in NA/EU regions; bypassing JAVATEL servers minimizes latency
6. Source / Related
- Full source on this page = MIT, same license as the Gateway source page
- RLM mock: slimetree-rlm-mock.js (shared)
- WhatsApp Cloud API docs: developers.facebook.com/docs/whatsapp/cloud-api/
- Sister demos: Gateway / Threads / Messenger
