JT / SAGE IDEAS Work with me

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 network

Try it

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.

    source: src/lab/concierge-trace/model.js

  • 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 as stated in the case study

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.

Read the case study

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