Inspiration
This project was inspired by my own experiences with mathematics and my own journey in learning and applying it (particularly in the context of Olympiad-style problems). Mathematics is one of those subjects that is really strange in that it is not about memorizing a bunch of facts and rules - in math, one develops an intuition about why certain things are the way they are.
When my intuition failed me when trying to understand something, I often would turn to Manim - a really great math visualization engine capable of producing beautiful computer animations. Yet, even then, it still took me hours of coding to produce simple animations for my own use. Now, isn't it reasonable that someone wishing to just understand a certain point would want something that could produce helpful diagrams for them without the need to code?
That's where this idea came from - the idea of a project that would let one quickly and easily produce high-quality math animations for educational purposes via some intuitive interface.
What this is
Simply put, this is a math visualization engine that can leverage the power of AI to automatically generate Manim code from a prompt. In short, what the project allows is for a user to simply input some request into the system, and have the engine do its best to use an AI to generate Manim code that would create an appropriate math visualization for the given prompt. This could be anything from a simple image to an elaborate animation - a few seconds after submitting the request, the user would be able to see the results of the computation, and can tweak the prompt as needed. In the far future, this project could grow to become an all-encompassing visual reasoning engine for mathematics that would enable unparalleled levels of math learning.
How we built it
(https://d112y698adiu2z.cloudfront.net/photos/production/software_photos/004/963/274/datas/small.png)
We built this with the following simple pipeline:
The user enters the math concept that they want to see in the prompt
We validate that the prompt is suitable before feeding it to the LLM
We then use ChatGPT 5.6 and Claude Fable 5 to generate Manim code based on the prompt
The code is then run and debugged using Replit
We render the final result and show it to the user, along with the Manim code that was generated so that they could edit and tweak it as they saw fit
Using HTML, CSS, and JavaScript for the frontend, and FastAPI, Flask, and Node for the backend, along with Manim, Matplotlib, and SymPy for the math and rendering stack, we were able to build upon this simple idea and come up with this prototype. We could show an example result of the code here in:
Example "Rendering: derivative of $$sinx$$"
from manim import *
import numpy as np
class SinTangent(Scene):
def construct(self):
axes = Axes(x_range=[-4, 4, 1], y_range=[-2, 2, 1])
curve = axes.plot(lambda x: np.sin(x), color=BLUE)
self.play(Create(axes), Create(curve))
x_tracker = ValueTracker(-4)
def get_tangent_line():
x = x_tracker.get_value()
slope = np.cos(x)
point = axes.c2p(x, np.sin(x))
return Line(
point + np.array([-1, -slope, 0]),
point + np.array([1, slope, 0]),
color=YELLOW,
)
tangent = always_redraw(get_tangent_line)
self.play(Create(tangent))
self.play(x_tracker.animate.set_value(4), run_time=6, rate_func=linear)
It is important to note that we intend for this project to grow in the future to support multiple engines (and eventually multiple fields of math) and become a complete interactive math engine for teaching.
What we struggled with
The biggest struggles that we had during development mostly had to do with the unreliability of prompts. Since the prompts that we had to feed the LLM were not always reliable, we had to go through the painful process of prompt engineering to get the most out of a given prompt.
For example, we encountered some issues where gathering all the necessary dependencies, particularly for SymPy, ended up taking far longer than expected - it took much longer than we anticipated just to get the very first Python script in our pipeline running. At one point, we got stuck on a single syntax error in Python for days before we were able to track it down and fix it.
Another challenge that we had was balancing the need for interesting visuals with scientific accuracy - animations that looked nice often times sacrificed some level of fidelity to the math that was being visualized, and we struggled with ways to mitigate this issue while still achieving nice results.
What we are most proud of
I am most proud of the fact that we were able to realize this long-held dream of mine in only a day and a half of development, working about six hours a day.
Specifically, I am really happy that we were able to show that the system can turn a simple prompt like "sin(x)" into a 30-second animation of the smooth, repeating waves of the sinusoidal curve, complete with a moving tangent line tracing along it - we don't even need to know Manim to make cool math animations, we can just write out a description in natural language and let the power of AI do the hard work for us! We're also pretty happy about laying the groundwork for this long-term project that we hope will greatly contribute to the way people learn and teach mathematics.
What we learned
We learned quite a lot from this project. We leaned a lot of lessons about working with AI, and how while it's very nice to be able to ask an AI to do certain things for you, actually making it do what you want to get it to do is non-trivial and often involves a lot of extra work to make it happen. We learned about the challenges posed by reasoning and code generation, particularly around how much of the work was less about writing new code from scratch and more about prompting, refining, and debugging what the AI produced - and ways to mitigate them. Finally, we learned a lot about how we can use these new tools to fundamentally change the paradigms of how we teach and learn math.
It has long been established that visualization is an important tool when it comes to learning and teaching math, and while math has traditionally been one of those subjects that is exceptionally hard to intuitively grasp, there's potential now for that to change, thanks to this and similar projects.
Built With
- claude
- codex
- html
- javascript
- manim
- python
- replit


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