🎬 CINECAST: AI-Powered Screenplay Compliance
💡 Inspiration
Film classification standards and local censorship laws vary significantly across international borders. A screenplay that easily secures a PG-13 rating in the United States might face heavy censorship, mandatory theatrical cuts, or even outright bans in countries such as India, Germany, or the United Kingdom.
Historically, film studios and independent producers have had to navigate this complex regulatory landscape by hiring expensive international regulatory consultants, manually searching through static and outdated PDF guidelines, and guessing which scenes might trigger compliance issues.
This manual auditing process can take weeks, cost thousands of dollars, and is highly prone to human error—often resulting in unexpected post-production delays or lost box-office revenue.
We asked ourselves:
What if filmmakers could instantly audit their screenplays during the draft phase?
What if an autonomous, real-time AI agent could analyze a script, launch parallel web searches to research the latest regulatory guidelines and precedents across international film boards, and predict territory-specific ratings and potential required cuts—all before a single camera starts rolling?
Thus, Cinecast was born.
🔍 What It Does
Cinecast is an advanced, enterprise-grade screenplay compliance and international rating prediction platform. Built natively using Google's Agent Development Kit (ADK) and grounded through the Parallel Web Search & Extract APIs, Cinecast automates the complex compliance pipeline.
1. Smart Multi-Format Ingestion
Cinecast seamlessly ingests:
- Industry-standard
.pdfscreenplays - Draft
.docxand.txtfiles - Screenplays fetched directly from web databases via URL
2. Gemini-Powered Screenplay Distillation
A specialized factual pre-analysis scan processes large screenplay documents and maps every rating-relevant scene, including:
- Violence
- Strong language
- Sexual content
- Nudity
- Drug use
- Thematic content
This produces a dense, token-efficient semantic representation of the screenplay.
3. ADK-Native AI Reasoning Agent
Cinecast employs an autonomous reasoning loop built with Google's ADK and powered by gemini-3.5-flash through Vertex AI.
4. Parallel Web Grounding
Custom-built tools allow the agent to perform real-time research across global film classification boards:
search_rating_guidelinessearch_precedentsextract_source
This enables Cinecast to research sources such as the MPA, BBFC, and CBFC.
5. Structured Compliance Reporting
Cinecast generates validated, structured compliance reports conforming to strict Pydantic schemas.
Each report provides:
- Predicted age ratings per country
- A mathematically grounded confidence score $C \in [0,1]$
- Specific required cuts
- Scene numbers or timestamps
- Descriptions of potentially offensive content
- Citations to the relevant board guidelines
6. Real-Time SSE Live Console
Every step of the agent's workflow—including research queries, analysis stages, and web crawls—is streamed to the frontend through Server-Sent Events (SSE).
🛠️ How We Built It
Cinecast was engineered using a modern, modular, and secure architecture.
1. Core AI Agentic Layer
We use Google's next-generation Agent Development Kit (ADK) as the central orchestration framework.
For production-grade security, enterprise scalability, and compliance, we subclassed the ADK's Gemini runner as VertexAIGemini.
This custom model class overrides the api_client property to instantiate a google.genai.Client configured with Vertex AI and Application Default Credentials (ADC), eliminating the need to manage or expose raw API keys.
Client_VertexAI(
Enterprise=True,
Location="global"
)
2. Live Regulatory Grounding — Parallel APIs
We built a robust ParallelClient in Python to connect Cinecast to the Parallel Web Search & Extract APIs.
The client handles:
- Authentication
- Request timeouts
- Exponential-backoff retries
- Error handling
- Normalization of unstructured HTML results
- Search-optimized source extraction
3. Intelligent Guideline Caching
To improve performance, reduce API costs, and remain within strict rate limits, Cinecast implements a disk-based JSON caching layer in:
agent/cached_guidelines/
When the agent requests guidelines for a territory, the system performs a cache lookup:
$$ Cache(Territory) = \begin{cases} \text{Read Local Cache}, & \text{if file exists} \ \text{Live Parallel Search + Cache on Disk}, & \text{otherwise} \end{cases} $$
4. Backend & SSE Streaming API
The backend is powered by a Flask API running on Python 3.11.
The /api/analyze endpoint:
- Accepts screenplay content and target territories.
- Launches the ADK agent asynchronously.
- Uses Python generators to stream real-time logs.
- Sends updates to the frontend through
text/event-stream.
5. Frontend Dashboard
The frontend is built using:
- React 18
- Tailwind CSS
- Server-Sent Events
The responsive dashboard provides:
- Intuitive screenplay uploader
- Territory selector
- Terminal-style Live Console
- Streamed agent activity
- Rating cards
- Compliance metrics
- Interactive required-cut analysis
🚧 Challenges We Ran Into
1. Screenplay Context Bloat & Latency
Full-length screenplays can exceed 25,000 words. Running a multi-step agent search-and-reason loop directly over the raw screenplay creates:
- Rapid context bloat
- High token consumption
- Increased API costs
- Long execution times
Our Solution
We developed a two-stage processing pipeline.
Stage 1 — Semantic Content Scanner
A specialized, low-temperature scanner ($T = 0.1$) powered by gemini-3.5-flash extracts a structured representation of rating-relevant points of interest, including:
- Flagged scenes
- Expletive counts
- Thematic weight
- Other potentially relevant content
Stage 2 — ADK Reasoning Agent
Instead of feeding the entire screenplay to the reasoning agent, we provide only the dense, structured factual map.
This reduces context-token usage by up to 85% while significantly speeding up the agent's reasoning loops.
2. ADK & Vertex AI Client Authentication
Integrating the newly released ADK with enterprise Vertex AI required precise configuration to enforce Application Default Credentials (ADC) rather than public API keys.
Our Solution
We designed a clean wrapper class that overrides the ADK's native Gemini client initialization.
This provides a secure, zero-trust cloud configuration suitable for enterprise deployments while avoiding direct exposure of API credentials.
🏆 Accomplishments We're Proud Of
🎬 Real-World Validation: The Oppenheimer Case Study
To evaluate Cinecast against a real-world film, we ran Christopher Nolan's Oppenheimer through the Cinecast pipeline.
The predictions generated by our ADK agent closely aligned with the film's actual classification and distribution decisions.
🇺🇸 United States — MPA Prediction
Predicted Rating: R
Confidence: $C = 0.95$
Identified Triggers:
- Strong language
- Nudity
- Sexual content
Potential Required Cuts for PG-13:
Jean Tatlock Hotel Room Scene Digitally cover or crop full-frontal nudity, such as through CGI clothing.
Security Hearing Sex Scene Heavily edit or remove the surreal imaginary sex sequence to reduce explicit sexual activity.
Language Reduce the frequency of strong expletives and their derivatives.
🇬🇧 United Kingdom — BBFC Prediction
Predicted Rating: 15
Confidence: $C = 0.95$
Identified Triggers:
- Nudity in a sexual context
- Frequent strong language
Potential Required Changes for 12A:
- Edit the imaginary sex scene to portray sexual activity more discreetly.
- Reduce the frequency of strong expletives.
Why This Matters
Cinecast's predictions showed strong alignment with the real-world classification decisions and distribution changes made for Oppenheimer.
A notable example is the use of digital visual modification in certain international territories, demonstrating how screenplay-level compliance analysis can anticipate practical distribution requirements.
🧠 What We Learned
Agentic Workflows > Traditional RAG
Simple Retrieval-Augmented Generation (RAG) is insufficient for complex cross-border compliance.
A vector database containing local regulatory documents cannot dynamically determine which rules apply to a specific screenplay scene while accounting for changing regional precedents.
An autonomous agent can instead:
- Identify relevant compliance issues.
- Decide which territories require investigation.
- Search current regulatory sources.
- Extract detailed rules and precedents.
- Compare evidence against individual screenplay scenes.
- Weigh the evidence before producing a structured result.
This makes agentic workflows significantly better suited to dynamic, cross-border compliance research.
Structured Schemas Boost Reliability
We found that enforcing strict, nested Pydantic schemas dramatically improves output reliability.
Using Gemini's native schema-conformance capabilities helps:
- Reduce hallucinations
- Maintain consistent output structures
- Produce stable API responses
- Make results easier to consume programmatically
🚀 What's Next for Cinecast
1. Interactive AI Rewrite Suggestions
Move beyond identifying required cuts by allowing Cinecast to suggest compliant alternatives.
For example:
- Rewrite dialogue to reduce strong language.
- Suggest less explicit scene descriptions.
- Offer PG-13-friendly alternatives.
- Apply approved changes with a single click.
2. Streaming-Platform-Specific Rules
Expand Cinecast's Parallel Search capabilities to research maturity-rating and content-classification criteria used by major streaming platforms, including:
- Netflix
- Amazon Prime Video
- Disney+
3. Collaborative PDF Exports
Introduce fully styled, executive-ready PDF reports that legal, production, and distribution teams can export and share across studio workflows.
🎬 Cinecast
Analyze earlier. Predict smarter. Distribute globally.
Log in or sign up for Devpost to join the conversation.