Letting Gemini Write SQL Against BigQuery, So Fans Don't Have To
Personalized baseball coverage that actually personalizes: follow your players, pick your schedule, and an LLM-translated SQL layer lets the AI generate stats and visualizations against fresh MLB data without code changes.
Sports coverage is bimodal: encyclopedic if you're a stathead, drive-by if you're casual. There's almost nothing for a fan who wants depth on their three favorite players and a glance at everything else. The Google MLB Hackathon was a chance to build that.

Why I built it
I wanted to learn Google's data and AI stack hands-on, and challenge 2 of the hackathon (personalized fan content) gave me a clean problem to aim at. The pitch I locked early: a fan picks a few players and teams, and the system writes them a daily briefing in their language, with charts they can generate by asking a question in plain English.
What it does
Users create an account, follow players and teams, and start receiving AI-generated articles by email at a frequency they choose. The articles are written in their preferred language (English, Japanese, or Spanish), can be saved from any email client, and the user can unsubscribe at any time.
Distinctive features
- Natural-language chart generation: type a question, get a Chart.js graph with editable title, labels, and colors.
- Auto-discovered related content (videos, articles) keyed to the players and teams you follow.
- A saved-content section that can summarize a video, export an article to PDF, and recolor a graph.
- A home dashboard where saved cards can be pinned, plus a hidden easter egg that toggles random home-run clips from followed players.
- Account controls for name, preferred language, sign-out, and full account deletion.
How I built it
The frontend is Next.js with TypeScript, DaisyUI, and Tailwind. Firebase holds user state: followed players, followed teams, liked content, and language preference. Firebase Functions run the scheduled article-generation jobs that send the daily emails.
Natural language → SQL → chart
Gemini reads the user's question and the BigQuery schema, emits a SQL query, runs it, and hands the result back to Gemini to pick the best graph type. Chart.js renders the final visualization. I made the schema introspection dynamic, so adding columns or rows to the MLB BigQuery table is reflected automatically without a single code change. The same BigQuery layer also matches followed players and teams to related content (videos, articles).
Multilingual everywhere
Static UI strings come from a translation file. Dynamic content (video summaries, related content, generated articles) is translated by Gemini on demand. A per-content translate button persists the translated version across refresh so the user never pays the same Gemini call twice.
What was hard
Three things ate most of the time. First, getting the scheduled article generation to honor the user's preferred language took many tweaks: the prompt, the language code passed in, and the post-generation save path all had to agree. Second, Vertex AI's video summarization had URL restrictions, especially on MLB.com sources. I fixed it by first uploading the source URL into a Google Cloud Storage bucket, then handing the bucket URL to Vertex AI, which accepted it consistently. Third, I got stuck for days getting Vercel deployment working, but doing that early made every subsequent CI cycle smooth.
What I learned
First real project in Next.js, and first time using BigQuery, Firebase Functions, and Vertex AI together. The combination that surprised me most was Gemini plus BigQuery for natural-language data retrieval: the schema-aware SQL generation made the chart feature feel native to the data, not bolted on. Firebase Functions for the scheduled email pipeline closed the loop without a separate worker box.
What's next
- More responsive layout for mobile and tablet.
- Richer chart data plus a retry mechanism for SQL generation with a bounded retry limit.
- More UI languages and more dynamic translation targets.
- Resizable and draggable dashboard cards.
- Imagen 3 image generation from article text (the UI button is already there, the API trigger needs fixing).
- Further prompt engineering on the SQL generator to reduce malformed queries.

FHIR + CDS Hooks + Gemini: a Risk Score a Clinician Will Actually Read
Risk scores die when they're black boxes. MeldRx integration via FHIR/CDS Hooks pulls patient data; Gemini Flash returns structured JSON with explanations, confidence, and recommended actions; the UI hands clinicians a downloadable PDF report.

What I Learned Building a Browser Extension Around Chrome's Built-in AI
Chrome's Prompt, Summarizer, and Translator APIs make on-device AI a reality. InstaQ stitches them together so any webpage becomes a Q&A surface, with sessions you can come back to.