Inspiration
With Avengers: Doomsday coming in December 2026, I decided to revisit the MCU from the beginning to experience the universe with as much context as possible. What stood out to me wasn't just the twists and superhero action. It was how much had to remain consistent across an enormous number of stories.
That made me think about the opposite problem: what happens when writers establish something in one scene and accidentally contradict it later?
As stories and fictional universes grow, keeping track of characters, objects, relationships, events, and rules becomes increasingly difficult. AI agents can act as co-authors and continuity analysts, maintaining a persistent understanding of what has already been established.
That idea became SceneStory.
What it does
- SceneStory turns a screenplay into structured, persistent story memory
- It extracts characters, objects, locations, events, claims, relationships, and world rules.
- A Continuity Guardian analyzes story state chronologically to detect contradictions and unexplained transitions, both within a story and across stories in the same universe
- An Audience Companion lets readers ask questions while reading, with answers constrained to scenes they have already reached
- Every answer/finding can point back to the screenplay evidence that supports it
- The same underlying story memory powers both creator-side continuity checking and audience-side understanding
How we built it
- Built with Gemini and Google Cloud's agent platform, using specialized agents for story analysis, continuity reasoning, and audience assistance.
- Screenplays are ingested into structured story memory rather than being treated as one giant prompt
- Universe and entities with the universe exist outside the story unit boundary, so that story units are consequences of entity interactions, not the cause of entity existence.
- Claims and events are stored chronologically, with provenance back to screenplay screens and lines
- ClickHouse acts as the analytical memory layer for querying story state and detecting candidate inconsistencies
- The Continuity Guardian receives structured evidence and reasons over state transitions rather than blindly comparing isolated pieces of text.
- The Audience Companion builds a scene-bounded context so future scenes are never included when answering the reader
- The application runs as a web app with creator and reader experiences built around the same story memory
Challenges we ran into
- Gemini Extraction Latency:
- Defining what counts as a contradiction: there are intentionally unexplained state changes in stories which are not necessarily errors in continuity
- Giving agents enough context without flooding them with the entire screenplay: this was solved with structured claims, events, chronological state and targeted context
- Temporal reasoning: the system needs to understand what a claim can be true in one scene and no longer be true later
- Making the agents actually agentic: We had to decide which work would be deterministic db logic from clickhouse, and which would be delegated to Gemini's reasoning capabilities
Accomplishments that we're proud of
- Built a working pipeline that transforms a screenplay into structured story memory.
- Built a Continuity Guardian capable of finding suspicious state transitions and explaining them from screenplay evidence.
- Built a spoiler-aware Audience Companion that can answer questions differently depending on the reader's current scene.
- Designed a single underlying memory system that serves both filmmakers and audiences, rather than building two disconnected products.
- Made uncertainty a first-class concept: SceneStory can say “this is a contradiction,” “this is ambiguous,” or “this is a normal transition.”
- Built the system so evidence can be traced back to the exact screenplay material that established a fact.
- Most importantly, we built around a real problem in long-form storytelling: as stories grow, remembering what has already been established becomes a systems problem.
What we learned
- LLMs are much more useful when they reason over structured memory instead of repeatedly reading raw documents.
- Continuity isn't simply comparing two sentences. It requires understanding state, time, causality, evidence, and world rules.
- Deterministic systems and agents complement each other: databases can efficiently find suspicious candidates, while Gemini can reason about whether those candidates actually represent contradictions.
- Uncertainty is important. A good story assistant shouldn't confidently invent an explanation just because the screenplay doesn't provide one.
- Spoiler prevention is fundamentally a context isolation problem, not just a prompting problem.
- The same story representation can support very different experiences: production analysis for creators and knowledge retrieval for audiences.
What's next for Scene Story
Built With
- clickhouse
- clickhouse-mcp
- cloud-run
- express.js
- gemini
- google-cloud
- google-genai
- next.js
- typescript
Log in or sign up for Devpost to join the conversation.