Public MIT
Messenger Safe Bot × SlimeTree-RLM Pre-processing
Classifies incoming customer messages up-front with the RLM — D = instant (FAQ) / µ = suppressed reply / R = LLM delegation (Claude). With a Page Access Token + PSID you can call the real Messenger Send API; without them the simulator runs fully standalone.
1. Page Access Token + recipient PSID
Configure your Messenger App + Page at developers.facebook.com/docs/messenger-platform/getting-started/.
Required permissions: pages_messaging + pages_messaging_subscriptions. The PSID is obtained from sender.id in your webhook payload.
2. Inbound message simulator
Type as the "customer" → the bot pre-processes via RLM → an automatic reply is generated.
Examples:
料金は? (What are your prices?) → D (instant FAQ) /
あ → µ (suppressed) /
御社のサービスを 3 業界で活かしたい (We want to apply your service across 3 industries) → R (delegated to Claude).
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 Messenger bots
- D verdict for instant replies: Boilerplate FAQs (hours / pricing / contact / product specs) are answered with 0 tokens → large reduction in Claude billing
- µ verdict for suppression: The bot auto-declines empty input / identity probes / sensitive content / suspected prompt injection → prevents moderation violations and reduces abuse blowback
- R verdict for LLM delegation: Only inputs that genuinely need LLM judgment trigger a Claude call → structurally thins out token usage
- WAL audit chain: Every inbound message is recorded in a SHA-256 chain → later you can air-gap reproduce "how did the bot classify that customer's inquiry and what did it reply?"
- No server hop: All processing runs in the browser plus direct fetch to Meta APIs → zero infrastructure cost; scaling means just parallel browsers
6. Source / Related
- Full source on this page = MIT, same license as the Gateway source page
- RLM mock: slimetree-rlm-mock.js (shared)
- Messenger Platform docs: developers.facebook.com/docs/messenger-platform/
- Sister demos: Threads automated posting / Gateway (generic prompt)
