Problem Space

Streaming is increasingly an analytics and resource-allocation problem. Studios must decide where to place limited production budgets, marketing spend, promotional channels, and international rollouts while audience demand shifts constantly across titles and markets.

The data exists across the streaming platform's performance, YouTube engagement, IMDb, TMDB, MovieLens, and other sources — but it is fragmented. Turning these signals into a creative decision often requires back-and-forth communication across multiple departments, which creates distance between filmmakers and the data that could validate their ideas.

                         TODAY

  FILMMAKER / PRODUCER
          │
          │ "I think there is an opportunity here."
          ▼
  Strategy & Analysis
          │
          ▼
      Marketing
          │
          ▼
 Finance / Production Finance
          │
          ▼
   Content Executives
          │
          ▼
      GREENLIGHT

Streamlens closes this gap. ClickHouse unifies large-scale industry and audience signals into one analytical layer, while Gemini lets filmmakers explore that intelligence through natural language.

Instead of requesting an analysis, filmmakers can investigate an opportunity, understand the audience and competitive landscape, and generate a data-backed film proposal directly. Content, strategy, and finance teams can then inspect the evidence and make the final greenlight decision.


Streamlens

Streamlens is an analytics and theme-proposal tool that lets non-technical filmmakers harness ClickHouse through Gemini. The warehouse holds ~268 million rows of public streaming signal — Netflix's Weekly Top 10, the 44 YouTube channels that promote it, IMDb, TMDB, MovieLens. The filmmaker writes no SQL, opens no table, and files no request with strategy. They ask in plain language.

Filmmakers can investigate where audience heat is forming, set a promotional push against what actually charted, see which markets already claimed a title, and turn the answer into a theme proposal — logline, budget band, character archetypes, a generated hero still — with the charts that justify it adopted into the pitch itself.


Data Sources

I'd ideally want to demonstrate the capacity of Clickhouse, so I collected over 267 million rows, and I took Netflix as the case study.

The issue is that Netflix — like every major streamer — keeps its internal viewing data private. None of it is available to the public, so the study is reconstructed entirely from what Netflix itself publishes and what can be observed from outside. That means the Weekly Top 10 catalogs and the biannual What We Watched engagement reports published by Netflix,. I also scraped the YouTube Data API across the 44 Netflix-operated channels to gauge real-time public engagement. Supplementary sources include MovieLens ratings and tags, and two Netflix-derived Kaggle data: Netflix Prize ratings and the VOD Clickstream panel.

Source Description Usage
Netflix Weekly Top 10 Official Tudum TSVs, 2021-07-04 → 2026-08-23, 94 countries, 3,428 titles Outcome: weekly rank, hours viewed, country reach
YouTube Data API v3 44 verified Netflix-operated channels, public statistics only Push: clips, channels, Shorts, cadence, catalogue ids
Netflix What We Watched Biannual engagement workbooks (hours / views by title) Observed consumption, not an internal catalog
IMDb Non-Commercial Datasets Title basics, ratings, episodes, akas, crew, principals Independent reception on the title dossier
TMDB / JustWatch Watch-provider snapshots + US Netflix discover Artwork and publicly observed availability
MovieLens 32M 32 million ratings, 2 million tags, TMDB links Film opinion, joined through tmdbId
MovieLens Tag Genome Movie × tag relevance matrix Semantic space (cyberpunk ≈ 0.98) — not a model guess
Netflix Prize 100 million ratings, 1998–2005 Historical preference calibration
VOD Clickstream 671,736 UK desktop movie sessions, 2017–2019 Session-shape calibration, not current global viewing

Features

Two things a filmmaker can do without writing a line of SQL.

  • Dashboards from plain language : Ask a question and the analyst turns it into SQL. Gemini 3.8 Flash reads the schema over MCP, queries the warehouse via Clickhouse MCP server itself, then draws the charts.
  • Theme Proposals : Ask what to make. The analyst queries the warehouse then writes the one-sheet: logline, budget band, character archetypes, a hero still generated by Nano Banana Pro, and charts that provides evidence to back the theme direction.

Technologies Used

