Generate "on this day" Wikipedia history videos: this app fetches historical events from the Wikipedia API, asks an LLM to rewrite the top events as a documentary script, then renders each one as a presenter video with OpenAI Sora and stitches them into a single downloadable daily history video.
uv syncFetches "on this day" historical events from the Wikipedia API (requests only) and ensures every event is date-associated.
Uses LangChain (modern, non-classic) to build an agentic system that:
- Downloads "On this day" historical events from Wikipedia
- Ensures every event is date-associated
- Uses an OpenAI LLM (via LangChain) to rewrite events as a documentary script
- Uses OpenAI Sora to generate a documentary presenter video with audio
- Produces a downloadable video
- agents/ – High-level agent orchestration
- chains/ – LLM chains for summarization and script generation
- tools/ – External tools (Wikipedia fetcher, video generator)
- prompts/ – Prompt templates
- utils/ – Shared helpers
- tests/ – Unit tests for every class
ChatGPT 5.2 was used to generate the initial version of this code using the prompt in generation_prompt.txt. There was significant amount of time spent debugging and refactoring
the generated code. However, it works now. One of the refactors involved splitting the
generated text into smaller chunks so Sora could generate the video via API within its
limits. After downloading the individual files, I asked ChatGPT to generate code for
stitching the video files into one file.
uv syncuv run python src/main.pyOPENAI_API_KEY
- Wikipedia access uses requests only
- No
langchain_classic - Follows SOLID / DRY / KISS / YAGNI principles
uv run --group dev pytestEvery class has unit tests — the Wikipedia fetcher, the LLM script chain, the Sora video generator, the clip stitcher, settings, and the agent's orchestration. All external calls (Wikipedia, OpenAI, moviepy) are mocked, so the suite needs no network access, no API key, and no ffmpeg. Coverage is reported on every run.
Lint and format checks:
uv run ruff check .
uv run ruff format --check .CI runs lint and the test suite on every pull request.