Inspiration
AI tutors are getting good at sounding right — and that's exactly the problem. When an animation shows Dijkstra visiting the wrong node, or a narration quotes a value the code never produced, a beginner can't tell. They just learn something false. Every "AI teacher" we tried could hallucinate mid-lesson, and in education that's not a bug, it's a betrayal of the one person least equipped to catch it. We wanted a tutor where correctness doesn't depend on the model having a good day.
What it does
forever is an AI live tutor that teaches computer science the way a human tutor at a whiteboard does: it writes the lesson, draws and animates the concepts step by step, and speaks the narration — all generated, all synchronized.
The core rule: the AI directs everything the student sees, but it is never the source of truth. Before any algorithm animation reaches the screen, the actual code is executed and its trace recorded. Validators check every scen every stated value against that real execution. If the AI'sstoryboard disagrees with what the code actually did, the lesson doesn't ship. The tutor literally cannot show you something false.
Students get full multi-lesson courses (databases, algorithms, economics, ML) with voiced narration, live-animated data structures, and runnable code — not a chat window.
## How we built it
- A contract-first pipeline. Lessons are built around a
LessonContract: a multi-agent roster (teacher, visual director, voice writer, validators) each does one job, and every agent's output is checked before the next one runded values; it never invents them. - Engine = truth, validators = gate. A universal execution recorder runs real code (JS and Python via Pyodide, SQL via sql.js) and captures state at every step — general enough to dry-run thousands of classic CS problems without
- A real rendering stack. The whiteboard is Konva/React with D3, dagre and ELK for graph layout, KaTeX for math, and Monaco for live code — driven by a scene spec the visual director emits, not by hand-authored animations.
- Production plumbing. Next.js app, BullMQ + Redis job queue, MongoDB storage, Docker — because a lesson generator that falls over halfway through a build isn't a tutor, it's a demo.
Challenges we ran into
- Letting the AI be expressive without letting it lie. Early versions had the model narrate values directly — and it would confidently narrate wrong ones. The fix was architectural, not prompt-engineering: the model now referenhe engine substitutes real values.
- Recording operations, not just state. Our first recorder captured snapshots, which couldn't prove why a value changed. Rebuilding provenance tracking was painful but is what makes the verification honest.
- Vendor failure at the last mile. A finished, verified lesson used to die if the speech vendor went down at the final voicing step. We added fallback voicing so a good scene is never lost to a dead API.
Accomplishments that we're proud of
- A full database course generated end-to-end with 16/16 lessons passing every machine validator, clean.
- The Visual Director pass going 18/18 scenes in 63 seconds on r
- Five full audit rounds on teaching quality — verifying not only that lessons are correct but that they actually teach.
- The guarantee itself: to our knowledge, most AI tutors verify nothr an unverified scene.
What we learned
The biggest lesson: you can't prompt your way to trustworthy AI — you have to build machinery around it. Treating the model as a brilliant, unreliable writer and surrounding it with an execution engine and validators produced t less. We also learned an unreasonable amount about graph layoutalgorithms, browser-side Python, TTS failure modes, and what it takes to make a 20-minute generation pipeline survive real-world flakiness.
What's next for forever
- Detectors on top of the universal recorder, so any of ~4,000 classvisualized with zero per-problem work.
- Adaptivity: using the same verified traces to diagnose where a student's mental model diverges, not just whether their answer is right.
- More subjects — the contract architecture doesn't care whether thenner, a SQL engine, or an economics simulation.

Log in or sign up for Devpost to join the conversation.