F1 StratLab is an open-source multi-agent AI system for real-time Formula 1 race strategy. It orchestrates seven ML models and a LangGraph multi-agent system to produce strategy recommendations — from lap time prediction to tire degradation, radio NLP, and RAG over FIA regulations.
A LangGraph ReAct multi-agent system replaces the legacy Experta rule engine. Six specialised sub-agents coordinate under a Strategy Orchestrator.
Each sub-agent reasons in its own head, outputs structured Pydantic predictions, and hands them to the orchestrator.
The orchestrator sees every car's sector pace, gap delta, and compound — and recomputes every lap.
The orchestrator weighs the six opinions against FIA rules and simulation, and returns the call.
Each sub-agent wraps one or more models as @tool-decorated LangChain tools. Hover a row — read the spec.
Model performance at a glance
The RAG Agent indexes FIA Sporting & Technical Regulations 2023–2025 in a local Qdrant collection with BGE-M3 embeddings.
Same orchestrator. Same models. Pick the front-end that matches the moment — pit wall, lab, or Twitch stream.
Three console scripts ship with the package. f1-strat is a Rich interactive launcher that walks you through mode, race, driver, lap range and LLM provider. f1-sim is the headless runner that iterates the race lap-by-lap and streams a live per-lap table with action, confidence and MC scores. f1-arcade opens the 2D replay window.
$ uv run f1-stratSix agents, seven models, one live race — a guided tour of the system end to end.
Three surfaces, one engine: the 2D arcade replay, the CLI wizard, and the Streamlit analytics app.
pyproject.toml routes torch / torchvision to the right CUDA wheel per platform via [tool.uv.sources] — so there's no manual PyTorch step on Windows or Linux.
# install uv once per machine $ curl -LsSf https://astral.sh/uv/install.sh | sh # clone + install in one shot $ git clone --recursive https://github.com/VforVitorio/F1-StratLab.git $ cd F1-StratLab $ uv sync # run the interactive launcher $ uv run f1-strat
Where F1 StratLab is headed next: from anticipating rivals to live-race inference.
React/Vite UI replaces Streamlit; the FastAPI backend stays.
Anticipate each rival's next move and feed it to the orchestrator. Reactive becomes anticipatory.
Real-time OpenF1 WebSocket ingestion, plus adaptation to the 2026 regulation.
A domain LoRA fine-tune for sharper strategy reasoning and narration.
A large team-radio corpus with a novel bluffing / deception signal.
Button-driven retraining: download, merge, inspect, retrain. No notebooks.
Live narration of the orchestrator on X during a Grand Prix.
Planned, not committed. Directions, not deadlines.
F1 StratLab is an open-source Python system that uses seven machine learning models and six LangGraph sub-agents to generate real-time Formula 1 race strategy recommendations, including pit-stop timing, tire compound selection, and undercut opportunity detection.
XGBoost for lap-time prediction (MAE 0.392s), a Temporal Convolutional Network with Monte Carlo Dropout for tire degradation, two LightGBM classifiers for overtake (AUC-ROC 0.876) and safety-car probability, a HistGradientBoosting quantile regressor for pit-stop duration (MAE 0.487s), a LightGBM classifier for undercut success (AUC-ROC 0.771), and a four-stage NLP pipeline (Whisper + RoBERTa + SetFit + BERT-large) for team radio.
The Tire Agent wraps a causal TCN trained with Monte Carlo Dropout to produce P10/P50/P90 degradation quantiles per compound, detect the tire performance cliff, and output a recommended pit window with a calibrated confidence score.
The RAG Agent indexes the FIA Sporting and Technical Regulations (2023–2025) in a local Qdrant vector database using BGE-M3 embeddings, retrieves the top passages by cosine similarity, reranks them, and synthesizes a cited answer referencing specific article numbers.
Telemetry, lap data, and race-control messages from 71 Formula 1 Grand Prix across the 2023–2025 seasons, sourced from the FastF1 and OpenF1 public APIs. The dataset is published at VforVitorio/f1-strategy-dataset on Hugging Face.
Spot a bug, ship a new agent, tune a model — issues and pull requests are welcome.
Also known as VforVitorio. Junior AI Engineer at NTT DATA Spain, working across many areas of AI, from computer vision research to research into LLM behavior, agentic AI solutions and tooling such as Model Context Protocol (MCP) servers. Bachelor's in Intelligent Systems Engineering at UIE Campus Coruña, graduated with a 9.0/10 average and 4 Distinctions (Matrícula de Honor), with a thesis awarded Distinction (Matrícula de Honor) and recommended for conversion into a research paper. Now pursuing a Master's Degree in Artificial Intelligence Research (AEPIA / UIMP) alongside his full-time role. Building AI for Formula 1, from telemetry modelling to multi-agent reasoning.