LoopWorks — Meridian Next-Best-Offer
A teaching-grade telecom next-best-offer agent — it picks the right offer for each subscriber under hard eligibility rules, pauses for a human on sensitive retention offers, invents and prices new offers behind a finance gate, and shows the cost and accuracy of every model call. Runs with no key on recorded data, or live on your own key.
Problem
Prepaid operators must choose a "next best offer" for every subscriber, every day — upsell, cross-sell, retention, or deliberately leave alone — under rules that actually bind — consent, contact caps, device eligibility, and margin. Hand-tuning that decisioning per segment doesn't scale; letting a model decide freely quietly breaks the rules that matter — marketing a subscriber who never consented, re-contacting one you just called, or giving away margin on a retention offer nobody approved.
Constraint
The steps that touch money or compliance have to be exact and auditable, while the judgment underneath — which eligible offer fits this subscriber, and in what words — is genuinely fuzzy. And it had to demo to a non-technical room on any laptop or network, including ones where live model calls are impossible or unwelcome, without ever faking the economics the tool exists to teach.
Architecture decision
One decision loop, no framework, no vector database. The guardrails, evals, price-elasticity model, compliance linter and routing policy are deterministic code — the tool layer physically blocks an ineligible assignment even when the model asks for it. The model is scoped to three jobs — the offer decision, the customer message (filled into approved templates and shipped only if a code linter passes it), and drafting new-offer proposals, where it never sets a price. Every model call runs through one function behind a switchable gateway with three modes — live on a cheap→strong router, a free-model bake-off, or a keyless "scripted" replay of recorded runs for the no-key demo. Rejected — an agent framework, a vector store, fine-tuning, and (the standing rule) faking token costs, so even the replay uses real recorded token counts and the rupee figures stay honest.
Notes
Three ideas made physically visible on one screen.
The harness the engineer builds once — playbook rules, guardrails as code, the model-routing policy, the eval definitions, the approved message templates, and a semantic memory of lessons from past runs.
The loop that runs inside it and improves on its own — it acts, an eval (not the model) decides whether it was right, sensitive retention offers pause for a real human click, a step budget and stagnation guards keep every run terminating, and it writes a durable lesson back into memory so the next wave does better — accuracy climbs from ~83% to 100% as that lesson lands.
The economics, governed — a cheap model for routine subscribers and a stronger one only where the stakes are high, every call traced with its real tokens and rupees; an offer factory that turns a detected catalogue gap into an elasticity-priced proposal held at a finance gate; and a routing-policy change that’s evaluated offline and promoted only through a human gate.
The keyless twin’s honest pitch: the harness is real; the brain is a recording. Every guardrail, eval, linter, gate and the persistence run for real — only the text a model would have returned is replayed, with its real recorded token counts, so nothing about the economics is faked. Enter your own key and the same waves run live on your account instead.
Live demo
Open demo ↗https://loopworks-demo.onrender.comSource
github.com/aviralmathur/loopworksfde ↗Still unfinished
- On the hosted free tier the database is ephemeral — waves, written lessons and promoted policy versions reset on every redeploy or cold start (a clean slate for each audience).
- The keyless demo replays a recorded arc; run many waves past the script and it repeats the steady-state wave rather than producing novel transcripts.
- The free-model side of the bake-off rides shared community capacity — visibly slower and occasionally rate-limited.