Skip to content
VineshF1Public

About

An AI-powered Formula 1 chatbot for trivia, statistics, and historical race data.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

Repository files navigation

Halos AI

An AI-powered Formula 1 chatbot for trivia, statistics, and historical race data.

Overview

Halos AI combines Retrieval-Augmented Generation (RAG) and Text-to-SQL pipelines to answer two distinct categories of F1 questions: open-ended knowledge/trivia queries and structured statistical queries. A query classifier routes each request to the appropriate pipeline, and LLM generates the final natural language response.

Features

  • Dual pipeline (RAG for trivia + Text-to-SQL for stats)
  • Automatic query classification
  • Hybrid search (BM25 + pgvector)
  • Query rewriting with conversation context
  • Input sanitization and prompt-injection detection
  • Rate limiting (per-IP sliding window)
  • Modern chat interface with backend status monitoring

Architecture

flowchart TB
    subgraph INGESTION["Ingestion Pipeline"]
        A["<b>Wikipedia Pages</b><br/>64 URLs"] --> B["<b>Playwright Scraper</b>"]
        B --> C["<b>Chunk Documents</b><br/>1469 Chunks"]
        C --> D["<b>NVIDIA NV-Embed-v1</b>"]
        D --> E["<b>Neon + pgvector</b>"]
    end

    subgraph QUERY["Query Pipeline"]
        F["<b>User Question</b>"] --> G["<b>FastAPI Backend</b>"]
        G --> H["<b>Query Classifier</b>"]
        H --> I["<b>NVIDIA NV-Embed-v1</b>"]
        I --> E
        E --> J["<b>Retrieve Chunks</b>"]
        J --> K["<b>LLM</b><br/>via NVIDIA Nemotron"]
        K --> L["<b>Final Answer</b>"]
    end

    style A fill:#7c3aed,stroke:#a78bfa,stroke-width:2px,color:#fff
    style B fill:#6366f1,stroke:#818cf8,stroke-width:2px,color:#fff
    style C fill:#0ea5e9,stroke:#38bdf8,stroke-width:2px,color:#fff
    style D fill:#f59e0b,stroke:#fbbf24,stroke-width:2px,color:#fff
    style E fill:#10b981,stroke:#34d399,stroke-width:2px,color:#fff
    style F fill:#ec4899,stroke:#f472b6,stroke-width:2px,color:#fff
    style G fill:#6366f1,stroke:#818cf8,stroke-width:2px,color:#fff
    style H fill:#ef4444,stroke:#f87171,stroke-width:2px,color:#fff
    style I fill:#f59e0b,stroke:#fbbf24,stroke-width:2px,color:#fff
    style J fill:#0ea5e9,stroke:#38bdf8,stroke-width:2px,color:#fff
    style K fill:#7c3aed,stroke:#a78bfa,stroke-width:2px,color:#fff
    style L fill:#10b981,stroke:#34d399,stroke-width:2px,color:#fff

    style INGESTION fill:#1e1e2e,stroke:#6b7280,stroke-width:1px,color:#d1d5db
    style QUERY fill:#1e1e2e,stroke:#6b7280,stroke-width:1px,color:#d1d5db
Loading

Tech Stack

Frontend

  • React
  • TypeScript
  • Vite
  • Tailwind CSS

Backend

  • Python
  • FastAPI
  • Uvicorn

AI & Data

  • LLM (NVIDIA Nemotron)
  • NVIDIA NV-Embed-v1
  • PostgreSQL (Neon)
  • pgvector

Data Collection

  • FastF1
  • Playwright

Deployment

  • Vercel (frontend)
  • Render (backend)

Data Coverage

Knowledge Base

  • 64 Wikipedia pages
  • 1,469 vector chunks

Statistics Database

  • Seasons: 2021–2026
  • 136 races
  • 2,476 race results
  • 2,477 qualifying results

Deployment

Component URL
Frontend https://halos-ai.vercel.app

Example Questions

Statistics

  • Who won the 2025 Monaco Grand Prix?
  • How many wins does Max Verstappen have since 2021?
  • Which constructor scored the most points in 2024?

Trivia

  • Tell me about Ayrton Senna.
  • Why is Monaco considered a special race?
  • Explain Ferrari's history in Formula 1.

Author

Vinesh

Built with ❤️

About

An AI-powered Formula 1 chatbot for trivia, statistics, and historical race data.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages