How vineshf1/halos-ai works
Halos AI is an F1 question-answering chatbot: users ask through the web chat, the backend validates and classifies each question, then serves trivia from a hybrid RAG search or statistics through Text-to-SQL, returning a natural-language answer. Separate ingestion jobs populate the knowledge and race-statistics data stores. The README documents query rewriting, conversation context, and hybrid retrieval; sampled excerpts show the RAG retrieval and generation behavior, but not every internal step or the SQL-agent implementation.
Main entry points: app.py FastAPI chat API · rag_pipeline.py RAG pipeline · db_schema.py PostgreSQL + pgvector · rag_ingestion.py Knowledge ingestion
Components 16
Chat Interface
- Chat interface
frontend/src/components/ChatInterface.tsx - Chat input
frontend/src/components/ChatInput.tsx - API client
frontend/src/api.ts
Chat API
- FastAPI chat API
backend/app.py - Input checks
backend/sanitizer.py - IP rate limit
backend/rate_limiter.py - Query classifier
backend/app.py
Answer Pipelines
- RAG pipeline
backend/rag_pipeline.py - SQL answering
backend/app.py
Data Ingestion
- PostgreSQL + pgvector
backend/db_schema.py - Knowledge ingestion
backend/rag_ingestion.py - Statistics ingestion
backend/sql_ingestion.py
Other components
- F1 questioner
- NVIDIA AI API
- Wikipedia pages
- FastF1 data
Connections 20
- F1 questioner → Chat input: asks
- Chat input → Chat interface: submits
- Chat interface → API client: sends message
- API client → FastAPI chat API: POST chat
- API client → FastAPI chat API: GET health
- FastAPI chat API → Input checks: checks input
- FastAPI chat API → IP rate limit: limits requests
- FastAPI chat API → Query classifier: classifies query
- Query classifier → RAG pipeline: routes trivia
- Query classifier → SQL answering: routes stats
- SQL answering → RAG pipeline: falls back
- RAG pipeline → PostgreSQL + pgvector: hybrid search
- RAG pipeline → NVIDIA AI API: embeds and generates
- SQL answering → NVIDIA AI API: generates SQL
- SQL answering → PostgreSQL + pgvector: reads statistics
- Knowledge ingestion → Wikipedia pages: scrapes pages
- Knowledge ingestion → NVIDIA AI API: embeds chunks
- Knowledge ingestion → PostgreSQL + pgvector: stores chunks
- Statistics ingestion → FastF1 data: loads race data
- Statistics ingestion → PostgreSQL + pgvector: stores results