Inspiration

I wanted to create a platform to personalize and simplify advanced baseball analytics, leveraging AI to generate insights for all levels of fandom.

What it does

  • AI-powered game predictions for upcoming MLB matches
  • Personalized daily reports for users based on their favorite teams and players, emailed at noon and available to read on the dashboard
  • Real-time player rankings and team statistics
  • Live news feed with trending MLB content

How we built it:

Frontend: Next.js with Tailwind CSS and shadcn/ui components. Backend: Vercel Serverless. Database: PostgreSQL hosted on Supabase. Authentication: Supabase. External APIs: MLB Stats API, Google's Gemini Pro API, Google Imagen

Notes: I created a cron job system for automated daily report generation with email delivery, and caching strategies to optimize API calls and improve performance for game predictions.

Challenges we ran into

I was dealing with a large dataset (from the MLB fan content interactions JSON) and caching presented performance challenges. There were API rate limits and throttling from Gemini and Imagen that required careful management. Balancing prediction accuracy with acceptable response times proved difficult as well, so I had to optimize the performance by creating robust prompts in the back-end.

Accomplishments that we're proud of

I created a sophisticated prediction system for MLB games, leveraging multiple data sources in a scalable architecture. I also implemented robust caching to optimize performance and built an automated reporting system that delivers personalized insights from Gemini daily.

What we learned

I learned how easy it is to integrate the Google AI suite into modern web apps. I learned caching and rate limiting which was necessary to not overload Gemini at scale. I also discovered efficient methods for processing and analyzing large datasets, i.e. streaming content in chunks using a buffer system. Instead of loading the entire MLB content dataset at once, I could process it in manageable pieces, which helped handle the large file efficiently while keeping memory usage low. This also allowed me to sort and filter the most relevant content on the fly, making sure users get the most engaging MLB news and videos without any performance issues.

What's next for MLB-AI

In the short term, I'd want to improve our prediction accuracy by incorporating more advanced statistical models. I'd also want to add a social layer where fans can discuss games and share their own insights - think of it as a space where data-driven baseball discussions can thrive. Long term I'd like to bring video analysis into the mix. So instead of just looking at numbers, we can analyze actual gameplay footage to provide deeper insights into player performance. I'd also like to use historical baseball data to provide richer context for analysis, I imagine it would be easy to upload a couple pdfs to a GCP bucket and integrate Vertex Search API as a makeshift RAG solution.

Built With

Share this project:

Updates