Inspiration
Movie audiences often have strong opinions about which characters, conflicts, tones, and endings they want to see. The challenge is turning those scattered preferences into something a creator can actually use without creating contradictions, plot holes, or broken continuity.
Viewer’s Cut explores a workflow where audiences help shape the story, while creators keep final approval and AI handles the difficult synthesis between audience signal, screenplay generation, and continuity checking.
What it does
Viewer’s Cut lets viewers enter fictional film worlds and make guided story choices such as character direction, tone, conflict, relationships, turning points, and endings.
Those choices are validated and aggregated server-side so Gemini only sees trusted audience signal.
The workflow then:
collects and validates audience choices, aggregates trusted vote results, uses Gemini to interpret the strongest audience preferences, handles low-signal cases deterministically instead of inventing audience demand, sends the proposed direction to a creator approval gate, generates an opening screenplay scene only after approval, runs a continuity and story-logic review, classifies findings as confirmed issues, risks, or continuity watchpoints.
Viewer’s Cut also includes a production intelligence agent built with Google ADK that connects to ClickHouse through the official mcp-clickhouse server. The agent queries production and audience analytics at runtime, checks creator state and continuity watchpoints, and returns a grounded next production action.
How we built it
Viewer’s Cut is a full-stack Next.js application built with TypeScript and server-side route handlers.
The audience workflow uses Firestore for trusted vote persistence, including anonymous session-based duplicate prevention and server-controlled aggregate counts.
Gemini is used for:
audience analysis, creator-facing narrative recommendations, opening screenplay generation, continuity and story-logic analysis.
Model output is validated with strict Zod schemas before reaching the UI.
The production intelligence layer uses:
Google ADK, Gemini on Google Cloud, the official mcp-clickhouse MCP server, ClickHouse Cloud.
The ADK agent is intentionally restricted to a read-only ClickHouse query against viewer_cut_events. It must successfully retrieve evidence for the requested movie before it is allowed to make a production recommendation.
This creates a deterministic runtime chain:
Gemini agent → MCP tool call → ClickHouse Cloud → grounded production recommendation
The project also includes automated tests, linting, TypeScript validation, and production build checks.
Challenges we ran into
One of the biggest challenges was separating deterministic system behavior from AI interpretation.
Audience data cannot simply be handed to a model and treated as truth. Duplicate submissions, low participation, and weak signals all needed deterministic handling before Gemini could interpret the results.
Another challenge was continuity analysis. A mystery or unexplained story element should not automatically be labeled a plot hole. The continuity system therefore distinguishes between:
confirmed issues, potential risks, continuity watchpoints that future scenes must preserve.
Integrating Google ADK with the official ClickHouse MCP server also introduced dependency and runtime challenges. The ADK client and MCP server required separate Python environments because of incompatible MCP SDK major versions, so the final integration launches the ClickHouse MCP server as a dedicated stdio process.
Accomplishments that we're proud of
We built the complete creative loop instead of stopping at a prompt demo.
Viewer’s Cut can now move from:
audience choices → trusted aggregation → Gemini analysis → creator approval → screenplay scene → continuity review
We are also proud of the trust boundaries in the system:
Gemini never receives raw anonymous session IDs, low-signal audience results do not become invented recommendations, screenplay generation requires creator approval, continuity findings are structured and validated, the ClickHouse production agent cannot recommend a next step unless a real filtered query succeeds first.
The live production intelligence agent successfully queries ClickHouse through mcp-clickhouse and returns a recommendation grounded in stored audience signals, creator approval state, and continuity watchpoints.
What we learned
This project changed how we think about agentic systems.
The difficult part is not simply calling an LLM. The real work is deciding which steps should be deterministic, which should be AI-driven, where data should be trusted, and where humans must remain in control.
We learned that strong agentic workflows need clear boundaries between:
persistence, validation, AI interpretation, tool use, human approval, and downstream actions.
We also learned that continuity is not just about props or costumes. It includes chronology, character knowledge, world rules, motivations, unresolved setup, and whether later scenes remain consistent with earlier decisions.
What's next for Viewer’s Cut
Next steps include:
persisting creator review, generated scene, and continuity state beyond the current prototype runtime, expanding ClickHouse analytics from seeded production events to richer live workflow telemetry, adding stronger production authentication and integrity controls, expanding the agent workflow to support longer story arcs, improving creator-facing revision tools, and supporting larger collaborative production teams.
The long-term goal is to turn Viewer’s Cut into a production workflow where audience insight can influence development without sacrificing creator control or narrative coherence.
Built With
- clickhouse
- firestore
- gemini
- google-adk
- google-cloud
- mcp
- mcp-clickhouse
- next.js
- python
- react
- tailwind
- typescript
- vercel
- vertex-ai
- zod

Log in or sign up for Devpost to join the conversation.