Inspiration
Every year, film studios spend millions of dollars on costly reshoots, pickups, and post-production VFX patches because of subtle physical, temporal, or geographic impossibilities embedded deep in their scripts. A character witnesses a blinding golden sunrise over the ocean at 05:45 AM in Mumbai when the sun doesn't rise until 06:12 AM; an action hero dashes from downtown Colaba to the international airport in 12 minutes during morning peak hour; a tide surge washes over a harbor hours before oceanic high tide.
When these discrepancies slip past script readers and script supervisors into principal photography, fixing them on set is catastrophic. Current script coverage is done manually: overworked script readers annotate scripts with highlighters and gut feelings, while typical generative AI tools simply hallucinate plausible-sounding affirmations rather than checking hard physical constraints.
What it does
REALITYLOCK is an autonomous, agentic screenplay intelligence platform that parses dramatic screenplays, extracts every physical, temporal, geographic, and environmental claim, and deterministically validates whether those conditions could actually coexist in the real world.
Key Capabilities: Multimodal Narrative Extraction: Parses screenplays (scene headings, character actions, dialogue cues, vehicle movements, weather descriptions) into structured, testable physical constraints. Live Runtime Fact-Grounding via Parallel Search API: Actively calls the parallel-web SDK at runtime to retrieve authoritative real-world ephemeris (NOAA & IMD astronomical data), municipal transit corridor telemetry (Mumbai Traffic Police & HERE Maps), and maritime tidal registers (INCOIS). Deterministic Reality Engine: Rather than letting an LLM hallucinate a "plausibility score", REALITYLOCK runs deterministic kinematic equations (
d
v ⋅ t d=v⋅t), travel gap analyses (
Gap
T required − T available Gap=T required −T available ), and ephemeris differentials to calculate a mathematical Reality Score (0–100%). Interactive Contradiction Dossier: Flagged contradictions explain WHY the physical conflict exists, what is proven fact vs. unstated narrative assumption, and the real-world consequence on production. Story-Preserving Simulation & Change Sets: Formulates multi-choice, creative alternatives (e.g., shifting scene call times by 29 minutes or swapping travel corridors) that preserve the emotional beats of the story while boosting the script's Reality Score. Writers and showrunners can review, toggle, and approve these changes in an atomic Change Set. Complete Audit Provenance Ledger: Every verified claim is cited with source URLs, retrieval timestamps, snippet evidence, and confidence rankings.
How we built it
REALITYLOCK is engineered with a modular, multi-agent architecture dividing narrative intuition from deterministic physical truth:
[ Screenplay Input ] │ ▼
- Story Parser (Gemini 2.0 GenAI SDK) │ ▼
- Constraint Compiler (Translates narrative into formal physical rules) │ ▼
- Research Agent (Official parallel-web Python SDK runtime queries) │ ▼
- Evidence Agent (Provenance verification & source confidence scoring) │ ▼
- Deterministic Reality Engine (Kinematic, transit, & solar ephemeris math) │ ▼
- Contradiction Classifier (Severity grading: Critical / Warning / Verified) │ ▼
- Simulation Agent (Story-preserving alternative generation with score deltas) │ ▼
- Report Agent (Interactive Reality Dossier & Change Set generation) │ ▼ [ React 19 + Tailwind Enterprise Web Studio ] Technical Stack: Core AI & Narrative Processing: Google Cloud GenAI (google-genai SDK / Gemini 2.0 Flash) for structured entity extraction and creative resolution synthesis. Authoritative Real-Time Search: Official parallel-web Python SDK executing runtime queries against authoritative registries and municipal databases. Deterministic Math Engine: Pure Python kinematic matrix solver calculating spatial transit feasibility, celestial azimuths, and penalty-weighted scoring functions. Backend API: FastAPI with async ASGI endpoints, Pydantic schemas, and structured logging. Frontend & Visualization: React 19, Vite, Tailwind CSS, Radix UI primitives, Recharts for telemetry curves, and Lucide icons. Data Persistence: Relational schema tracking projects, scene nodes, extracted constraints, evidence citations, and approved change-sets. ## Challenges we ran into Separating Poetic License from Physical Impossibility: Screenplays rely heavily on figurative language ("the city explodes into light"). Prompt engineering alone caused false positives. We solved this by creating a two-pass Constraint Compiler that extracts only testable anchor assertions (dates, locations, transit legs, environmental conditions) while ignoring stylistic metaphor. Preventing LLM "Hallucinated Validation": LLMs are eager to agree that a 12-minute commute during peak rush hour across 28.4 km of dense urban highways sounds "thrilling and possible." We solved this by enforcing a strict separation of concerns: LLMs extract the claims and suggest story pivots, but the Deterministic Reality Engine alone calculates travel gaps and point penalties mathematically. Low-Latency Runtime Search: Synchronizing multi-hop agent queries during interactive script reviews required tight query design. Using the Parallel Search API allowed us to retrieve structured search evidence in under 500ms with verified source provenance. ## Accomplishments that we're proud of True Runtime Integration with Parallel Search: Rather than relying on static mock databases, the Research Agent dispatches real live queries via parallel-web to verify sunrise times, municipal traffic corridors, and geographic coordinates at runtime. Deterministic Reality Scoring Formula: Built a transparent, explainable scoring engine where every deduction is traceable back to verified mathematical facts (e.g., -4.5 pts per physical contradiction, -1.5 pts per unverified warning). The Screenplay Change Set Workflow: Inspired by Git pull requests, our change-set engine lets writers click "Apply Resolution", instantly updating the screenplay text, recalculating the script's Reality Score from 82 to 94 in real time, and maintaining a versioned audit trail. Production-Grade Design: Created a sleek, distraction-free enterprise UI with interactive timeline pulses, side-by-side script viewers, and evidence inspection drawers. ## What we learned Hollywood Pre-Production is Thirsty for Rigor: Creative writers do not want their imagination restricted; they want to avoid avoidable production blunders that turn into costly re-shoots or audience ridicule on IMDb goofs. Agentic Orchestration Needs Deterministic Guardrails: High-value enterprise AI cannot rely on pure prompt generation. Grounding an LLM's creativity in external search APIs (Parallel) and deterministic rule systems produces infinitely higher trust and reliability. Provenance is Everything: Film producers will only change a script if you can cite the exact authority behind the objection (e.g., IMD Solar Ephemeris or Mumbai Traffic Police corridor data). ## What's next for REALITYLOCK - AI Reality Engine for Screenplays Direct Final Draft (.fdx) & Fountain Bi-Directional Sync: Adding a native plugin for Final Draft and Highland so screenwriters get real-time reality linting directly in their favorite screenplay editors. Multi-Era Historical Ephemeris: Expanding the reality engine to support historical period dramas (e.g., verifying weather, lunar illumination, and horse-and-carriage travel times in 1880s Victorian London or 1940s Normandy). VFX & Production Budget Impact Estimator: Calculating the actual dollar savings when a contradiction is resolved in pre-production versus on the soundstage. Autonomous Location Scouting Matcher: Connecting verified script locations with real-world permit databases and film commission tax incentive catalogs.
Built With
- autonomous-agents
- deterministic-engine
- fastapi
- gemini-2.0
- google-cloud
- javascript
- kinematics
- lucide-react
- multi-agent-systems
- parallel-api
- parallel-web
- prompt-engineering
- pydantic
- python
- radix-ui
- react
- recharts
- rest-api
- sql
- tailwindcss
- uvicorn
- vite
Log in or sign up for Devpost to join the conversation.