How nabin2004/openclassrooms works
1. Repository shape
- This is a Python 3.14, uv-managed monorepo with four real product areas: manimator, autolecture, webapp, and amoeba.
- The root package (openclassrooms) is a lightweight metapackage plus repo-level scripts, tests, and shared developer workflows.
2. Primary system: manimator
- manimator is the main end-to-end pipeline in this repo.
- It turns a user request into a structured teaching/scene plan, generates or repairs animation code, renders Manim scenes, optionally adds narration, and packages the final video output.
- The top-level entrypoint is manimator/main.py, with pipeline orchestration in manimator/pipeline/.
3. Manimator pipeline boundary
- manimator/pipeline/state.py and manimator/pipeline/graph.py indicate a stateful, graph-driven workflow rather than a single linear script.
- Each stage passes a shared pipeline state through agent nodes, which makes the architecture good for retries, validation loops, and repair cycles.
- The repo’s logs and outputs suggest per-run artifacts are persisted, including scene videos, narration tracks, transcripts, and final delivery bundles.
4. Agent layer inside manimator
- manimator/agents/ contains specialized roles: intent classification, scene decomposition, planning, code generation, critique, validation, and repair.
- This is a multi-agent orchestration boundary: each agent owns one decision surface and emits structured outputs consumed by the next stage.
- The design suggests the pipeline can branch based on intent, critique outcomes, or validation failures.
5. Structured contracts and IR
- manimator/contracts/ defines the typed data exchanged between stages: intent, scene plan/spec, critique, validation, and LLM outputs.
- manimator/ir.py plus manimator/docs/ir/ show an internal representation layer used to stabilize the pipeline between language-model reasoning and executable animation code.
- This contract layer is important for drawing the architecture: it is the seam between “LLM reasoning” and “deterministic execution.”
6. Code safety and generation boundaries
- manimator/manim_utils/ contains AST checks and class whitelisting, which implies generated code is inspected before execution.
- That makes code generation a controlled boundary: LLM-produced Manim code is not executed directly without safety checks.
- manimator/exceptions.py and manimator/prompts/code_repair/ show explicit failure handling and recovery loops around this boundary.
7. Audio and delivery path
- manimator/audio/ handles narration generation, TTS configuration, and muxing audio back into video.
- manimator/video/delivery.py likely packages the final render into a deliverable artifact, and the outputs/delivery/ tree confirms final bundled runs are stored separately.
- This creates a second major output path after scene rendering: visual video first, then narration and final muxed delivery.
8. Prompting and model interaction
- manimator/prompts/ contains versioned prompt templates for intent classification, scene planning, scene decomposition, and repair.
- manimator/runtime_env.py and manimator/runtime-adjacent files imply environment-specific model/runtime settings are separated from the prompt text itself.
- The architecture likely depends on LLM calls as a service boundary, with prompt versions treated as stable inputs to the agent layer.
9. Observability and logging
- manimator/logging/ and manimator/observability/metrics.py indicate explicit runtime instrumentation.
- The README warning about logging name shadowing is an architectural constraint: the package layout can affect Python import resolution, so invocation style matters.
- Repository logs under logs/ and pipeline run artifacts under outputs/ are part of the operational story, not just test data.
10. amoeba: agent framework package
- amoeba/ is a separate reusable agent framework, with core abstractions for agents, tools, memory, perception, LLM adapters, retry, and runtime.
- It also includes environments (envs/real.py, envs/sim.py) and a graph/pipeline abstraction, so it appears to be the lower-level framework layer rather than the application.
- In architecture terms, amoeba is the platform capability; manimator is the application built on top of agent orchestration ideas.
11. autolecture: lecture-generation experiment
- autolecture/ is another generation-focused project, but lighter-weight and narrower than manimator.
- The presence of scene_decomposer/ and TTS provider registry suggests it converts lecture material into scenes and narration, but with less of the validation/repair pipeline complexity seen in manimator.
12. webapp: interactive application
- webapp/ is a separate FastHTML app with its own database (khan.db) and app entrypoint.
- It is architecturally distinct from the video-generation pipeline: this is a user-facing interface and persistence layer, not the media generation engine.
13. Root-level scripts and workflows
- Root files like test_agents.py, test_codegen.py, test_planner.py, and set_video_config.py act as operational harnesses around the pipeline.
- Makefile, DEVELOPMENT.md, and AGENT_TESTING.md define the repo’s workflow conventions and test entrypoints.
- These scripts are important to diagram as “control surfaces” for exercising the pipeline without going through each package’s internal entrypoint.
14. External/runtime dependencies that materially shape architecture
- Manim is the central rendering engine for manimator.
- LLM calls are an architectural dependency across the agent layers.
- TTS is optional but first-class in the media pipeline, and the repo explicitly supports provider-based narration.
15. How to draw the main data flow
- For manimator, the clearest flow is: user query → intent/scene analysis → structured scene plan/IR → code generation → safety/validation/critique → repair loop if needed → render scenes → optional narration → mux/delivery → saved outputs.
- The key boundaries are: contract/IR serialization, code safety checks, render execution, and audio/video finalization.
Main entry points: agents Agents · graph.py Pipeline graph · delivery.py Delivery · core Core
Components 21
Root
Repo-level metapackage, scripts, docs, and workflow entrypoints.
- openclassrooms · Lightweight repo package wrapper.
openclassrooms/__init__.py - Root CLI · Repository-level command entrypoint.
main.py - Test harnesses · Operational scripts for exercising agents and pipeline stages.
- Repo docs · Shared development, testing, and roadmap documentation.
DEVELOPMENT.md
Manimator
Primary end-to-end teaching video generation pipeline.
- Pipeline entry · Main application entrypoint.
manimator/main.py - Pipeline graph · Stateful graph-driven orchestration boundary.
manimator/pipeline/graph.py - Pipeline state · Shared mutable run state passed across stages.
manimator/pipeline/state.py - Agents · Intent, decomposition, planning, generation, critique, validation, and repair roles.
manimator/agents - Contracts · Structured outputs exchanged between stages.
manimator/contracts - IR · Internal representation stabilizing LLM reasoning before execution.
manimator/ir.py - Prompts · Versioned prompt templates and prompt selection logic.
manimator/prompts - Code safety · AST checks and class whitelisting before generated code executes.
manimator/manim_utils/ast_check.py - Audio path · TTS, narration generation, and muxing back into video.
manimator/audio - Delivery · Packages rendered scenes into final deliverables.
manimator/video/delivery.py - Run outputs · Persisted scene renders, narration tracks, transcripts, and delivery bundles.
outputs/delivery/20260403T142331Z/final.mp4
Amoeba
Reusable agent framework and runtime layer.
- Core · LLM, memory, tool, retry, and response primitives.
amoeba/src/amoeba/core - Graph runtime · Node and pipeline abstraction for agent execution.
amoeba/src/amoeba/graph/pipeline.py - Envs · Real and simulated execution environments for agents.
amoeba/src/amoeba/envs
Autolecture
Smaller lecture-generation experiment.
- Scene decomposer · Breaks lecture material into scenes and narration flow.
autolecture/scene_decomposer/agent.py - TTS registry · Provider registry and engine for narration generation.
autolecture/scene_decomposer/tts/registry.py
Webapp
User-facing application and persistence layer.
- Web app · Interactive application entrypoint with its own database.
webapp/main.py
Connections 20
- Root CLI → Pipeline entry: runs pipeline · Repo entrypoint can invoke the main video pipeline.
- Test harnesses → Agents: exercises · Standalone scripts target individual agent stages.
- Test harnesses → Pipeline graph: drives · Scripts are used to run and inspect the pipeline graph.
- Repo docs → Pipeline graph: documents · Repo guidance explains workflow and testing conventions.
- Pipeline entry → Pipeline graph: orchestrates · Main entrypoint hands off to graph-driven execution.
- Pipeline graph → Pipeline state: threads state · Pipeline stages share a structured run state.
- Pipeline graph → Agents: invokes · Workflow dispatches into specialized agent roles.
- Agents → Contracts: emit · Agents produce typed outputs consumed downstream.
- Contracts → IR: stabilize · Contracts and IR form the structured seam for execution.
- Agents → Prompts: uses · Agents are parameterized by prompt templates.
- Agents → Code safety: guards · Generated code is checked before execution.
- Agents → Audio path: optionally narrate · Narration and voiceover happen after scene generation.
- Pipeline graph → Delivery: finalizes · Pipeline packages rendered assets for delivery.
- Audio path → Delivery: muxes into · Audio is combined with rendered video for final output.
- Delivery → Run outputs: persists · Final bundles and transcripts are stored as run artifacts.
- Core → Graph runtime: supports · Core primitives underpin graph execution.
- Graph runtime → Envs: executes in · Graph runtime can target real or simulated environments.
- Core → Agents: underlies · Manimator’s orchestration builds on agent/runtime primitives.
- Scene decomposer → TTS registry: uses · Lecture scene generation can attach narration providers.
- Web app → Run outputs: serves artifacts · Web application can present or manage generated media outputs.