๐ฌ Physics โข ๐งช Chemistry โข ๐งฌ Biology โข ๐ Earth Science โข ๐ Mathematics โข ๐ป Computer Science
A sophisticated system that leverages Large Language Models (LLMs) and the Manim animation framework to automatically create compelling educational science videos with professional-quality visualizations.
- Scientific Content Generator: Creates pedagogically structured, curriculum-aligned scientific explanations
- Manim Animation Generator: Transforms educational content into executable, visually appealing animation code
- Science-Optimized Content Generation: Domain-specific prompts tailored for various scientific disciplines
- Structured Educational Output: JSON-formatted content with visual descriptions, timing, and learning objectives
- Professional Scientific Visualizations: Manim-powered animations optimized for scientific concepts
- Complete Automated Pipeline: End-to-end generation and rendering of educational science videos
- Adaptive Complexity Levels: Content generation for K-12, undergraduate, and advanced levels
- Physics: Mechanics, Thermodynamics, Electromagnetism, Quantum Physics, Optics
- Chemistry: Atomic Structure, Chemical Bonding, Reactions, Organic Chemistry, Biochemistry
- Biology: Cell Biology, Genetics, Evolution, Ecology, Human Anatomy & Physiology
- Earth Science: Geology, Meteorology, Oceanography, Environmental Science
- Mathematics: Algebra, Geometry, Calculus, Statistics, Applied Mathematics
- Computer Science: Algorithms, Data Structures, Programming Concepts
User Input โ Content Generator โ Manim Code Generator โ Animation Renderer โ Final Video
- Input: Scientific topic (e.g., "Photosynthesis", "Newton's Laws", "DNA Replication")
- Output: Structured JSON with:
- Step-by-step explanations
- Visual descriptions
- Scientific diagrams and models needed
- Timing information
- Mathematical equations (when applicable)
- Key concepts and terminology
- Input: Structured educational content
- Output: Complete, executable Manim Python code
- Features: Scientific visualizations, animations, proper timing, educational appeal
-
Clone the repository
git clone https://github.com/your-username/EduGen.git cd EduGen -
Install Python dependencies
pip install -r requirements.txt
-
Install system dependencies
# LaTeX (for mathematical notation and scientific formulas) sudo apt install texlive-full ffmpeg # Ubuntu/Debian # brew install --cask mactex ffmpeg # macOS
-
Set up environment variables
cp .env.example .env # Edit .env and add your API keys
Create a .env file with your API keys:
GROQ_API_KEY=your_groq_api_key_here
OPENAI_API_KEY=your_openai_api_key_here # Optional fallbackstreamlit run app.pyThen navigate to http://localhost:8501 and:
- Enter a scientific topic
- Select complexity level and domain
- Generate structured content
- Generate Manim animation code
- Render and download animation
from script_generator import script_generator
from manim_code_generator import manim_code_generator
from animation_creator import create_animation_from_code
# Generate structured content
content = script_generator.generate_script("Explain cellular respiration")
# Generate Manim code
manim_code = manim_code_generator.generate_manim_code(content)
# Create animation
video_path = create_animation_from_code(manim_code)EduGen/
โโโ script_generator.py # Stage 1: Educational content generation
โโโ manim_code_generator.py # Stage 2: Manim code generation
โโโ animation_creator.py # Animation rendering
โโโ app.py # Web interface
โโโ requirements.txt # Python dependencies
โโโ .env # Environment variables
โโโ media/ # Generated content storage
{
"title": "Photosynthesis: Converting Light to Chemical Energy",
"introduction": "Let's explore how plants transform sunlight into the energy that powers life on Earth...",
"explanation_steps": [
{
"step": 1,
"narration": "Photosynthesis begins when chloroplasts in plant cells absorb sunlight",
"visual_description": "Show a plant cell with highlighted chloroplasts, with light rays entering",
"scientific_objects": ["plant_cell", "chloroplasts", "sunlight", "labels"],
"duration": 6,
"key_equation": "6COโ + 6HโO + light energy โ CโHโโOโ + 6Oโ",
"emphasis_points": ["chloroplasts", "light absorption"],
"learning_objective": "Understand where photosynthesis occurs in plant cells"
}
],
"complexity_level": "high_school",
"scientific_domain": "biology",
"total_duration": 120,
"prerequisites": ["basic cell structure", "chemical equations"],
"key_vocabulary": ["chloroplast", "photosynthesis", "glucose", "carbon dioxide"]
}from manim import *
class PhotosynthesisScene(Scene):
def construct(self):
# Create plant cell with chloroplasts
cell = Circle(radius=2, color=GREEN).set_fill(GREEN, opacity=0.2)
chloroplasts = VGroup(*[
Circle(radius=0.3, color=DARK_GREEN).set_fill(DARK_GREEN, opacity=0.7)
for _ in range(6)
]).arrange_in_grid(2, 3, buff=0.3).move_to(cell.get_center())
# Add title
title = Text("Photosynthesis", font_size=48, color=GREEN)
title.to_edge(UP)
# Create sunlight rays
sun_rays = VGroup(*[
Arrow(start=UP*3 + LEFT*i, end=cell.get_top() + LEFT*i*0.3,
color=YELLOW, stroke_width=4)
for i in range(-2, 3)
])
# Animation sequence
self.play(Write(title), run_time=2)
self.play(Create(cell), run_time=2)
self.play(Create(chloroplasts), run_time=2)
self.play(Create(sun_rays), run_time=1.5)
# Show the chemical equation
equation = MathTex(
"6CO_2 + 6H_2O + \\text{light} \\rightarrow C_6H_{12}O_6 + 6O_2",
font_size=36
).to_edge(DOWN)
self.play(Write(equation), run_time=3)
self.wait(3)- Enhanced script generator with science-specific prompts
- Two-stage LLM pipeline
- Manim code generator
- Improved Streamlit interface
- Scientific object library (molecules, cells, atoms, etc.)
- Advanced error handling and validation
- Real-time animation preview
- Multi-domain content integration
- Interactive scientific simulations
- Voice narration integration
- Curriculum alignment features
- Assessment question generation
- Educators: Create engaging science content without animation expertise
- Students: Access high-quality visual explanations for complex scientific concepts
- Researchers: Communicate findings through compelling visualizations
- Content Creators: Produce professional educational videos efficiently
We welcome contributions! Please read our Contributing Guidelines for details on our code of conduct and the process for submitting pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.
Built with โค๏ธ for science education

