An AI agent that turns a topic into a ready-to-post short video: research → script (with human review) → voiceover → avatar video.
This is the Python/Streamlit rewrite of the original TypeScript CLI (kept for
reference under legacy/). See docs/python.md for the migration PRD.
Topic → Research (YouTube, Twitter/X, Exa) → Script → Human Review → Audio (ElevenLabs) → Video (HeyGen)
Research, ElevenLabs, and HeyGen access is brokered through Composio - the same approach as the legacy CLI. YouTube, Twitter/X, and Exa are called via per-user Composio MCP sessions exposed to an OpenAI Agent; HeyGen is called directly through Composio's HTTP proxy.
app.py Streamlit UI - rendering, buttons, session state only
config.py Environment/settings loading and validation
stages/ Pipeline stage orchestration (no UI, no Streamlit imports)
research.py
script.py
review.py
audio.py
video.py
services/ Vendor integrations
composio_client.py Composio singleton, MCP sessions, connected accounts
openai_client.py OpenAI Agents SDK helpers (build agent, run agent)
elevenlabs_client.py ElevenLabs speech generation
heygen_client.py HeyGen video generation, polling, download
state.py Pydantic models: ResearchData, PipelineState, ...
utils/ Prompts, logging, small pure helpers
outputs/ Generated audio/video (gitignored)
logs/ App logs (gitignored)
-
Create a virtual environment and install dependencies:
python -m venv .venv source .venv/Scripts/activate # Windows Git Bash; use .venv\Scripts\Activate.ps1 in PowerShell pip install -r requirements.txt
-
Copy
.env.exampleto.envand fill in your API keys:cp .env.example .env
You'll need an OpenAI API key, a Composio API key, and Composio auth configs for YouTube, Twitter/X, Exa, ElevenLabs, and HeyGen (connect each toolkit at https://platform.composio.dev, then paste the auth config IDs into
.env). -
Run the app:
streamlit run app.py
-
Push this repo to GitHub, then create a new app at share.streamlit.io pointing at
app.py. -
Python version: the repo pins
3.12via.python-version. Community Cloud reads this automatically; no extra setting is needed. -
Secrets: don't commit
.env. Instead, open the app's Settings → Secrets in the Community Cloud dashboard and paste the same keys from.env.examplein TOML form, e.g.:OPENAI_API_KEY = "sk-..." COMPOSIO_API_KEY = "..." COMPOSIO_USER_ID = "..." YOUTUBE_AUTH_CONFIG_ID = "..." TWITTER_AUTH_CONFIG_ID = "..." EXA_AUTH_CONFIG_ID = "..." ELEVENLABS_AUTH_CONFIG_ID = "..." HEYGEN_AUTH_CONFIG_ID = "..."
app.pybridgesst.secretsinto environment variables on startup, soconfig.pypicks them up exactly like a local.envfile. -
Storage is ephemeral: files written to
outputs/andlogs/survive for the life of the running container but are wiped on redeploy or reboot. That's fine for a single generate-review-download session; don't rely on it as permanent storage. -
Video generation blocks the script run for the full HeyGen polling window (up to ~10 minutes by default). This is expected - the UI shows a spinner for the duration; it isn't a hang.
-
This app has no multi-tenant isolation: every visitor shares the same Composio user (and therefore the same connected YouTube/Twitter/ElevenLabs/ HeyGen accounts). That's fine for a personal deployment; don't expose it publicly as a multi-user product without adding per-user auth.