AI-Powered Moroccan Darija Educational Video Generator
# Aji Nafhem — أجي نفهم
### AI-Powered Moroccan Darija Educational Video Generator
**Aji Nafhem** (أجي نفهم, "come, let's understand" in Moroccan Darija) is an agentic pipeline that turns any educational topic into a fully animated, voiced video — with narration in Moroccan Darija and Manim-rendered visuals.
---
## Samples
Two example outputs generated entirely by the pipeline — Darija voiceover + Manim animations, no manual editing.
**Geopolitics** — explaining a geopolitical concept with animated maps and text:
**Math Problem** — step-by-step worked math with equations and visual aids:
---
## How It Works
The pipeline runs six sequential AI-powered steps:
```
Topic / Question
│
▼
[Step 1] Analytical Solver → breaks the topic into logical teaching steps
│
▼
[Step 2] Script & TTS → writes a Darija voiceover script + synthesizes audio
│
▼
[Step 2r] Script Review → checks script↔visual coherence, fixes tashkeel & pacing
│
▼
[Step 3] Map Generator → detects geographic requirements, renders map PNGs
│ (cartopy + matplotlib — no API needed)
▼
[Step 4] SVG Asset Generator → creates flat-design vector illustrations
│
▼
[Step 5] Manim Code Generator → writes a complete animated Python scene,
│ with map images attached for accurate coordinate placement
▼
[Step 6] Compile & Auto-Fix → runs Manim, self-corrects errors (up to 3 retries)
│
▼
MP4 Video
```
Each step saves a JSON checkpoint so runs can be resumed or forked from any point.
---
## Features
- **Moroccan Darija narration** — scripts written and voiced in Darija Arabic with full tashkeel for TTS clarity
- **Script review agent** — automatically checks that each spoken segment matches its visual action, fixes pacing, and enforces TTS-friendly phonetics
- **Geographic map generation** — automatically detects when a topic needs maps, renders them with cartopy + matplotlib (no external API), an …