Inspiration

Movie studio marketing teams spend hours manually digging through spreadsheets and dashboards just to answer simple questions like "which trailer is performing best?" or "how do audiences feel about this director's work?" We wanted to remove that friction entirely — let someone just ask the question in plain English and get a real, verifiable answer back, no SQL knowledge required.

What it does

Trailer IQ is an AI analytics assistant for a movie studio's marketing team. You type a plain-English question — "which director has the best audience sentiment?" or "list movies with a budget over $100M" — and an AI agent writes real SQL on the fly, runs it live against a real dataset of movie metadata, trailer video IDs, and audience sentiment extracted from actual trailer comments, and answers directly. The exact SQL it used is always available on demand, so nothing is a black box — every answer can be verified, not just trusted.

How we built it

The reasoning loop is powered by Gemini, which interprets the question, decides what data it needs, and writes SQL to get it. That SQL runs against ClickHouse Cloud. The backend is FastAPI, and the frontend is a lightweight static site with no build step — deployed independently (backend on Render, frontend on Vercel) and talking to each other over a simple REST API. We spent real time tightening the agent's system prompt so it behaves like a precise analyst, not a chatty assistant — it never mentions "the database" or "the query," never silently truncates results, and only constructs a trailer link when explicitly asked for one.

Challenges we ran into

Two big ones. First, getting the AI agent's tone right took multiple iterations — early versions narrated their own reasoning ("Based on the dataset, 1 result was returned...") which felt clunky and exposed implementation details users don't need. We rewrote the system prompt rules until it answered like it simply knew the fact. Second, deployment: our backend needs a persistent process (not a serverless function) since it maintains a live connection to our data layer, which meant working through container-based hosting, environment variable configuration, and free-tier cold-start behavior — all while keeping credentials out of the public GitHub repo.

Accomplishments that we're proud of

Getting the full loop working end-to-end — a real question in, real generated SQL, a real answer out — was the milestone that made everything else feel possible. We're also proud of how disciplined we were about data honesty: every field in our dataset is real, nothing synthetic was fabricated just to make a demo look more impressive, and we documented that transparently rather than glossing over it.

What we learned

That prompt engineering is real engineering — small rule changes in the system prompt had outsized effects on whether the product felt trustworthy or gimmicky. We also learned a lot about the practical realities of shipping an AI product: rate limits, cold starts, and hosted-API availability all matter just as much as the core idea once you move from "it works on my machine" to something a stranger can actually open and use.

What's next for Trailer IQ

Expanding the dataset with more real, verifiable sources; adding a lightweight authentication layer so a real marketing team could use this with their own private data; and building out a small library of pre-validated, high-confidence question templates for common analyst workflows, while keeping the free-form question box as the primary way to interact with it.

Built With

Share this project:

Updates

Submission history