Lab · interactive demo
Watch a WhatsApp concierge decide, one stage at a time
What this is
Send a message to a simulated concierge and watch twelve stages decide, each with the reason: duplicate dropped, consent missing, cost cap reached, human handoff, grounded answer.
Built + tested deploy pendingSimulated no LLM, no networkTry it
No messages yet
Press a suggested reply above to send the first message and start the pipeline.
Scenarios
-
IDLE
Verify signature
webhook/routes.tssimulated, rule ported from
webhook/routes.ts -
IDLE
Webhook dedupe
webhook/routes.tssimulated, rule ported from
webhook/routes.ts -
IDLE
Enqueue and claim job
queue/worker.tssimulated, rule ported from
queue/worker.ts -
IDLE
Per-contact rate limit
pipeline/ratelimit.tssimulated, rule ported from
pipeline/ratelimit.ts -
IDLE
Already answered?
pipeline/index.tssimulated, rule ported from
pipeline/index.ts -
IDLE
Human handoff active?
pipeline/handoff.tssimulated, rule ported from
pipeline/handoff.ts -
IDLE
Consent
pipeline/consent.tssimulated, rule ported from
pipeline/consent.ts -
IDLE
Daily cost cap
pipeline/ratelimit.tssimulated, rule ported from
pipeline/ratelimit.ts -
IDLE
Opt-out keyword
pipeline/consent.tssimulated, rule ported from
pipeline/consent.ts -
IDLE
Wants a human?
pipeline/handoff.tssimulated, rule ported from
pipeline/handoff.ts -
IDLE
Qualify and book
pipeline/qualify.tssimulated, rule ported from
pipeline/qualify.ts -
IDLE
KB-grounded answer
pipeline/reply.tssimulated, rule ported from
pipeline/reply.ts
- Lead state
- new
- Consent
- new
- Human handoff
- none
- Daily LLM spend (simulated)
Lead state machine from pipeline/qualify.ts. The highlighted node (marked NOW) is where this conversation is.
Where the rules come from
A small, deterministic re-implementation of the decision rules in a bilingual WhatsApp concierge I built for Sage Ideas. It keeps the real stage names, the real order of the guards and the same keyword and state-machine semantics, and drops everything that needs infrastructure. Read the full build in the case study.
Receipts
Real vs simulated
Real
This code runs in your browser
- The order of the guards, ported from the worker's reply handler: rate limit, already answered, handoff active, consent, cost cap, opt-out, human request, qualify, answer.
- Webhook dedupe semantics: the first delivery of a message id is processed, any repeat is dropped.
- The opt-out word list and match rule, and the phrase-anchored human-request list (bare words never trigger).
- The qualify state machine and flagship matching rules, and the strict "spent is below the cap" comparison.
Simulated
Illustrative only
- No LLM. The real bot calls a hosted model to classify answers and write grounded replies; here keyword rules and a small excerpt of the knowledge base stand in.
- No WhatsApp, no signature check, no network, no database, no queue. State is a plain object in this tab.
- Cap of $0.05, $0.01 per model call and 5 messages a minute are made-up demo values. The real ones are environment settings.
- English only (the real bot also speaks Portuguese and Spanish), no voice notes, and time advances 15 seconds per message.
Status, exactly as the case study states it: built and tested, deploy pending. The case study counts 56 tests across 15 files in the private repository. This demo has its own tests for the ported rules; it is not those tests.
What this does not prove
It does not prove the real bot behaves this way on live WhatsApp traffic, that its answers are good, or that the cost cap holds under real model billing. It shows the decision rules and their order as read from the code. In the real bot, grounding is enforced by its prompt, not by a code check; the demo's "grounded" label only means a knowledge-base excerpt matched.
Have a system that needs to work?
Tell me the problem. I will tell you honestly whether I am the right engineer for it.
Book a 15-minute call Run a free audit Not sure what you need? Answer 3 questions