The "Aha!" Engine
Understanding the storytelling logic behind MovingLines
The "Aha!" Engine
The "Aha!" Engine is what makes MovingLines different from generic AI code generators. It is a set of prompts, constraints, and agentic behaviors designed to mimic the educational style of 3Blue1Brown.
Narrative Design Principles
Every animation generated by MovingLines is guided by these core principles:
Progressive Revelation
We believe that clarity comes from building complex ideas from simple foundations. The engine is instructed to:
- Introduce one concept at a time.
- Show the visual representation before the formula.
- Build equations term-by-term.
Breathing Room (Pacing)
Mathematical insights require time to sink in. The "Aha!" Engine automatically:
- Inserts
self.wait(2)after major realizations. - Never chains more than three animations without a pause.
- Coordinates the "Aha!" moment to be the climax of the video.
Visual Continuity
To prevent the viewer from getting lost, we prioritize "Transformations" over "Creation/Deletion":
- Use
ReplacementTransformto morph one shape into another. - Move existing labels to corners rather than deleting them.
- Shift the camera to "make room" for new elements.
The Phased Generation Workflow
The "Aha!" Engine operates in two distinct phases:
Phase 1: The Narrative Planner
Before a single line of code is written, a Planner Agent brainstorms the narrative arc. It identifies:
- The Hook: A surprising or relatable opening.
- The Goal: The specific mathematical truth to be revealed.
- The Aha! Moment: The point where the visual evidence makes the concept intuitive.
Phase 2: Code Generation
The Generator Agent receives the storyboard as a strict guide. It is restricted from departing from the narrative arc, ensuring that the final animation matches the educational goals designed in Phase 1.
Why "Aha!"?
The goal of MovingLines isn't just to show math — it's to make the user feel the math. By focusing on the moment of realization, we create more engaging and memorable educational content.