Case study
MathMind AI
LiveAn AI math tutor. A student photographs a problem and works through it in a guided session rather than being handed the answer. It also runs a self-healing loop: production errors open an automated fix attempt that has to clear a policy gate before a human sees it.
Mule AI’s own product — live and public
Mule AI’s own product, live and public at mathmind-ai-28ft.vercel.app.
The problem
A student stuck on a photographed math problem usually gets handed either nothing useful or the final answer — neither one teaches the step they’re actually missing. We wanted a tutor that works the problem with the student, and a production system honest enough to know when its own automated fixes shouldn’t be trusted either.
How it works
The pipeline, step by step
- 1
Problem intake
A student photographs or types a problem; the session identifies the subject and opens a guided tutoring session in seconds.
- 2
Guided session, capped
The tutor works through the problem step by step rather than handing over the answer, in a session capped at 15 turns.
- 3
Quota accounting
A subscriber’s monthly quota is decremented before the model is ever called, and refunded automatically on failure, so a crash never silently bills the student.
- 4
Session state & sync
State is kept localStorage-first with a fire-and-forget sync to Supabase, so a session survives a refresh without waiting on the network.
- 5
Self-healing production loop
Production errors are picked up hourly; an agent proposes a fix that has to clear a policy gate — blast radius, size, and a test that actually fails without it — before any human sees it. Auto-merge is off.
What it produced
The numbers, from one run
15
Session turn cap
A session ends rather than running indefinitely
50 problems
Monthly quota
Pre-decremented before the model is called
On failure
Quota refund
A crash never silently bills the student
Hourly
Fix-review cycle
Production errors picked up on an hourly scan
Off
Auto-merge
Every proposed fix waits for a human
Daily
Auth rotation
HMAC-signed session tokens
The real product
Not a mockup



What this means for a business like yours
MathMind is built around two kinds of honesty. The tutoring session refuses to just hand over the answer — it asks questions and works the problem with the student. And the production system refuses to guess: quota is charged only for a call that actually completes, and an automated fix has to clear a policy gate before a human even sees it, rather than merging itself in.
What we did not measure
Auto-merge is off, on purpose — every proposed fix waits for a human. In its one live run so far, the loop correctly declined to fix a stale test rather than force a bad patch through. It has not yet repaired a real production bug, and that restraint is the point: a system that can tell the difference is worth more than one that guesses.
