Lerno.AI — The AI That Writes and Renders Its Own Educational Videos Inspiration Traditional online learning platforms are mostly static. Students watch the same pre-recorded videos regardless of their learning style, age, or understanding level. While AI chatbots can explain concepts in text, they still fail to provide dynamic visual learning experiences that adapt in real time.

We wanted to solve a much harder problem: What if AI could not only explain concepts, but actually generate educational animations from scratch for any topic instantly? That idea became Lerno.AI — an intelligent educational platform that transforms a single user prompt into: Animated educational videos AI-generated narration Interactive quizzes A real-time AI tutor The most exciting part is that the system dynamically generates executable Python animation code using Google Gemini 2.0 Flash. What Lerno.AI Does A user can type prompts like: "Teach me about Arrays" "Explain Vectors" "How do Binary Trees work?" Lerno.AI automatically: Understands the topic Breaks it into learning scenes Generates animation logic Writes Python Manim code dynamically Compiles animations into MP4 videos Generates narration and quizzes Streams the final learning experience back to the user

How We Built It Tech Stack Frontend React Vite Tailwind CSS Framer Motion Backend Python FastAPI Node.js / Express middleware AI & LLMs Google Gemini 2.0 Flash LangChain Groq Llama 3 (fallback tasks) Rendering & Media Manim (mathematical animation engine) Murf.ai (text-to-speech) Vapi + Twilio (voice AI tutor) Cloud Infrastructure Firebase Firestore Firebase Storage

Core Technical Innovation The biggest innovation in Lerno.AI is that the AI does not simply generate text explanations. Instead, Google Gemini dynamically writes executable Python animation code using the Manim library. The workflow looks like this: User Prompt ↓ Context Gathering ↓ Google Gemini 2.0 Flash ↓ Structured JSON Output ↓ Python Manim Code Generation ↓ FastAPI Execution Pipeline ↓ Manim Rendering Engine ↓ MP4 Educational Video ↓ Firebase Cloud Storage

Gemini-Powered Dynamic Code Generation Gemini acts as the central orchestration engine. For every educational scene, Gemini generates: Narration scripts Quiz questions Python animation code Example: circle = Circle(color=BLUE) self.play(Create(circle)) The backend then: Saves the generated code into animation.py Executes the Manim renderer through subprocesses Compiles the animation into an MP4 video This means the AI is literally programming educational animations in real time.

Why This Is Different Most AI education tools: summarize text generate notes create flashcards Lerno.AI goes several steps further. It combines: AI reasoning Dynamic code generation Mathematical rendering Video compilation Voice synthesis into one autonomous educational pipeline. In simple terms: The AI creates its own educational videos from scratch.

Challenges We Faced Building Lerno.AI involved several difficult engineering challenges.

  1. Reliable AI Code Generation Generating executable Python code dynamically is extremely difficult because: small syntax errors break rendering animation timing must stay synchronized coordinates and transitions must remain valid We solved this using: structured prompting JSON output enforcement fallback pipelines validation layers
  2. Rendering Performance Manim rendering is computationally expensive. Rendering animations frame-by-frame while maintaining responsiveness required: asynchronous FastAPI execution subprocess orchestration cloud-based asset handling
  3. Multi-Model AI Architecture We needed both speed and reliability. So we designed a hybrid architecture: Groq Llama 3 handles lightweight tasks Gemini 2.0 Flash performs advanced reasoning and code generation This significantly improved stability during generation.
  4. Real-Time Media Pipeline Combining: video generation voice synthesis cloud uploads frontend streaming into one seamless pipeline was one of the hardest parts of the project.

What We Learned Through this project we learned: AI orchestration using LangChain Advanced prompt engineering Dynamic Python code execution Video rendering pipelines FastAPI backend scaling Cloud storage workflows Multi-model fallback architecture Real-time AI media generation Most importantly, we learned how powerful modern LLMs become when they move beyond text generation and start generating executable systems and media dynamically.

Future Scope We plan to expand Lerno.AI with: real-time collaborative classrooms multilingual educational generation adaptive learning paths AI-generated diagrams and simulations personalized student analytics mobile deployment

Conclusion Lerno.AI demonstrates how Google Gemini 2.0 Flash can move beyond conversational AI and become a real-time educational content generation engine. By combining Gemini’s reasoning abilities with Python, FastAPI, and the Manim rendering engine, we built a system capable of dynamically programming and rendering educational videos automatically from a simple prompt. This project represents our vision for the future of personalized AI-powered education.

Built With

Share this project:

Updates

Submission history