ScriptClear AI
Agentic script clearance. Legal starts from evidence, not a blank page.
🎬 Demo video: https://www.youtube.com/watch?v=NJiw-BpOpNI 🔗 Live demo: https://agentic-cinema-web-qtltf5pl4q-ts.a.run.app/ 📂 Repo: https://github.com/AntonyJomy/agentic-cinema
Built end to end on Google: ADK and Gemini for the agents, Antigravity to build them, Stitch for the interface, Flow for the demo film, Cloud Run, Parallel and Firestore to ship it.
Sign in, upload a screenplay (or a bundled sample), and run a clearance. You can read every finding. Export stays locked until high-risk items are explicitly resolved, which is the point. Ask us if you need a reviewer account.
Inspiration
No film or TV show reaches distribution without Errors & Omissions insurance, and no insurer signs off without script clearance. Someone has to read the screenplay line by line and hunt for legal exposure: a character name that matches a real person, a diner that turns out to be a trademarked chain, four bars of a song still under copyright, a license plate that belongs to somebody.
Every hit has to be researched, documented with citations, and signed off by Legal. Studios send this out to clearance houses, pay thousands of dollars, and wait weeks.
Sitting inside that process is a layer that is pure research. Look up the business. Check whether the name belongs to a real person. Find the trademark record. Cite it. That layer is slow, expensive, and mechanical. It is also not where legal judgment actually lives.
So we split the job in two. Agents do the looking up. Humans make the call.
What it does
ScriptClear AI runs the first pass of clearance and hands Legal a cited, evidence-backed risk assessment. It never approves anything on its own.
1. Extraction. Parses a screenplay (PDF or plain text) and pulls entities across nine categories: businesses, character names, trademarks/brands, songs, public figures, addresses, phone numbers, license plates, and literary references.
2. Grounding. A deterministic check that each entity actually appears in the script, so the pipeline does not research names the model invented.
3. Specialist research. Six domain agents research the real world concurrently through Parallel Search MCP, not from model memory:
- Business: is this a real, active business?
- Character name: does a real person share this name?
- Music: is this an identifiable musical work?
- Trademark/brand: what is the mark, and does use look like it needs a license?
- Address: is this a real, identifiable location?
- Literary reference: is this a published work still under rights?
Phone numbers, license plates, and public figures are flagged at extraction and not researched yet.
4. Risk scoring. An LLM applies a written rubric (clear / caution / high_risk) and must name the rule that fired. Research confidence is not the risk score.
5. Executive summary. Priority items first, with clearance statistics across the script.
6. Human review. Approve and block are recorded on the server. The AI presents evidence; a person resolves it.
7. Gatekeeper. Export stays locked until every high-risk item that requires an explicit decision has been resolved. Nothing high-risk gets through by default.
8. Report. An audit-ready PDF with a SHA-256 digest, so the file a reviewer holds can be proven to match the one that was signed off.
The design principle throughout: this is research with a lock on the door, not automated approval.
Try it yourself
- Open the live demo.
- Upload a screenplay, or load one of the bundled sample scripts.
- Watch the pipeline run with live progress.
- Open any finding to see its evidence, citations, and the rule that produced its score.
- Try to export the report with a high-risk item unresolved. The gatekeeper won't let you.
Step 5 is the one worth doing. It's the fastest way to see what separates this from a summarizer.
If you'd rather watch than run it, the demo video walks through the same path end to end.
How we built it
Multi-agent orchestration with Google ADK. Each specialist is a separate agent with a domain-specific prompt and a Pydantic output schema, so results come back as validated structures instead of prose we have to parse. Specialists run concurrently under asyncio.
Agent-first development in Google Antigravity. We built the ADK pipeline inside Antigravity, working at the level of tasks rather than files. That mattered most in the parts of this system that are wide rather than deep: six specialists sharing a schema contract, a change to the risk rubric rippling through scoring and reporting, an error path that had to be corrected in three modules at once. Delegating the mechanical edits let us spend our attention on the judgment calls, which is the same trade the product makes for legal reviewers.
Real sources via Parallel MCP. A fluent, confident, invented citation is worse than no answer at all. We routed research through Parallel's Model Context Protocol so agents query live web sources, and every finding carries a link a reviewer can open.
RAG cache on Firestore vector search. Scripts repeat entities constantly, and slates of productions repeat them more. We embed each researched entity with Gemini's embedding model and check semantic similarity before spending another research call. Near-duplicates can match above a 0.85 similarity threshold.
Interface designed with Google Stitch. Clearance output is dense: dozens of entities, each with evidence, sources, and a verdict. Stitch let us iterate on layouts fast enough to test several ways of presenting a finding before committing, and we landed on one that puts the evidence and the rule side by side, so a reviewer never has to take a score on faith.
Demo film made with Google Flow. We produced the walkthrough in Flow, using a filmmaking tool to demo a product that clears films. There is a real point in the coincidence. The same generative tooling that is about to make far more scripts, far faster, is what makes the clearance bottleneck urgent. Flow can produce the footage in an afternoon. Clearing it still takes weeks.
Stack
- AI/ML: Gemini Flash, Gemini embedding model, Google ADK
- Development: Google Antigravity
- Design & media: Google Stitch (UI), Google Flow (demo film)
- Research: Parallel Search MCP
- Data: Firestore with native vector indexing, Google Cloud Storage
- Auth: Firebase Authentication
- Backend: Python, FastAPI, Uvicorn
- Frontend: React, Vite, CSS, GSAP, Lenis
- Infra: Docker, Cloud Run, Secret Manager
Challenges we ran into
Firestore's 2048-dimension ceiling
Gemini's embedding model returns 3072-dim vectors by default. Firestore vector fields cap at 2048, so every write failed with InvalidArgument: 400 Vectors must be at most 2048 dimensions.
We used output_dimensionality to request 1536-dim embeddings. The model is trained with Matryoshka Representation Learning, so the leading dimensions carry the most signal and reduced output degrades more gracefully than naive truncation. The catch: only the full 3072-dim output ships pre-normalized, so we added explicit L2 normalization for the reduced vectors, then wrote a migration script to clear and rebuild the collection at the new dimensionality.
Failures that reported success
Our worst bug wasn't a crash. Exceptions during vector upsert were caught, logged at warning level, and the entity still came back SUCCESS. The pipeline looked healthy while the RAG index quietly rotted.
We reworked the error paths so dimension errors surface explicitly in vector_store.py, made retrieval.py raise on critical failures instead of logging past them, and taught orchestrator.py to degrade honestly, so a RAG failure now reports itself without taking down the run. The lesson stuck: in a system whose whole value proposition is trustworthy output, a silent failure is a correctness bug, not a logging preference.
Orchestrating agents against a rate-limited model
Parallel specialists plus transient Gemini 503s under load meant runs would die partway through with inconsistent session state. We added retry with exponential backoff for transient errors, asyncio semaphores to bound concurrency below the rate limit, and session-level caching so a single clearance run never researches the same entity twice.
A gate that has to hold up in an audit
Human-in-the-loop is only real if the boundary is enforced somewhere an end user cannot reach. We put export behind a deterministic gatekeeper: high-risk items need an explicit human decision, decisions are stored on the server, and the PDF is hashed at sign-off. Backend data access uses IAM service-account permissions. Firebase Auth identifies the caller. The gatekeeper is the single chokepoint for export, so "was this cleared, and on what evidence" is always answerable.
Accomplishments that we're proud of
A pipeline that actually runs end to end. Upload a screenplay, get a tamper-evident report. Not a demo path with the hard parts stubbed out.
Citations instead of confidence. Findings come from live sources through Parallel MCP. A reviewer can click through and check our work, which is the only standard that matters in this domain.
Explainability by construction. Risk verdicts come from a written rubric the scoring agent must apply and name, not an unlabeled confidence score standing in for an argument.
A refusal that holds. The gatekeeper blocks export on unresolved high-risk items. The easiest way to build this product would have been to let the AI approve things. We deliberately made that impossible.
Semantic caching that works. Firestore native vector search at 1536 dimensions, with migration tooling for when the dimensionality changes again.
Deployable infrastructure. Dockerized backend, Cloud Build deploy, Secret Manager, and documentation someone else could follow.
What we learned
On agent design. ADK made multi-agent orchestration far less painful than expected, and Pydantic schemas eliminated an entire category of JSON-parsing bugs. The harder lesson was that parallelism is easy and failure under parallelism is not. Most of our engineering went into what happens when one of several concurrent agents falls over.
On building with agents. Antigravity changed where our time went, not how much of it there was. Scaffolding a specialist stopped being the expensive part. Deciding what the rubric should say, and what counts as enough evidence for a verdict, became the whole job. We ended up building a product shaped like the workflow we were living in: machines do the legwork, humans own the judgment.
On vector search. The 2048-dim limit is a hard architectural constraint, not a tuning parameter, and it's better discovered on day one than day six. Matryoshka embeddings make reduced dimensionality viable, but only if you handle normalization yourself.
On MCP. Giving agents a real research channel changes what they're for. The interesting cost question isn't tokens, it's research depth per entity: how many sources are enough to justify a verdict.
On legal tech. Human-in-the-loop isn't a compliance checkbox bolted onto an AI product. On this problem it is the product. Explainability and audit trails outrank raw accuracy, because an unverifiable correct answer and an unverifiable wrong answer look identical to a reviewer. Faster only counts if the output can be checked.
What's next for ScriptClear AI
Coverage. Six of nine entity types have live specialists. Next: phone numbers, license plates, and public figures. After that, non-US jurisdictions, and direct integration with USPTO and EUIPO rather than searching around them.
Depth. Bulk processing across a slate, analytics on clearance patterns between productions, suggested "greeking" alternatives when an entity is blocked, and revision tracking so a script change triggers re-clearance only where it needs to.
Enterprise. Multi-tenancy for clearance houses, per-studio custom rule engines, SSO, and an on-premise option for productions that can't send scripts to a third party.
Workflow. Collaboration for multiple reviewers, notifications on clearance status, and tighter role gating so only a designated legal reviewer can record approve/block.
Business model. Freemium at a small number of clearance runs per month, Pro for unlimited runs with priority processing, Enterprise for custom rules, dedicated support, and on-premise deployment.
Get started
🎬 Demo video: https://www.youtube.com/watch?v=NJiw-BpOpNI 🔗 Live demo: https://agentic-cinema-web-qtltf5pl4q-ts.a.run.app/ 📂 GitHub: https://github.com/AntonyJomy/agentic-cinema
Built with Google ADK, Gemini, Antigravity, Stitch, Flow, and Google Cloud, with research through Parallel Search MCP.
Script clearance shouldn't cost weeks and guesswork. ScriptClear AI gives Legal a head start, with the receipts to back it up and a door that stays locked until a human opens it.
Built With
- ai-agents
- cloud-run
- docker
- explainable-ai
- fastapi
- film-production
- firebase
- firestore
- gemini-flash
- google-adk
- google-cloud
- google-gemini
- human-in-the-loop
- legal-tech
- multi-agent-system
- parallel-mcp
- pydantic
- python
- rag
- react
- script-clearance
- tailwindcss
- typescript
- vector-search
Log in or sign up for Devpost to join the conversation.