3b1b-manim/animation-agent
2025-04-06 00:05:12 +05:30
..
agents.py Added Docs & Agent frameworks 2025-04-06 00:05:12 +05:30
code_generator.py Added Docs & Agent frameworks 2025-04-06 00:05:12 +05:30
knowledge_base.py Added Docs & Agent frameworks 2025-04-06 00:05:12 +05:30
llm_providers.py Added Docs & Agent frameworks 2025-04-06 00:05:12 +05:30
main.py Added Docs & Agent frameworks 2025-04-06 00:05:12 +05:30
manim_animation_agent.ipynb Added Docs & Agent frameworks 2025-04-06 00:05:12 +05:30
README.md Added Docs & Agent frameworks 2025-04-06 00:05:12 +05:30
requirements.txt Added Docs & Agent frameworks 2025-04-06 00:05:12 +05:30

Animation Agent

An AI-powered system for creating mathematical animations using the Manim library.

Project Structure

animation-agent/
├── knowledge_base.py  # Contains animation capabilities and patterns
├── agents.py         # Core agent implementations
├── main.py          # Main orchestration logic
└── requirements.txt  # Project dependencies

Components

  1. Knowledge Base

    • Animation capabilities
    • Mathematical visualization patterns
    • Object properties and uses
    • Common narrative structures
  2. Agents

    • ContentPlanningAgent: Plans the educational content
    • NarrativeDesignAgent: Designs the story flow
    • VisualPlanningAgent: Plans the visual elements
  3. Main System

    • Orchestrates agent interactions
    • Manages the animation creation process
    • Provides the main interface

Setup

  1. Create a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. Set up environment variables:

    # Create .env file with:
    OPENAI_API_KEY=your_api_key_here
    

Usage

Run the main script:

python main.py

Example code:

from main import AnimationSystem

system = AnimationSystem()
animation_plan = system.create_animation(
    concept="derivative_introduction",
    audience_level="high_school"
)

Development

  • The system uses a modular design for easy extension
  • Each agent can be enhanced independently
  • Knowledge base can be expanded with new patterns

Future Enhancements

  1. Add more mathematical patterns
  2. Implement feedback loops
  3. Add quality checking
  4. Integrate voice-over generation
  5. Add more animation templates