The Story of Greenlight

💡 Inspiration

In the film industry, greenlighting a movie—deciding whether to fund and release a multi-million dollar project—is traditionally a slow, friction-heavy process. Creative executives often rely on generic market reports or gut feelings because querying historical baseline data requires waiting days for specialized data teams to write custom pipeline scripts.

I built Greenlight to destroy this bottleneck. Greenlight is an intelligent, conversation-driven studio analytics copilot that empowers producers and executives to speak plain English (e.g., "Should we greenlight a \$35M psychological thriller for a Q4 APAC release?") and receive immediate, data-grounded, analytical financial recommendations back in real-time.

⚙️ How We Built It

Greenlight is built with a highly decoupled, modern multi-agent infrastructure designed for low-latency operational throughput:

  • Orchestration Layer: Built natively using the Google Agent Development Kit (ADK 2.8.0) running the advanced Gemini 2.5 Pro model engine.
  • Multi-Agent Collaboration: I implemented a parent-child delegation framework. The master coordinator agent handles conversational reporting, automatically delegating data mining tasks to an isolated, backend database sub-agent running in single_turn mode.
  • The ClickHouse Bridge: The data sub-agent connects over a secure TLS handshake to a live ClickHouse Cloud instance via an official FastMCP Server pipeline. It dynamically inspects schema constraints, calculates budget bands with a 30-40% variance, and executes highly optimized SELECT queries across the films and regional_performance datasets.
  • Data Seed: The operational baseline is seeded with thousands of real-world cinematic history records from TMDb, which I synthesized with plausible regional box office splits and localized marketing spends.
  • Presentation Layer: Analytical vectors are processed dynamically using Plotly to compile clean, dark-themed comparative performance graphs, instantly outputted to the executive interface.

📐 Financial Feasibility Modeling

When analyzing comparable films, the agent automatically evaluates the dynamic threshold of profitability by calculating a required Return on Investment ((ROI)) factor alongside a basic marketing scaling coefficient ((k)). To justify a greenlight verdict, the anticipated global box office revenue ((R_{global})) must satisfy the standard threshold equation relative to the input budget ((B)) and regional marketing spend ((M_{regional})):

$$ R_{global} \ge (B \times ROI) + (M_{regional} \times k) $$

For in-line metric sanity checks, the agent looks for adjacent segment historical data where the budget variance constraint is securely modeled within a delta boundary:

$$ B_{min} = B \times (1 - \Delta) \quad \text{and} \quad B_{max} = B \times (1 + \Delta) $$

Where ( \Delta = 0.40 ) representing a maximum 40% margin of historical envelope allowance.

🚧 Challenges We Faced

Building a cutting-edge, cross-platform agent system on a fast-moving framework right up to the submission wire brought several rigorous engineering challenges that I had to overcome solo:

  • API Protocol Gating & Multimodal Function Call Constraints: I initially attempted to pass raw Plotly image bytes directly through the model's standard function response payload. This instantly triggered a fatal 400 INVALID_ARGUMENT exception because Gemini's function schema strictly blocks multimodal objects inside tool payloads. I solved this by outputting highly portable, self-contained standalone HTML components to disk, returning flat string primitive paths back to clear the model gates seamlessly.
  • Production Container File-System Routing: Moving from a local environment (adk web) to stateless Google Cloud Run containers caused startup port-binding timeouts (PORT=8080). I discovered that the framework's internal session ledger attempts to mount a writeable state database (.adk/session.db) which deadlocks on write-protected serverless file systems. I resolved this by exposing my orchestrator as a clean, stateless entry point configuration served through a dedicated Uvicorn worker thread inside my Dockerfile.

🎓 What We Learned

This project completely shifted how I view the intersection of conversational AI and real-time analytical data. I learned how to cleanly structure multi-agent delegation frameworks to isolate code complexity and prevent prompt bloat. More importantly, I realized the sheer speed and scaling power of ClickHouse Cloud when handling multi-table analytical joins inside live LLM tool-calling loops.

🚀 Future Impact

Greenlight transitions studio operations away from slow guesswork into immediate, evidence-backed business intelligence. With Greenlight on the cloud, studio crews can instantly cross-examine performance metrics, iterate on seasonal budgets, and de-risk investments—ensuring the next great cinematic masterpiece is backed by hard numbers from Day 1.

Built With

  • adk
  • clickhouse-cloud
  • docker
  • fastapi
  • fastmcp
  • gemini-2.5-pro
  • google-cloud-run
  • mcp
  • plotly
  • python
  • tmbn-api
  • uvicorn
Share this project:

Updates

Submission history