An AI-powered tool that transforms your text prompts or documents into stunning 2D animated videos, complete with narration, using Manim and Alchemyst AI.
A brief demonstration of the UI and a generated video.
AlcheAnimyst is an end-to-end video generation system. It takes a simple idea and orchestrates a multi-step AI and rendering pipeline to produce a finished, narrated animation.
- Input: A user submits a text-based idea (e.g., "Explain support vector machine algp").
- Process:
- The Alchemyst AI Engine receives the prompt and generates two assets:
- A Python script using the
Manim Communitylibrary. - A corresponding narration script.
- A Python script using the
- The ElevenLabs Service synthesizes the narration script into a high-quality voiceover audio file.
- The Manim Renderer executes the generated Python script to create a silent animation.
- A Retry & Fix Loop automatically detects rendering errors, sending the faulty code and error message back to Alchemyst AI for an automated fix.
- Finally,
FFmpegmerges the final video and audio tracks into a single, synchronized MP4 file.
- The Alchemyst AI Engine receives the prompt and generates two assets:
- Output: A ready-to-watch
.mp4video that visualizes the user's concept.
- Frontend: Streamlit
- AI / LLM Provider: Alchemyst AI
- Animation Engine: Manim Community
- Text-to-Speech: ElevenLabs
- Core Logic: Python, LangChain
graph TD
A["User (Streamlit UI)"] -- Submits Idea/PDF --> B{AlcheAnimyst Engine}
subgraph B [AI Generation Core]
C["Alchemyst AI Engine"] --> D["Manim Code Generation"]
C --> E["Narration Script Generation"]
end
E --> F["ElevenLabs Service"]
F --> G["Audio File (.mp3)"]
D --> H{"Manim Renderer"}
H -- Success --> I["Video File (.mp4)"]
H -- Failure --> J["Retry & Fix Loop"]
J --> C
subgraph K ["Final Assembly"]
I --> L["FFmpeg Merger"]
G --> L
end
L --> M["Final Video Output"]
M --> A
The user provides a prompt to the Streamlit UI. The Alchemyst AI engine generates Manim code and a narration script. The script is converted to audio by ElevenLabs, while the Manim code is rendered into a video. If rendering fails, a retry loop attempts to fix the code. Finally, the successful video and audio are merged and presented to the user.
- LLM Provider: https://getalchemystai.com
- Text-to-Speech: https://elevenlabs.io
- Animation Framework: https://www.manim.community/
- Python 3.9+
- FFmpeg: Manim and the video merger require FFmpeg. You must install it on your system.
- Windows (using Chocolatey):
choco install ffmpeg - macOS (using Homebrew):
brew install ffmpeg - Linux (Debian/Ubuntu):
sudo apt update && sudo apt install ffmpeg
- Windows (using Chocolatey):
- Clone the repo
git clone https://github.com/your-username/AlcheAnimyst.git cd AlcheAnimyst - Set up the environment
- Create a
.envfile in the root directory by copying the example:cp .env.example .env
- Add your API keys to the
.envfile:ALCHEMYST_API_KEY="sk-..." ELEVENLABS_API_KEY="..."
- Create a
- Install Python dependencies
pip install -r requirements.txt
- Run the Streamlit App
The application will now be running and accessible in your web browser!
streamlit run src/main.py
This project requires API keys from two services:
-
Alchemyst AI:
- Sign up at https://getalchemystai.com.
- Find your API key in your account dashboard.
- Add it to your
.envfile asALCHEMYST_API_KEY.
-
ElevenLabs:
- Sign up at https://elevenlabs.io.
- Your API key can be found in your profile settings.
- Add it to your
.envfile asELEVENLABS_API_KEY.
AlcheAnimyst's resilience comes from its smart generation and error-correction process.
-
Code Generation (
engine/alchymist_ai.py): The core generation logic uses a highly detailed system prompt to guide Alchemyst AI. This prompt contains strict rules about using the modern Manim v0.19.0 API, ensuring the generated code is high-quality and avoids common pitfalls. -
Automated Error Correction (
engine/retry_loop.py): Manim code can sometimes fail. Instead of crashing, the app catches thestderrfrom the Manim process. It then packages the faulty code and the exact error message into a new prompt for Alchemyst AI, asking it to analyze and fix the problem. This allows the application to self-heal and successfully render videos that would have otherwise failed.
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
on my way