Inspiration

Streaming platforms generate huge volumes of viewer-event data, but raw events don't tell a content team anything on their own — someone still has to dig through dashboards to find what actually matters. We wanted to close that gap: not just visualize the data, but have an AI agent actively investigate it and hand back an answer a team could act on today.

What it does

StudioPulse ingests viewer-event data into ClickHouse, computes audience analytics (film, country, genre, device, age group, and event type performance) through a Python analytics engine, and serves it through a FastAPI backend to a React dashboard. Layered on top is a Gemini-powered agent, built with Google's Agent Development Kit, that has direct tool access to the same ClickHouse analytics. The agent decides which slices of data to investigate, then returns one grounded insight: what it found, the specific numbers backing it up, a concrete recommendation, and a confidence rating — because this is observational data, and the agent is explicitly instructed never to claim causation it can't support.

How we built it

ClickHouse Cloud stores ~5,000 viewer events across 8 films and 1,200 unique viewers. Python + FastAPI expose analytics endpoints (overview, films, countries, genres, devices, age groups, event types, activity). Google ADK powers the AI layer: instead of a single prompt stuffed with pre-computed context, the agent is given 8 separate tools (one per analytics category) and decides for itself which data to pull before answering — genuine tool-calling, not a scripted pipeline. React + Vite + Tailwind + Recharts render the dashboard, styled around a cinema-dark theme rather than a default admin-panel look. Render + Vercel host the backend and frontend respectively.

Challenges we ran into

The AI layer originally started as a single prompt-to-JSON call with pre-fetched context. We rebuilt it around ADK so the agent genuinely chooses which tools to call, which better reflects real agentic behavior rather than a static pipeline dressed up as one. Gemini's free-tier daily quota (20 requests/day on our model) is easy to exhaust during active development, since each agent run makes several tool-calling rounds internally. We added server-side caching with a stale-cache fallback so the dashboard stays functional even if a fresh generation is rate-limited. Hit a couple of deployment-specific issues getting Render to pin the right Python version, and a Windows PowerShell encoding quirk that corrupted a special character during a file edit — both resolved by verifying the actual bytes rather than assuming the edit worked.

Accomplishments that we're proud of

A real, verifiable agent: the AI insight is generated by an agent that queries live data through 8 distinct tools, not a single pre-built prompt — and it's grounded enough that it explicitly reports when a difference in the data is small rather than overstating it. A dashboard that doesn't look like a generic template — cinema-dark theme, marquee-inspired type, and an honest "last updated" + refresh affordance instead of an overstated "live" claim. Fully deployed, fully working, end-to-end: ClickHouse → FastAPI → React → Gemini agent, all live and talking to each other in production, not just running locally.

What we learned

That building something "agentic" is a real architectural choice, not a prompt-engineering trick — giving the model real tools and letting it decide what to investigate produces meaningfully different (and more trustworthy) output than pre-computing everything and asking it to narrate the result.

What's next for StudioPulse

Expand the agent's toolset to support comparative queries across time windows (e.g. week-over-week shifts), not just current-state snapshots. Move off free-tier hosting to remove cold-start delays and the daily Gemini quota ceiling. Add historical trend tracking so the agent can eventually flag changes in audience behavior, not just current patterns.

Built With

Share this project:

Updates

Submission history