🎬 CineFlow: Multi-Agent Production Crisis Director
The Inspiration
Imagine managing a ₹350 crore feature film production on location in Goa. At 6:00 AM, your lead actor calls in sick with a high fever. Monsoon storms are rolling in, and eight downstream scene schedules depend on today's shoot.
In traditional film production, this triggers a panicked, two-hour emergency producer meeting. Teams pore over outdated spreadsheets, make uncalculated guesses under extreme pressure, and execute a scene swap—only to realize late in the afternoon that the replacement location's permit expired yesterday.
A single uncoordinated decision like this costs ₹305,000+ per day in holding fees, wasted crew overhead, and equipment rentals.
Existing software tools are static; they store schedules, but they cannot think or reason through cascading real-world disruptions. We built CineFlow to give film producers an autonomous, AI-powered production crisis director that analyzes multi-variable production risks, runs cascade checks, and outputs financially optimized, executable decisions in seconds.
What It Does
CineFlow is an autonomous decision engine that handles production crises instantly by orchestrating specialized AI agents:
- Real-time Crisis Analysis: Classifies disruptions across cast, equipment, weather, permits, and location dependencies.
- Cascade Detection: Evaluates secondary conflicts (actor double-bookings, equipment availability, location clearance) before executing any schedule swap.
- Financial Impact & Pareto Optimization: Calculates exact financial deltas—weighing holding costs against setup fees—and presents non-dominated, Pareto-efficient alternatives.
- Executable Decision Outputs: Returns concrete actions (e.g., "Swap sc_001 with sc_003") with exact financial ROI, confidence metrics, and clear next steps.
- Automated Audit Logging: Persists complete execution traces for producer compliance and post-incident review.
How We Built It
CineFlow is designed as a custom multi-agent system built with Python 3.13, FastAPI, and Google Gemini 2.5-Flash. Its architecture operates on a 5-phase agentic loop:
1. Supervisor Agent (Master Orchestrator)
Parses arbitrary crisis prompts, loads production metadata, generates a 5-step task plan, and delegates tasks.
2. Schedule Worker
Reads production manifests (scenes.json, actors.json, equipment.json) to map current dependencies, location status, and crew assignments.
3. Strategy Worker
Evaluates crisis severity, estimates financial burn, and calculates alternative recovery scenarios.
4. External Info Worker
Integrates external real-world context (weather alerts, permit validity, infrastructure status).
5. Critic Worker
Validates plan feasibility by running multi-level Cascade Detection to prevent secondary conflicts.
Execution Flow
User Crisis Query
↓
[SUPERVISOR] PLANNING PHASE
└─ Creates 5-task execution plan
↓
[5 WORKERS] EXECUTION PHASE (Parallel)
├─ SCHEDULE_WORKER: Load scenes & dependencies
├─ STRATEGY_WORKER: Assess impact
├─ EXTERNAL_INFO_WORKER: Gather weather, permits, etc.
├─ STRATEGY_WORKER: Generate 3+ recovery options
└─ CRITIC_WORKER: Validate cascade effects
↓
[SUPERVISOR] REFLECTION & QUALITY CHECKS
└─ All worker results valid? → Proceed to synthesis
↓
[SUPERVISOR] SYNTHESIS PHASE
└─ Generate executive summary with financial analysis
↓
Executable Recommendation (with audit log)
Financial Optimization Model
Net Financial Benefit Calculation
We model the net financial benefit of a proposed mitigation action by calculating:
Net Financial Benefit = Cost of Shutdown - (Setup Cost + Holding Cost + Cascade Penalties)
Where:
- Cost of Shutdown = Baseline cost of shutting down production for the day
- Setup Cost = Friction cost of setting up the alternative scene
- Holding Cost = Daily holding rate for inactive cast and crew
- Cascade Penalties = Predicted secondary conflict penalties
Pareto Frontier Optimization
To balance competing goals, CineFlow calculates a Pareto Frontier across two objectives:
- Minimize Financial Burn (total cost)
- Minimize Schedule Risk (probability of further delays)
An option is considered non-dominated (Pareto-optimal) if no other option can:
- Cost less AND have lower risk at the same time
This ensures producers always see actionable alternatives that explicitly trade off cost versus risk, enabling data-driven decision-making under pressure.
Real Example: Lead Actor Crisis
Input Query: "Lead actor got sick"
Scene: sc_001 ("Monsoon Arrives at Arambol Beach")
Production: Monsoon Arc (₹350cr feature film)
Agent Analysis Output:
{
"crisis_type": "CAST",
"severity": "CRITICAL",
"financial_impact": {
"baseline_shutdown_cost": ₹900,000,
"daily_burn": ₹300,000,
"duration_days": 3.0
},
"recommended_action": {
"action": "SWAP",
"target_scene": "sc_003",
"confidence": "HIGH (87%)"
},
"cascade_check": "NO_CONFLICTS_DETECTED",
"next_steps": [
"Finalize actor swap contract",
"Issue replacement notice to crew",
"Confirm location/infrastructure ready",
"Update budget with ₹900k impact",
"Log decision for audit trail"
]
}
Time to Decision: 5-10 seconds (vs. 2+ hours in traditional workflow)
Challenges We Ran Into
1. Preventing Infinite Reflection Loops
Implementing self-correction loops in the Supervisor Agent occasionally caused agents to over-refine solutions. We established strict quality thresholds and termination criteria to keep analysis times under 10 seconds.
2. Handling Multi-Turn State
Ensuring follow-up queries (e.g., "What if the lead actor is out for 3 days instead of 1?") retained context required building a robust session manager across REST and WebSocket connections.
3. Deployment Constraints
Cloud account billing verification constraints prevented generating a Google Cloud Run .run.app URL in time. We adapted our deployment pipeline using Docker to host our FastAPI backend live on Render.com, keeping our multi-agent Gemini pipeline operational.
Accomplishments We're Proud Of
✅ True Multi-Agent Intelligence
Built a custom orchestration framework with genuine planning, reflection, and execution loops rather than a basic LLM wrapper.
✅ Sub-10 Second Crisis Analysis
Accelerated a process that typically takes producers 2+ hours down to seconds.
✅ Live Operational API
Successfully deployed a production backend returning real multi-agent reasoning and structured audit trails.
✅ Executive Dashboard
Designed a sleek, Gemini-inspired dark theme UI with live worker reasoning steppers, interactive decision cards, and session history management.
✅ Audit Trail Transparency
Every decision is logged with complete reasoning chain, financial impact, and all worker outputs in audit_logs/ as JSON.
What We Learned
Agent Orchestration > Monolithic Prompts
Separating planning, data retrieval, strategy generation, and validation across specialized workers dramatically increases decision accuracy over single LLM prompts.
Cascades Are the True Crisis
Detecting secondary bottlenecks before executing a swap is what separates a toy prototype from a production-grade tool. A 2-minute cascade check prevents ₹305k daily losses.
Audit Trails Build Trust
Automatically persisting structured JSON execution traces (audit_logs/) gives human producers total transparency into why a decision was recommended.
Technology Stack
| Component | Technology |
|---|---|
| AI Model | Google Gemini 2.5-Flash |
| Agent Framework | Custom Multi-Agent Orchestration |
| Backend | FastAPI (Python 3.13) |
| Deployment | Render.com (FREE tier) |
| Data Format | JSON (production manifest) |
| Audit Logging | File-based JSON logs |
Why This Stack?
- Gemini 2.5-Flash: Free tier available, fast, reliable for production use
- Custom agents: More control than LangChain, genuine orchestration
- FastAPI: Production-grade async API with automatic OpenAPI docs
- Render.com: FREE deployment, automatic scaling, live URL
- JSON logs: Simple, queryable, compliance-friendly
Live Deployment Proof
Live URL: https://cineflow-api-m7bu.onrender.com
Test the API
Health Check:
curl https://cineflow-api-m7bu.onrender.com/api/health
Real Crisis Analysis (Gemini API executing):
curl.exe -X POST https://cineflow-api-m7bu.onrender.com/api/analyze-crisis \
-H "Content-Type: application/json" \
-d '{"prompt":"Lead actor got sick","scene_id":"sc_001"}'
Audit Logs (Complete execution trace):
curl https://cineflow-api-m7bu.onrender.com/api/audit-logs
OpenAPI Documentation:
https://cineflow-api-m7bu.onrender.com/docs
Terminal Execution (Local Proof)
# Run from terminal with crisis query
echo "Lead actor got sick" | python app/run_main.py
Output shows:
- Daily production readiness report
- Agent orchestration logs (5 agents executing)
- Executive analysis with financial impact
- Audit log file created in:
D:\WEBD\CineFlow\audit_logs\run_main_[TIMESTAMP].log
What's Next for CineFlow
Phase 2: Live Third-Party Integrations
- Connect directly with OpenWeatherMap API for real-time weather forecasts
- Integrate municipal permit databases for location clearance checks
- Link to agency scheduling software for cast availability
Phase 3: IoT & On-Set Asset Tracking
- GPS sensors on equipment for real-time location tracking
- Physical status sensors (camera temperature, drone battery health)
- Alert producers to equipment failures before they impact shoots
Phase 4: Mobile Producer App
- iOS/Android companion app with push alerts
- One-tap decision approvals directly from film set
- Live crew status and equipment tracking
Phase 5: Multi-Project Portfolio View
- Extend orchestration to studio executives managing multiple films
- Cross-project resource conflict detection
- Portfolio-level financial optimization
Repository & Code
GitHub: https://github.com/LegendarySumit/CineFlow
Key Files:
app/agents/supervisor.py- Master orchestratorapp/agents/workers/- 5 specialized agentsapp/main.py- FastAPI backendapp/run_main.py- Terminal interface with audit loggingapp/services/- Financial optimization, cascade detection, audit loggingprojects/prod_monsoon_arc_01.json- Sample production data (100+ scenes)
Final Summary
CineFlow transforms film production crisis management from a 2+ hour manual guessing game into an autonomous decision engine that delivers financially optimized, cascade-validated recommendations in seconds.
By combining:
- ✅ Real multi-agent orchestration (not just a chatbot)
- ✅ Cascade detection (prevents secondary disasters)
- ✅ Financial optimization (Pareto frontier analysis)
- ✅ Audit trails (full compliance & transparency)
- ✅ Live deployment (production-ready on Render)
We've built a tool that gives producers their time back and turns crises into opportunities for better decisions.
The crisis isn't the problem. The response time was. CineFlow fixes that.
Built for the Hackathon | Deployed Live | Real Gemini API | Production-Ready Code
Log in or sign up for Devpost to join the conversation.