Public MIT

Messenger Safe Bot × SlimeTree-RLM Pre-processing

Handle midnight inquiries with instant FAQ replies

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.

Not authenticated (save token + PSID, then click "Check page")
Note: The Page Access Token is tied to page-operator privileges; manage it separately from the Threads user token. The recipient PSID requires that the target user has messaged your page within the last 24 hours on real Messenger (per Messenger policy).

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).

Total received: 0
D: 0
µ: 0
R: 0
Send API: 0
cheap (B): 0
escalated (B): 0
esc rate:
Send a message below as the "customer" and the bot will respond via the RLM.

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.

GEMINI
CLAUDE · token billing
OPENAI · token billing
LLM-neutral: free choice of Gemini / Claude / OpenAI / Grok — Gemini = free tier available; Claude / OpenAI = each provider's token billing. Fees go directly to your LLM provider; JAVATEL does not mediate.

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