Topic2manim
Automatic educational video generator using AI and Manim. Converts any topic into a professional animated video with narration and mathematical visualizations.
Install / Use
/learn @mateolafalce/Topic2manimREADME
Topic2Manim
</div>Automatic educational video generator using AI and Manim. Converts any topic into a professional animated video with narration and mathematical visualizations.
<div align="center">User Interface

Examples
</div><div align="center">propmt: How do machines learn to recognize MNIST dataset numbers?
model: claude-sonnet-4-5-20250929
response:

<div align="center">propmt: What is a Markov chain and how are they related to LLMs?
model: claude-sonnet-4-5-20250929
response:

<div align="center">propmt: How does Cramer's rule work for system of linear equations?
model: claude-sonnet-4-5-20250929
response:

<div align="center">propmt: how chat gpt works?
model: gpt-5.2
response:

<div align="center">propmt: how tokenization works in chat gpt?
model: gpt-5.2
response:

Features
- Multi-LLM Support with automatic fallback (OpenAI GPT, Claude)
- Automatic script generation using advanced language models
- Educational animations with Manim Community Edition
- Multi-language support (automatically detects topic language)
- Optimized videos of ~60 seconds with multiple scenes
- Automatic concatenation of fragments into final video
Architecture
System Overview
Topic2Manim is a multi-agent system that orchestrates several specialized components to transform a topic into an educational video. The system follows a pipeline architecture where each agent has a specific responsibility.
graph TB
subgraph Input
A[User Topic]
end
subgraph "LLM Configuration"
B[setup_llm_client]
B1[Claude API]
B2[OpenAI API]
B -->|Priority 1| B1
B -->|Fallback| B2
end
subgraph "Agent 1: Script Generation"
C[animations.py]
C1[generate_script_json]
C --> C1
end
subgraph "Agent 2: TTS Generation"
D[tts_generator.py]
D1[generate_complete_audio]
D2[generate_audio_fragment]
D3[concatenate_audio_fragments]
D1 --> D2
D2 --> D3
end
subgraph "Agent 3: Manim Code Generation"
E[manim_generator.py]
E1[generate_manim_code]
E --> E1
end
subgraph "Agent 4: Video Compilation"
F[concat_video.py]
F1[compile_video]
F2[concatenate_videos]
F3[merge_video_and_audio]
F1 --> F2
F2 --> F3
end
subgraph Output
G[Final Video with Audio]
end
A --> B
B --> C1
C1 -->|video-output.json| D1
C1 -->|video-output.json| E1
D1 -->|audio durations| E1
E1 -->|.py files| F1
F1 -->|.mp4 fragments| F2
D3 -->|audio.mp3| F3
F2 -->|output_silent.mp4| F3
F3 --> G
style A fill:#e1f5ff
style G fill:#c8e6c9
style C fill:#fff9c4
style D fill:#ffe0b2
style E fill:#f8bbd0
style F fill:#d1c4e9
Installation
First, install uv (if you haven't already):
# On macOS and Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Or using pip
pip install uv
Setup
git clone https://github.com/mateolafalce/topic2manim.git
cd topic2manim
# Create virtual environment and install all dependencies
uv sync
# Activate the virtual environment
source .venv/bin/activate # On Windows: .venv\Scripts\activate
cp .env.example .env
Usage
Start the Flask server:
python src/main.py
Then open your browser and navigate to:
http://localhost:5000
or
docker compose up
Related Skills
qqbot-channel
348.0kQQ 频道管理技能。查询频道列表、子频道、成员、发帖、公告、日程等操作。使用 qqbot_channel_api 工具代理 QQ 开放平台 HTTP 接口,自动处理 Token 鉴权。当用户需要查看频道、管理子频道、查询成员、发布帖子/公告/日程时使用。
docs-writer
100.2k`docs-writer` skill instructions As an expert technical writer and editor for the Gemini CLI project, you produce accurate, clear, and consistent documentation. When asked to write, edit, or revie
model-usage
348.0kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
Design
Campus Second-Hand Trading Platform \- General Design Document (v5.0 \- React Architecture \- Complete Final Version)1\. System Overall Design 1.1. Project Overview This project aims t
