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 regionMODEL_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 generationexport WAVESPEED_API_KEY="your-wavespeed-key"# Configure AWS CLI aws configure # Or set environment variablesexport 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 setecho$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