Inspiration 🎬
In the highly competitive entertainment industry, time is money. Film studios, marketing teams, and executives generate millions of data points daily—from box office ticket sales to social media sentiment about new trailers. However, there is a massive bottleneck: accessing and interpreting this data. Non-technical film executives usually have to wait for data engineering teams to build static dashboards or run custom SQL queries to answer simple questions like, "How are ticket sales for our new sci-fi movie performing among the 18-25 demographic in Europe?"
We realized that by combining the reasoning capabilities of Large Language Models with the blistering speed of analytical databases, we could eliminate this bottleneck. That's why we created CineMetrics AI.
What it does 🚀
CineMetrics AI is a production-ready AI agent that acts as a 24/7 data analyst for film studios.
Instead of navigating complex dashboards, a studio executive can simply ask questions in natural language. Using Google Cloud's Gemini, the agent understands the intent, formulates a complex SQL query, and uses the Model Context Protocol (MCP) to securely fetch real-time analytics from a ClickHouse database. Finally, Gemini interprets the raw data and provides a clear, actionable, and conversational response to the user. It bridges the gap between massive datasets and human decision-making.
How we built it 🛠️
We built CineMetrics AI adhering strictly to the hackathon guidelines, ensuring a powerful and compliant architecture:
- Google Cloud AI (The Brain): We strictly utilized Google's AI ecosystem (using the
google-genaiSDK and Gemini models). No third-party LLMs were used. Gemini handles the natural language understanding, orchestrates the tool calling, and generates the final response. - ClickHouse & MCP (The Muscle): We integrated the official ClickHouse MCP Server (
mcp-clickhouse). Instead of writing hardcoded database connections, we equipped our Gemini agent with MCP tools. This allows the agent to dynamically query our ClickHouse database (hosted on ClickHouse Cloud) at runtime, demonstrating a true agentic workflow. - Backend & Frontend: The application was built in Python. We used Streamlit to create a fast, interactive, and user-friendly chat interface that resembles a modern studio analytics portal.
Challenges we ran into 🧩
- Tool Calling with MCP: Connecting Gemini to the relatively new Model Context Protocol required careful prompt engineering and structuring of function calls to ensure the agent knew exactly when and how to use the ClickHouse tool.
- Preventing AI Hallucinations: We had to strictly prompt Gemini to base its answers only on the data returned by the ClickHouse MCP server, rather than relying on its internal training data about real-world movies, to ensure 100% accuracy for studio executives.
- SQL Generation: Fine-tuning the prompt so that the AI generates valid ClickHouse-specific SQL dialect, especially for complex analytical aggregations.
Accomplishments that we're proud of 🏆
- Successfully integrating Google Gemini with ClickHouse via the MCP standard, creating a seamless data pipeline.
- Building an agent that actually executes code/queries in runtime to fetch real data, rather than just simulating a conversation.
- Designing an intuitive UI that hides all the technical complexity (SQL, database schemas, MCP communication) from the end-user, providing a magical experience.
What we learned 🧠
- The true power and flexibility of the Model Context Protocol (MCP) to standardize how AI agents interact with external tools and data sources.
- How incredibly fast ClickHouse is for analytical queries, making it the perfect partner for an AI agent that needs to provide real-time answers.
- Advanced function calling and orchestration using the latest Google Cloud Generative AI SDKs.
What's next for CineMetrics AI with ClickHouse 🔮
- Multi-Agent Network: Implementing Google Cloud Agent Builder to create a multi-agent system (e.g., a "Data Agent" that fetches metrics, and a "Marketing Agent" that automatically drafts social media campaigns based on those metrics).
- Predictive Analytics: Integrating BigQuery ML to not just analyze past data, but allow executives to ask predictive questions like, "Based on current trailer sentiment, what is our projected opening weekend box office?"
- Mobile App: Expanding the UI to iOS and Android so executives can get real-time answers right from their phones while on set or at film festivals.
Built With
- agents
- ai-agents
- api
- artificial-intelligence
- clickhouse
- data-analytics
- entertainment
- gemini
- generative-ai
- google-cloud
- google-genai
- mcp
- python
- sql
- streamlit
Log in or sign up for Devpost to join the conversation.