The Learning Router ← sugeerth.github.io

Prompt Studio · router.js

A prompt engine that learns which settings you actually want

Most personalization remembers your last choice. That is an estimator with a sample size of one, and it follows the noise in your choices by construction. This replaces it — and the benchmark below is not a screenshot. It is the real module, running the real comparison, in your browser, right now.

Opened on the setting the user actually wanted

—

Running 8 seeds × 600 asks against three policies…

learning router —
last-write-wins —
never adapts —
ceiling —

per-seed gap: measuring…

The ceiling is what a policy that always offered the single most common setting would score — nobody can beat it, because the simulated user is deliberately inconsistent. That inconsistency is the experiment: it is exactly what last-write-wins cannot handle, because it reopens on whatever you did last and so chases the noise instead of the pattern. Change the world and re-run it →


Train it yourself

The same module, primed with a handful of example asks. Type one and it tells you which of the seven compositions it would open the axes on — or says it does not know yet, which below eight observations is the honest answer. Tell it what you actually wanted and watch the table move.

Press What would it open on?
compositionhow often it was what you wanted seenrate

This page stores nothing. The demo runs the module with its storage seam set to null, so visiting writes nothing to your browser. What the real app stores →


What it replaced

Prompt Studio composes every prompt from two axes — Steer (how much the prompt is allowed to shape the reply) and Depth — and it used to reopen on the pair you endorsed last in that domain. Copy one Deep + Shaped tax prompt and every future tax ask opened Deep + Shaped, however many Standard + Guided ones followed, because each endorsement overwrote the one before it.

The router estimates which composition you settle on most often for asks that read like this one. It is roughly fifty lines of actual arithmetic; everything else in the file is the restraint.

The bug worth reading about

The first version modelled this as a bandit and finished six points below the baseline it exists to beat. The framing was wrong, not the constants — and the benchmark is what said so. The whole story →

Where it is

It ships in Prompt Studio (source), a client-side prompt builder that makes no network calls once it has loaded. The routing ideas come from self-improving graph agents, where the same machinery routes between agents instead of between settings.

7 compositions 2–8 KB of state no network calls no dependencies ~420 lines