A multi-agent AI system that creates personalized video advertisements by analyzing viewer behavior, recommending content, and generating video prompts.
# 1. Run the start script
./START_HERE.sh
# 2. Open your browser to http://localhost:5000
# 3. Enter viewing history and click "Generate Ads"- Python 3.10+ with
uvpackage manager - AWS Account with Bedrock access (for Claude 3.5 Sonnet)
- AWS CLI configured (
aws configure) - Wavespeed API Key (optional, for video generation)
# Clone the repository
git clone <your-repo-url>
cd ad-genius-system
# Install uv (if not already installed)
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install dependencies
uv sync --extra web
# Configure AWS credentials (if not already done)
aws configuread-genius-system/
βββ agents/ # AI Agent definitions
β βββ viewer_analytics_agent.py
β βββ content_recommender_agent.py
β βββ ad_strategist_agent.py
β βββ prompt_generator_agent.py
β βββ video_generator_agent.py
β
βββ orchestration/ # Agent coordination
β βββ ad_swarm.py # Swarm mode (autonomous handoffs)
β βββ production_graph.py # Graph mode (structured pipeline)
β
βββ tools/ # Agent tools & utilities
β βββ catalog_tools.py # Content catalog access
β βββ persona_builder.py # Viewer profiling
β βββ prompt_templates.py # Prompt engineering
β βββ nova_reel_tools.py # Video generation (Wavespeed API)
β
βββ config/ # Configuration
β βββ bedrock_config.py # AWS Bedrock & model config
β
βββ templates/ # Frontend HTML
β βββ index.html # Main web interface
β
βββ generated_videos/ # Output directory for videos
βββ examples/ # Example code & usage
βββ docs/ # Additional documentation
β
βββ main.py # CLI entry point
βββ web_app.py # Web application
βββ streaming_hook.py # Real-time progress updates
βββ START_HERE.sh # Quick start script
- Analyzes viewing history patterns
- Builds psychological viewer persona
- Identifies viewing archetypes (Trend Chaser, Quality Connoisseur, etc.)
- Uses persona to find matching content
- Calculates affinity scores
- Returns top 3 recommendations with rationale
- Designs creative ad concepts
- Defines visual approach, messaging, emotional hooks
- Creates A/B test variants
- Converts ad concepts to video generation prompts
- Adds technical specifications (duration, resolution, style)
- Optimizes for video generation models
- Generates actual video files using Wavespeed AI
- Downloads videos locally
- Provides video URLs and metadata
./START_HERE.sh
# Opens on http://localhost:5000Features:
- Real-time agent progress updates
- 2x2 agent results grid
- Streaming console logs
- Video generation toggle
- Graph/Swarm mode selector
# Swarm mode (autonomous agent collaboration)
uv run python3 main.py --mode swarm --user-id user_001 --viewing-history "Title 1" "Title 2"
# Graph mode (structured pipeline)
uv run python3 main.py --mode graph --user-id user_001 --viewing-history "Title 1" "Title 2"To enable video generation:
-
Get Wavespeed API Key:
- Sign up at https://wavespeed.ai
- Copy your API key
-
Set Environment Variable:
export WAVESPEED_API_KEY="your-api-key-here"
-
Enable in Web UI:
- Toggle "Generate Video" in the web interface
- Generated videos appear in
generated_videos/
Edit config/bedrock_config.py:
AWS_REGION = "us-east-1" # Your AWS region
MODEL_ID = "anthropic.claude-3-5-sonnet-20241022-v2:0"The system fetches content from a remote catalog API. Configure in config/bedrock_config.py:
CATALOG_URL = "https://your-catalog-api.com/items"- Autonomous: Agents decide next steps
- Dynamic: Non-deterministic flow
- Streaming: Real-time UI updates
- Use Case: Interactive development, debugging
- Structured: Fixed execution pipeline
- Deterministic: Same input = same flow
- Reliable: Better for production
- Use Case: Batch processing, consistent results
POST /api/generate # Start ad generation job
GET /api/job/{job_id} # Get job status
GET /api/job/{job_id}/stream # Server-sent events stream
GET /generated_videos/{file} # Download generated video
# Run with mock backend (no AWS required)
cp archive/old_tests/demo_mock.py .
uv run python3 demo_mock.py# AWS Credentials (or use aws configure)
export AWS_ACCESS_KEY_ID="your-access-key"
export AWS_SECRET_ACCESS_KEY="your-secret-key"
export AWS_REGION="us-east-1"
# Optional: Video generation
export WAVESPEED_API_KEY="your-wavespeed-key"# Configure AWS CLI
aws configure
# Or set environment variables
export AWS_ACCESS_KEY_ID="..."
export AWS_SECRET_ACCESS_KEY="..."# Kill existing process
killall -9 python3
# Or change port in web_app.py
app.run(port=5001)# Check API key is set
echo $WAVESPEED_API_KEY
# Check debug log
tail -f video_gen_debug.logdocs/CLAUDE.md- Claude Code integration guide
This is an internal project. For questions or contributions, contact the team.
Proprietary - All Rights Reserved
- Strands - Multi-agent orchestration framework
- Flask - Web framework
- AWS Bedrock - Claude 3.5 Sonnet access
- Wavespeed AI - Video generation (optional)
For issues or questions:
- Check the troubleshooting section
- Review logs in
video_gen_debug.log - Contact the development team
Version: 1.0.0 Last Updated: 2025-11-29 Status: Production Ready