RaceLine AI Coach - Devpost Submission

Inspiration

Every motorsport driver knows the frustration of being seconds off the pace without knowing why. Traditional telemetry tools dump raw data on you, but they don't tell the story of your lap or what to fix first. When I discovered the Toyota GR Cup dataset—17GB of real racing telemetry—I saw an opportunity to build something that speaks the language of drivers, not just engineers.

What it does

RaceLine AI Coach transforms raw telemetry into an interactive coaching experience:

  • Lap Comparison Maps: Animated ghost cars show you exactly where you're losing time, with sector-by-sector breakdowns and visual highlights of improvement areas
  • Consistency Analyzer: Identifies outlier laps and scores your consistency across sessions
  • Flow Dynamics: Visualizes momentum gains and losses throughout the lap
  • Hot & Weak Zones: Pinpoints track segments with high variance where you're leaving time on the table
  • AI Coach: Gemini 2.5 Pro analyzes your telemetry and delivers natural-language coaching tips tailored to your specific lap
  • Multi-Race Support: Auto-discovers circuits and races from your dataset—no manual configuration needed

How I built it

The architecture splits into three layers:

  1. Data Pipeline (Python): Built a processor that automatically converts 17GB of CSV telemetry to 773MB of Parquet files (96% compression!). The system discovers circuits, normalizes mixed naming conventions, caches lap events, and detects golden laps—all without external databases.

  2. Backend (FastAPI): REST API exposes telemetry, vehicle lists, and analysis endpoints. The comparison engine calculates sector deltas, consistency scores, and hot zones, then serializes results for Gemini 2.5 Pro to generate coaching insights.

  3. Frontend (Vanilla JS + D3 + Chart.js): Interactive maps render GPS traces with animated ghost cars, tooltips, and sector annotations. Charts visualize speed traces, lap progression, and variance. Everything runs client-side with no framework overhead.

The entire platform is designed for Google Cloud: Frontend deploys to Firebase Hosting, backend containerizes to Cloud Run with the processed dataset baked in—no external storage needed.

Challenges I faced

  • Dataset heterogeneity: Race files used inconsistent naming (vir_lap_time_R2.csv, sebring_telemetry_R1.csv). Built regex-based discovery that handles any convention.
  • Memory constraints: Loading 17GB in memory wasn't viable. Parquet conversion + lazy loading solved this while keeping cold starts under 10 seconds.
  • GPS coordinate precision: Some circuits had sparse GPS data. Implemented distance-based interpolation to maintain smooth track rendering.
  • AI context limits: Gemini can't consume full telemetry arrays. Created a summarization layer that extracts key metrics (sector deltas, hot zones, consistency) into compact JSON payloads.
  • Animation performance: Rendering 10,000+ GPS points with ghost cars needed optimization. Used D3's quadtree for efficient spatial queries and throttled animation frames.

What I learned

This project deepened my understanding of real-time data processing at scale. I learned how to design for serverless constraints (stateless processing, baked-in datasets), optimize frontend rendering for large datasets, and structure AI prompts to extract actionable insights from numeric data. Most importantly, I learned that great UX for technical users means hiding complexity—drivers shouldn't need to understand Parquet files or API payloads, they just need answers.

What's next

  • Video sync: Overlay telemetry on in-car footage with frame-perfect alignment
  • Multi-lap trends: Analyze performance across entire sessions, not just single laps
  • Driver authentication: Multi-user accounts with private telemetry storage
  • PDF reports: Downloadable coaching summaries for offline review

Datasets used

  • barber-motorsports-park.zip
  • circuit-of-the-americas.zip
  • indianapolis.zip
  • road-america.zip
  • sebring.zip
  • sonoma.zip
  • virginia-international-raceway.zip

Built with

Languages & Frameworks:

  • Python 3.11
  • FastAPI
  • JavaScript (ES6+)
  • HTML5 / CSS3

Frontend Libraries:

  • D3.js (map visualizations)
  • Chart.js (analytics charts)
  • Tailwind CSS

Backend Stack:

  • Pandas & NumPy (data processing)
  • Uvicorn (ASGI server)
  • PyArrow (Parquet conversion)

Cloud & Hosting:

  • Google Cloud Run
  • Firebase Hosting
  • Google Cloud Secret Manager

AI & APIs:

  • Gemini 2.5 Pro (Google AI Studio)

Data Tools:

  • Parquet (columnar storage)
  • CSV processing pipelines

Built With

Share this project:

Updates