🎬 Transform SQL research into polished video presentations automatically
While browsing LinkedIn, I came across a post from a YC funded company discussing their work on a deep researcher for BI analytics. Intrigued by the concept, I decided to explore it further. Having previously built both a calendar SQL agent and a deep researcher, I realized I could combine these two ideas into a single project—and take it a step further by generating video presentations from the insights.
To test this agent-driven workflow, I needed a suitable dataset. After some searching, I discovered a dataset on GitHub, which contains a dump of Netflix data from their Engagement Report. This dataset serves as an excellent foundation for experimentation and development.
Deep SQL Researcher is an end-to-end pipeline that:
- Research: Uses LangGraph agents to analyze SQL databases and generate insights
- Narrative: Creates compelling story structures from data findings
- Design: Automatically designs video cards and layouts
- Render: Produces polished video presentations using Remotion
- 🤖 AI-Powered Research: LangGraph agents that understand your data goals
- 📊 Structured Insights: Automatic extraction of trends, comparisons, and statistics
- 🎭 Narrative Generation: Compelling story structures for data presentation
- 🎨 Dynamic Card Design: Multiple card variants (hero stats, rankings, comparisons, charts)
- 🎬 Video Rendering: Professional-quality videos with animations and transitions
- 🎯 Type-Safe Pipeline: Full TypeScript integration from database to video
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Research │ │ Narrative │ │ Video │
│ Agent │───▶│ Planning │───▶│ Renderer │
│ │ │ │ │ │
│ • SQL Queries │ │ • Story Structure│ │ • Card Design │
│ • Insights │ │ • Scene Planning │ │ • Animations │
│ • Data Analysis │ │ • Timeline Build │ │ • Video Output │
└─────────────────┘ └──────────────────┘ └─────────────────┘
packages/agent- LangGraph-based research agent with narrative generationpackages/shared- TypeScript types and schemas for the entire pipelineapps/renderer- Remotion-based video renderer with dynamic card components
# Clone the repository
git clone <repository-url>
cd deep-sql-research
# Install dependencies
bun install
# Build all packages
bun run build# Interactive mode (prompts for goal and database)
bun run packages/agent/src/index.ts
# Or use the complete pipeline
bun run generate-video# 1. Generate research insights and template
bun run packages/agent/src/index.ts > template.json
# 2. Render video from template
bun run apps/renderer/src/cli.ts template.json
# 3. Preview the video
cd apps/renderer && bun run dev- "Analyze Netflix content performance to understand what makes a show successful"
- "Compare viewer engagement between movies and TV series"
- "Identify trends in content release patterns and their impact on ratings"
deep-sql-research/
├── packages/
│ ├── agent/ # LangGraph research agent
│ │ ├── src/
│ │ │ ├── agent/ # Graph definitions and state
│ │ │ ├── nodes/ # Individual processing nodes
│ │ │ ├── helpers/ # Database, LLM, and utilities
│ │ │ ├── fixtures/ # Test research scenarios
│ │ │ └── tests/ # Template generation tests
│ │ └── netflixdb.sqlite # Sample Netflix dataset
│ └── shared/ # Shared types and schemas
│ └── src/
│ ├── types.ts # Core data structures
│ ├── schemas.ts # Zod validation schemas
│ └── constants.ts # Node and type constants
├── apps/
│ └── renderer/ # Remotion video renderer
│ ├── src/
│ │ ├── components/ # Dynamic card components
│ │ ├── animations/ # Motion presets and transitions
│ │ ├── themes/ # Visual theming system
│ │ ├── cli.ts # Video rendering CLI
│ │ └── VideoRoot.tsx # Main Remotion composition
└── package.json # Workspace configuration
# Development
bun run dev # Start development servers
bun run build # Build all packages
bun run type-check # Type checking across workspace
# Agent Development
bun run studio # LangGraph studio for agent debugging
bun run test # Run agent tests with snapshots
# Video Rendering
cd apps/renderer
bun run dev # Preview server
bun run build # Render video
bun run render <template.json> # CLI video rendering# Run all tests
bun run test
# Run specific test suites
cd packages/agent && bun test src/tests/template-generation.test.tsThe renderer supports multiple card variants:
hero_stat- Large, prominent statisticsranked_list- Ordered rankings with highlightscomparison_split- Side-by-side comparisonstrend_chart- Time-based trend visualizationsdistribution_chart- Statistical distributionskey_highlight- Important insight callouts
- Cinematic slide-up - Dramatic entrance animations
- Scale pop - Bouncy, attention-grabbing effects
- Fade in - Smooth transitions
- Slide variants - Directional movement effects
- Copy
.env.exampleto.env - Configure your LLM provider (OpenAI, Anthropic, etc.)
- Set up database connections
Replace netflixdb.sqlite with your own SQLite database:
# Place your database in packages/agent/
cp your-database.sqlite packages/agent/- Input: Research goal and database path
- Research: Agent generates SQL queries and extracts insights
- Synthesis: Insights are structured into narrative outline
- Planning: Scenes are planned with layout presets
- Design: Cards are designed with variants and styling
- Timeline: Complete video timeline is constructed
- Template: Final JSON template is assembled
- Render: Video is generated from template
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Run
bun run type-checkandbun run test - Submit a pull request
MIT License - see LICENSE file for details
- Netflix Dataset for the sample data
- LangGraph for the agent framework
- Remotion for video generation
- Bun for the fast JavaScript runtime