RealReel
An AI agent that generates ICP-targeted product marketing videos with a self-improving loop of reference mining, generation, self-critique, and continual learning.
README
RealReel
An AI agent that generates ICP-targeted product marketing videos and gets measurably better every run through a self-improving loop of reference mining, generation, self-critique, and continual learning.
Built at the AI Engineer World's Fair 2026 hackathon, organized by Cerebral Valley.
The Problem
Creating product marketing videos is slow, expensive, and generic. Most tools produce one-size-fits-all output that doesn't resonate with any specific audience. There's no feedback loop — you ship a video and hope it works.
The Solution
RealReel is a video generation agent built around a self-improvement loop. Given a product URL and an Ideal Customer Profile (ICP), it:
- Mines what already resonates with your ICP — discovers high-performing reference content via Exa semantic search and ranks it by real engagement data from the YouTube Data API.
- Extracts patterns — feeds the reference corpus to Gemini to build a
ResonanceProfile: what hooks work, ideal pacing, caption density, visual motifs, and what to avoid. - Generates a multi-format video — captures your product via Playwright, creates title/CTA cards with Gemini image generation, generates B-roll with Veo 3.1, and composes everything with FFmpeg into platform-specific formats (TikTok/Reels, YouTube, LinkedIn, etc.).
- Self-critiques — a critic agent scores the output against an ICP-derived rubric (hook strength, silent readability, pacing, resonance, CTA clarity, etc.) and issues targeted regeneration actions.
- Iterates — regenerates only the weak components, recomposes, and re-scores until the video passes the quality threshold or hits the iteration cap.
- Learns — persists references, resonance profiles, generation results, and critique scores to MongoDB Atlas (with Voyage embeddings), so future runs for the same ICP cold-start from learned best patterns.
The result: run #20 produces better-targeted videos than run #1, with zero manual tuning.
Architecture
ICP Profile
│
▼
[1] Reference Mining (Exa + YouTube API)
│
▼
[2] Pattern Extraction (Gemini) → ResonanceProfile
│
▼
[3] Generation (Playwright capture + Gemini cards + Veo B-roll + Lyria music)
│
▼
[4] FFmpeg Composition (per-platform render profiles)
│
▼
[5] Self-Critique (Gemini critic agent)
│
├── below threshold → regenerate weak components → back to [3]
│
▼ (passes)
[6] Output + Memory (MongoDB Atlas + Voyage embeddings)
Render Profiles
Videos are composited for each target platform from the same source assets:
| Profile | Resolution | Ratio | Platforms | Duration |
|---|---|---|---|---|
social_vertical |
1080x1920 | 9:16 | TikTok, Reels, Shorts | 15-30s |
feed_portrait |
1080x1350 | 4:5 | Instagram, LinkedIn feed | 15-30s |
square |
1080x1080 | 1:1 | Legacy feed, ad units | 15-30s |
landscape |
1920x1080 | 16:9 | Twitter, LinkedIn, web | 20-45s |
youtube |
1920x1080 | 16:9 | YouTube watch page | 30-60s |
Setup
Prerequisites
- Docker
- API keys (see below)
Environment Variables
Create a .env file in the project root:
GEMINI_API_KEY=your_gemini_api_key
EXA_API_KEY=your_exa_api_key
YOUTUBE_API_KEY=your_youtube_data_api_v3_key
# Optional — enables cross-run learning
MONGODB_URI=mongodb+srv://user:pass@cluster/dbname
VOYAGE_API_KEY=your_voyage_api_key
Getting the keys:
- Gemini API Key — Google AI Studio
- Exa API Key — Exa Dashboard
- YouTube Data API Key — Google Cloud Console → APIs & Services → Enable "YouTube Data API v3" → Create Credentials → API Key → select "Public data"
- MongoDB Atlas (optional) — MongoDB Atlas free tier
- Voyage AI (optional) — Voyage AI
Build & Run
# Build the Docker image
docker build -t product-video-factory .
# Run the server
docker run --rm --env-file .env -p 8000:8000 -v "$(pwd)/output:/app/output" product-video-factory
The MCP server starts on http://localhost:8000/mcp using Streamable HTTP transport.
Connect an MCP Client
Add this to your MCP client configuration (e.g. .mcp.json for Claude Code):
{
"mcpServers": {
"video-factory": {
"type": "streamable-http",
"url": "http://localhost:8000/mcp"
}
}
}
Usage
MCP Tools
launch_video_generation — Start a video generation job.
{
"url": "https://your-product.com",
"video_prompt": "Show the dashboard, create a new project, demonstrate the AI features",
"icp": {
"name": "Seed-stage technical founders",
"persona": "Engineers who became founders; trust live product footage and peer signal.",
"pains": ["manual GTM eats build time", "generic demos don't show the actual product"],
"desired_outcomes": ["ship marketing without a marketer", "proof the tool works in 20s"],
"platforms": ["youtube", "linkedin"],
"seed_accounts": [],
"seed_reference_urls": ["https://youtube.com/watch?v=example"],
"keywords": ["product demo dev tool", "founder launch video"],
"tone": "builder-to-builder, fast, technical, zero fluff",
"banned_styles": ["corporate voiceover", "stock footage", "slow logo intro"]
},
"profiles": ["social_vertical", "landscape"],
"max_iterations": 3
}
Returns a job_id immediately. The job runs in the background.
monitor_job_status — Poll a running job.
{
"job_id": "a1b2c3d4"
}
Returns full status including logs, per-iteration critique scores, and output file paths.
MCP Resource
factory://dashboard — Markdown summary of all jobs.
Project Structure
realreel/
├── server.py # FastMCP server + job coordinator
├── loop.py # Self-improvement loop controller
├── icp.py # ICP + ResonanceProfile dataclasses
├── mining.py # Exa + YouTube reference mining
├── resonance.py # Gemini pattern extraction
├── pipeline.py # Playwright capture + Gemini cards + Veo + Lyria
├── critic.py # Self-critique against ICP rubric
├── compose.py # FFmpeg graph builder
├── profiles.py # Render profile definitions
├── memory.py # MongoDB Atlas + Voyage continual-learning store
├── publish.py # Gated publish + engagement pull
├── templates/ # Device frame PNGs for mockup compositing
└── output/ # Generated artifacts (volume-mounted)
How the Self-Critique Works
The critic scores each video on 7 dimensions (0-10):
| Dimension | What it measures |
|---|---|
| Hook strength | Lands within target window, ICP-relevant |
| Silent readability | Fully lands muted (autoplay reality) |
| Pacing | Cut cadence vs ResonanceProfile target |
| ICP resonance | Matches hook/motif/tone patterns for this ICP |
| Safe area compliance | Nothing critical under platform UI overlays |
| CTA clarity | CTA legible and unambiguous |
| Brand consistency | Type/color/logo consistent across segments |
Videos scoring below 7.0 weighted average trigger targeted regeneration — only the weak components are rebuilt, not the entire video.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。