An AI system that turns your idea into a ready-to-post viral short video. You give a topic, and the system automatically finds trending content across platforms, writes an engaging script (with a chance for you to review and edit it), generates a natural human-like voiceover, and produces a polished short-form videoβall with minimal effort from you.
End-to-end run: topic β research β script approval β voiceover β final short video
Screen-studio-1KIjmh9oXS.mp4
- π Multi-Platform Research: Automatically discovers trending content from YouTube Shorts, Twitter/X, and fresh news via Exa
- π AI-Powered Scriptwriting: Generates viral-optimized scripts using GPT-4o with strict style guidelines
- π€ Human Review Loop: Interactive approval system for script refinement with feedback integration
- ποΈ Professional Voiceover: High-quality text-to-speech using ElevenLabs with multilingual support
- π₯ Automated Video Production: Creates polished vertical videos (9:16) using HeyGen avatars
- π End-to-End Automation: Seamless pipeline from topic input to final video delivery
The system operates through four sequential stages:
graph LR
A[Topic Input] --> B[Research Stage]
B --> C[Scripting Stage]
C --> D{Human Review}
D -->|Approved| E[Audio Generation]
D -->|Feedback| C
E --> F[Video Generation]
F --> G[Final Video]
- Node.js 18+ and npm
- Composio Account (Sign up here)
- API Keys for:
- OpenAI (GPT-4o)
- ElevenLabs
- HeyGen
- Exa
-
Clone the repository
git clone https://github.com/yourusername/video-content-agent.git cd video-content-agent -
Install dependencies
npm install
-
Authenticate services via Composio
You'll need to connect each service through Composio's authentication flow:
- Log in to Composio Dashboard
- Create a new project.
- Go to settings for COMPOSIO_API_KEY
- Navigate to "Auth configs".
- Connect: YouTube, Twitter, Exa, ElevenLabs, and HeyGen(self explanatory).
- Take auth config ids from the dashboard and paste it in the .env file.
-
Set up environment variables
Create a
.envfile in the root directory:# OpenAI OPENAI_API_KEY=your_openai_api_key # Composio COMPOSIO_API_KEY=your_composio_api_key COMPOSIO_USER_ID=your_user_id # Auth Config IDs (from Composio dashboard) YOUTUBE_AUTH_CONFIG_ID=your_youtube_config_id TWITTER_AUTH_CONFIG_ID=your_twitter_config_id EXA_AUTH_CONFIG_ID=your_exa_config_id ELEVENLABS_AUTH_CONFIG_ID=your_elevenlabs_config_id HEYGEN_AUTH_CONFIG_ID=your_heygen_config_id
-
Build the project
npm run build
Run the agent:
npm startYou'll be prompted to enter a topic:
? What topic would you like to generate video content for? βΊ voice agents in 2025
The agent will then:
- Research the topic across platforms (~30-60 seconds)
- Generate a script and request your approval
- Generate audio from the approved script (~10-20 seconds)
- Create the final video (~2-5 minutes depending on HeyGen queue)
video-content-agent/
βββ src/
β βββ agents/
β β βββ research.ts # Multi-platform content discovery
β β βββ scripting.ts # AI script generation
β β βββ human_review.ts # Interactive approval system
β β βββ audio.ts # ElevenLabs voice synthesis
β β βββ video_generation.ts # HeyGen video production
β βββ services/
β β βββ client.ts # Composio toolkit sessions
β βββ state/
β βββ state.ts # TypeScript type definitions
βββ index.ts # Main pipeline orchestrator
βββ package.json
βββ tsconfig.json
βββ .env # Environment variables (not committed)
Edit src/agents/audio.ts:
// Change voice ID (find IDs in ElevenLabs dashboard)
const VOICE_ID = "EIsgvJT3rwoPvRFG6c4n"; // Default: Clara
// Change model
const MODEL_ID = "eleven_multilingual_v2";Edit src/agents/video_generation.ts:
// Change avatar ID (find IDs in HeyGen dashboard)
const AVATAR_ID = "109cdee34a164003b0e847ffce93828e"; // Default: Jasmine
// Change video dimensions
const dimension = { width: 720, height: 1280 }; // 9:16 verticalModify src/agents/scripting.ts to adjust:
- Script length (default: 75-85 words)
- Tone and reading level
- Banned words/phrases
- Structural requirements
If you see authentication links in the output:
π¨ AUTHENTICATION REQUIRED: Please click here to authenticate...
- Click the provided link
- Complete the OAuth flow
- Restart the agent with
npm start
- Provide detailed feedback during human review
- Adjust style guidelines in
scripting.ts - Ensure research data is comprehensive (check API quotas)
Use tsx for faster iteration without building:
npx tsx index.ts- Create a new toolkit session in
research.ts - Define an agent with specific instructions
- Parse and integrate results into
ResearchData
Add new stages by:
- Creating a new agent file in
src/agents/ - Importing and calling it in
index.ts - Updating
AgentStatetype insrc/state/state.ts
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Composio for seamless API integrations and SDK.
- OpenAI for GPT-4o and the Agents SDK
- ElevenLabs for high-quality voice synthesis
- HeyGen for AI avatar technology
Built with β€οΈ using Composio