Inspiration

A learner cannot tell a correct explanation from a merely fluent one — that inability is what it means to be a beginner. So when an AI tutor confidently walks through an algorithm and describes something the code doesn't actually do, it isn't a small error: it teaches something false to the one person with no way to check.

Every AI tutor today asks students to trust output that nothing verified. I wanted one whose visuals were physically incapable of disagreeing with reality.

What it does

Give Forever any source material — a textbook chapter, lecture notes, a problem statement — and it builds a complete multi-scene course:

  • a board that gets drawn as the tutor talks
  • a tutor voice that explains it step by step
  • real code that actually runs, in a sandbox
  • questions that check whether you understood

What makes it different is what it refuses to do. Every visual walkthrough is compiled from a recording of a real execution, never from a model's guess about what the code probably does. Every factual claim on the board must cite the source it came from. Teaching that fails those checks is dropped rather than shipped weak.

How AI is core, not decoration

Not one prompt — a society of eight specialised agents that argue with each other, wrapped in deterministic validators none of them can talk past:

Teacher            plans the lesson arc from your source
Board Director     designs what appears on screen
Grounding Auditor  objects to claims the source doesn't support
Pedagogy Critic    objects to teaching that won't land
Arbiter            rules on the objections, bindingly
Code Runner        writes and EXECUTES real code in a sandbox
Execution Tracer   records what actually happened, step by step
Voice Writer       narrates the board and declares its teaching moves

The models write the teaching. A real recorded execution decides what is true.

How I built it

Next.js and Node on Alibaba Cloud ECS, with Qwen models via Alibaba Model Studio behind a single client. Course builds run as background jobs on BullMQ + Redis, so the browser never waits — the player opens immediately and each finished scene extends what's watchable. MongoDB for storage.

The visual engine instruments a real Python execution and compiles the recording into animation. It enforces hard invariants and throws rather than narrate from evidence it can't back: the order shown must equal the recorded order, a node is marked visited only at its recorded discovery, an edge may only light up if it exists in the recording, and dependency arrows come only from reads that actually happened. Unsupported shapes degrade to an honest generic trace; contradictory evidence is refused outright.

Challenges I ran into

The hardest problems weren't AI problems. Several configuration and error-handling faults stacked up, and each looked like total product failure on its own: the app was reading an empty database while the real one sat untouched; the job worker wasn't running, so submitted courses waited forever; the retry logic didn't recognise the two most common network errors, so nothing ever retried; and worst of all, a dead text-to-speech vendor was deleting finished lessons — because voicing ran inside scene generation, a scene that couldn't be spoken was thrown away even after passing every teaching check.

Finding that last one meant learning to test the real production path instead of the convenient one.

Accomplishments that I'm proud of

  • 103 algorithms visualised with zero per-problem code — nothing hand-tuned for any individual algorithm — at 0 errors
  • 957 automated tests
  • Deterministic gates that catch bad teaching instead of trusting the model to be good: one rejects a "definition" that never actually defines anything; another catches a scene that describes the picture instead of the material

What I learned

That honest failure is a feature. It's tempting to build a demo that always produces something; it's far more useful to build one that refuses when it can't verify.

And that a system is only as good as the path you actually test. For hours I measured a convenient code path while the real one failed for reasons my tests structurally could not see.

What's next for Forever

  • Path-reconstruction visuals for dynamic programming
  • A JavaScript execution recorder, so JS gets the same verified treatment Python does
  • Wiring the mastery model into adaptive practice, so the tutor picks your next question from what you actually haven't learned

A note on scope

Forever is an ongoing open-source project and its commit history is public. During this event I worked on the correctness engine and the reliability of the generation pipeline — the execution-verification invariants, the teaching-contract validators, and the fixes described above.

Built With

Share this project:

Updates