Inspiration

Modern entertainment enterprises operate across massive, fragmented data streams — billions in box office receipts, millions of high-frequency streaming events, multi-million dollar marketing budgets split across TikTok, YouTube, Meta, and Connected TV. Yet studio executives still wait days for BI teams to write custom SQL reports.

We asked: What if an AI agent could autonomously investigate any strategic question by querying real-time OLAP data, diagnosing root causes, and formulating actionable directives — all in seconds?

That's CinePulse AI.

What it does

CinePulse AI is an autonomous media intelligence system for film studio executives and streaming platform leaders. It features:

  • 🤖 Gemini Director Agent — Ask any strategic question in natural language (e.g., "Why did Sci-Fi completion crash in Latin America?"). The agent autonomously plans a multi-step investigation, calls 12 analytical tools against ClickHouse, correlates data across tables, and synthesizes an executive dossier with evidence-backed directives.

  • 📊 Slate Performance Dashboard — Real-time genre financials (Box Office vs Budget vs Net Profit), global streaming distribution by territory, and multi-channel marketing ROAS attribution — all powered by live ClickHouse OLAP queries.

  • 🔍 ClickHouse OLAP Explorer — A SQL sandbox with pre-built query templates for territory completion rates, marketing spend attribution, monthly revenue trends, and platform anomalies. Sub-50ms query execution across 15,000+ events.

  • 🚨 Incident Control Room — Real-time observability monitoring for CDN packet loss, playback drop-offs, audio sync degradation, and retention anomalies — with one-click dispatch to the AI agent for autonomous investigation.

  • 💰 Capital Reallocation Simulator — Interactive slider-based tool that projects gross revenue lift, churn reduction, and net profit delta from reallocating media spend between channels.

  • ⚡ Deploy Directives — One-click deployment of AI-generated action directives with real-time status tracking (Idle → Executing → Deployed).

How we built it

Architecture:

  • Frontend: Next.js 15 (App Router) + React 19 + TypeScript + Tailwind CSS + Recharts for data visualization
  • AI Engine: Google Cloud Gemini API (gemini-2.5-flash) with multi-turn function calling — 12 registered analytical tools
  • Database: ClickHouse Cloud as the ultra-fast OLAP backbone, with a resilient dual-mode architecture (Cloud + embedded local engine for zero-friction offline execution)
  • Agent Pipeline: 4-stage autonomous investigation flow — PLANNING → QUERYING → ANALYZING → SYNTHESIZING — with full SQL audit trail

Key Technical Decisions:

  • Used Gemini's multi-turn tool calling to let the agent autonomously decide which ClickHouse tools to invoke based on the question
  • Designed 12 specialized analytical tools (revenue, retention, marketing ROAS, anomaly detection, content recommendations) as discrete function declarations
  • Built a resilient dual-mode ClickHouse connection — seamlessly falls back to embedded OLAP when cloud is unavailable
  • Dark cinematic "studio control room" UI design with premium glassmorphism aesthetics

Challenges we ran into

  • Multi-turn tool orchestration — Getting Gemini to chain multiple analytical tool calls in the right sequence required careful system prompt engineering and structured response schemas
  • ClickHouse schema design — Optimizing partition keys and sort orders for sub-50ms analytical queries across 15,000+ viewing events with multiple join patterns
  • Real-time chart generation — Translating raw ClickHouse aggregation results into dynamic Recharts visualizations with proper axis scaling and labeling
  • Resilient dual-mode architecture — Building a seamless fallback from ClickHouse Cloud to an embedded local engine without any code changes

Accomplishments that we're proud of

  • True autonomous agent behavior — The Gemini Director Agent formulates its own investigation plan, decides which tools to call, chains multiple ClickHouse queries, and synthesizes findings without any human guidance
  • 12 production-grade analytical tools — Each tool executes optimized parameterized SQL against ClickHouse with proper error handling and response normalization
  • Sub-50ms ClickHouse query latency — Achieved through careful schema design with MergeTree engines, partition pruning, and columnar compression
  • Premium cinematic UI — A dark studio control room aesthetic that feels like an enterprise-grade product, not a hackathon prototype

What we learned

  • Gemini's function calling is remarkably powerful for building autonomous agents — the model can reason about which tools to invoke and in what sequence
  • ClickHouse's columnar architecture makes it ideal for the kind of multi-dimensional analytical queries that media intelligence requires
  • System prompt engineering is critical — the quality of the agent's investigation and recommendations improved dramatically with structured persona constraints and evidence-quotation rules

What's next for CinePulse AI

  • Real-time streaming ingestion — Connect to Apache Kafka for live viewing event streams into ClickHouse
  • Gemini 2.5 Pro upgrade — Leverage longer context windows for more complex multi-step investigations
  • Collaborative investigations — Multiple executives collaborating on the same investigation with shared annotations
  • Predictive analytics — Use historical ClickHouse data to predict churn, forecast box office performance, and recommend optimal release windows
  • Google Cloud Run deployment — Containerized production deployment with auto-scaling

Built With

Share this project:

Updates

Submission history