Layer Technology
Frontend Next.js 16, React 19, TypeScript, Tailwind CSS v4, ECharts 6, Recharts, Motion
Backend Python 3.11, FastAPI, Uvicorn, clickhouse-connect, Google ADK
AI/ML Gemini 3.8 Flash on Vertex AI (global endpoint), Google ADK, Google Search grounding. Nano Banana Pro (gemini-3-pro-image) — proposal stills
Database ClickHouse Cloud (streamlens on GCP us-central1) — ~268 million rows across landing, youtube, and streamlens
Infrastructure Google Cloud Run, Cloud Storage, Cloud SQL for Postgres (conversation sessions), Secret Manager, Artifact Registry, Vertex AI / Agent Runtime, Docker
Data Pipeline 17 GCS ClickPipes into landing.*; YouTube Data API v3 poller (direct insert, 30-day TTL); hourly promo_top10_bridge refresh

Architecture

  Netflix Top 10 (public)  ─┐
  IMDb / MovieLens         ─┼─► GCS raw lake ──► 17 ClickPipes ──► ClickHouse Cloud
  VOD clickstream          ─┘   gs://streamlens-data                (landing.*  267M)
                                                                       │
  YouTube Data API v3 ─────► sync.py ────────────────────────────►  (youtube.*)
     44 Netflix channels     direct insert, 30-day TTL                 │
     RSS discovery, no search.list                                     │
                                                                       ▼
                                       refreshable MV: promo_top10_bridge (hourly)
                                                                       │
                          ┌────────────────────────────────────────────┤
                          │                                            │
                          ▼                                            ▼
              FastAPI                                    Gemini 3.8 Flash (Vertex)
              /api/query/{name}    named registry        analyst: 3 MCP servers + Search
              /api/dashboards  + /mcp/dashboards                       │
              /api/proposals   + /mcp/proposals                        │
              /api/conversations   ADK sessions ──► Cloud SQL          ▼
              /api/title/artwork   TMDB, live            gemini-3-pro-image (Nano Banana Pro)
                          │                              stills ──► gs://streamlens-proposals
                          │                                            │
                          └──────────────► Next.js  ◄──────────────────┘
                                           /data    titles · promo
                                           /studio  canvas + analyst chat

Google Cloud. Both models sit on Vertex AI's global endpoint: gemini-3.8-flash for the analyst and the greenlight brief, gemini-3-pro-image for stills. Stills are written to gs://streamlens-proposals, which is a different bucket from the gs://streamlens-data raw lake. That split is deliberate. The lake is immutable and nothing the model touches can reach it. Public access prevention is enforced on both buckets, and no signed URL is ever minted — still bytes come back through the API. The YouTube key lives in the same project, restricted to the YouTube API.

The ClickHouse MCP server is its own Cloud Run service, deployed --no-allow-unauthenticated, so IAM is the gate and anonymous requests get a 403. It reads the warehouse password from Secret Manager. The agent calls it with a Google-signed ID token and never handles a credential.

ClickHouse Cloud. Every chart on the site is a SELECT. 17 ClickPipes move the static dumps from GCS into landing.*. The YouTube poller writes over HTTPS and skips the lake entirely.

There are two SQL identities, and which one runs depends on who wrote the query:

Query Connects as Ceiling
The named registry behind the Data desk default fixed SQL, typed parameters bound server-side
Anything the model wrote — panels, adopted charts, its own MCP calls streamlens_reader readonly = 2, 30 seconds, 5,000 rows

streamlens_reader holds SELECT on landing and youtube. Nothing else, not even on the streamlens database its own dashboards live in. A write fails inside ClickHouse, not inside a Python if.

Built With

  • agent-engine
  • artifact-registry
  • clickhouse-cloud
  • clickpipes
  • cloud-run
  • cloud-storage
  • docker
  • echarts
  • gemini
  • gemini-3-pro-image
  • google-adk
  • iam
  • mcp-clickhouse
  • motion
  • recharts
  • search-grounding
  • secret-manager
  • vertex-ai
  • workload-identity-federation
  • youtube-data-api
Share this project:

Updates