-
-
Conversational analytics using Gemini 3.5: Chatbot dynamically writes ClickHouse SQL to calculate trailer bot traffic rates.
-
Interactive Recharts bar graph displaying sub-second ClickHouse clickstream counts across multi-channel referral campaigns.
-
Conversational analytics using Gemini 3.5: Chatbot dynamically writes ClickHouse SQL to calculate trailer bot traffic rates.
-
CinemaLink Analytics portal dashboard showing real-time database status, bot shield configuration, and system parameters.
Inspiration
In the entertainment industry, launching a blockbuster film trailer is a multi-million dollar gamble. Studios distribute links across dozens of channels (TikTok, Twitter, YouTube, etc.) and need to know instantly which platform drives genuine human engagement and which is plagued by automated bots. Traditional analytics tools take hours or days to batch-process click streams. We built Smart Link: Autonomous Cinema AI & Bot Shield to give studio executives real-time, conversational big-data analytics and automated bot-filtering on demand.
What it does
Our project integrates into the Smart Link redirection gateway. When viewers click a link to a trailer, the clickstream is logged in parallel to MongoDB and a high-performance ClickHouse Cloud instance.
Studios can then navigate to the Cinema AI dashboard and talk directly to an autonomous AI agent:
- Natural Language Analytics: Ask questions like "Compare Twitter vs TikTok clicks for Dune 3" or "Show me the bot percentage for Gladiator 2."
- Autonomous Tool Use: The agent dynamically inspects the database schema and writes complex, read-only SQL queries to query ClickHouse in real-time.
- Dynamic Visualizations: The frontend automatically captures query results and renders beautiful, interactive Recharts diagrams.
- Live SQL Console: For developers and power-users, a manual console executes queries directly against ClickHouse and logs the execution.
How we built it
- Frontend: React, Tailwind CSS, Recharts for dynamic visual graphs.
- Backend: Node.js, Express, BullMQ, Redis for parallel background worker queue.
- Database: MongoDB (for user configuration) and ClickHouse Cloud (for sub-second processing of big analytical data).
- AI Agent: Google GenAI SDK (utilizing the high-quota Gemini 3.5-flash model with custom function calling definitions).
Challenges we ran into
- Rate Limits: We initially targeted preview models but hit restrictive daily quotas. Swapping to the production-stable
gemini-3.5-flashmodel provided standard high-volume free limits (1,500 daily requests) while preserving full tool-use capacity. - Local Development CORS & CSRF: Setting up secure cross-origin cookies between localhost ports (
5173and3000) caused browser cookie rejections. We implemented dynamic environment URL resolution and bypassed CSRF tokens specifically for local development to ensure a seamless setup experience. - Libuv process exits: Exiting testing scripts abruptly on Windows crashed Node due to active async ClickHouse connections. We added graceful handle cleanup to stabilize the local testing suite.
Accomplishments that we're proud of
- Successfully seeded and queried 50,000 blockbuster campaign clicks in milliseconds from ClickHouse Cloud.
- Built a fully autonomous agentic loop where the AI writes and executes code to update UI charts dynamically.
What we learned
We learned how to design resilient agentic workflows where the LLM behaves as an autonomous program. We mastered configuring system instructions and function declarations to query analytical columnar databases like ClickHouse securely and safely without compromising write access.
What's next for Smart Link: Autonomous Cinema AI & Bot Shield
Expanding the AI agent to support predictive modeling (estimating ticket box office sales based on early clickstream velocity) and integrating automated SMS/Email alerts to notify studio managers if trailer click traffic spikes or bot rates cross 30% on any particular advertising campaign.
Built With
- bullmq
- clickhouse-cloud
- express.js
- gemini-3.5
- gemini-api
- javascript
- mongodb
- node.js
- react
- recharts
- redis
- render
- tailwind-css
- vite

Log in or sign up for Devpost to join the conversation.