Skip to content

F1 Stats Agent ​

F1 Stats is one of the templates available in Studio's Agent Templates marketplace, built around the FastF1 open-source library. Like every template, it isn't installed automatically — you pick and install it into a project from the marketplace.

Key Features ​

Session & Race Data
Retrieve session data, race results, race schedules, and detailed lap data for any F1 event.
Driver & Team Info
Look up driver and team information for a given year.
AI Race Analysis
The race-results workflow includes an AI step that turns raw results into narrative snippets — race overview, position changes, performance highlights.
No API Key Required
FastF1 pulls public F1 data — no credentials needed to get started.

Installation ​

The template is installed using its _install.yml manifest, which pulls in one connector (FastF1) and six workflows:

yaml
setup:
  title: "FastF1 Onboarding"
  description: AI-powered onboarding for FastF1.
  category:
    - special-templates
  features:
    - AI Agent to get session data.
    - AI Reporter to generate session data.
    - Access race results, driver information, and race schedules.
    - Retrieve team information and detailed lap data.
  integrations:
    - fastf1

The FastF1 Connector ​

A single pyscript connector with six commands, one per workflow below:

yaml
connector:
  name: "fastf1"
  filetype: "pyscript"
  commands:
    - get_session_data
    - get_driver_info
    - get_team_info
    - get_race_schedule
    - get_lap_data
    - get_race_results

Workflows ​

WorkflowInputsOutputs
get-session-datasession_name, session_yearsession_data
get-race-resultsevent, yearrace_results (+ AI analysis, see below)
get-driver-infodriver, yeardriver_info
get-race-scheduleyearrace_schedule
get-team-infoteam, yearteam_info
get-lap-dataevent, year, session_type, driverlap_data

Five of the six are a single connector task — fetch data, return it. get-race-results is the exception:

yaml
tasks:
  - type: "connector"
    name: "get-race-results"
    connector:
      name: "fastf1"
      command: "get_race_results"
    inputs:
      event: "$.get('event')"
      year: "$.get('year')"
    outputs:
      race_results: "$"

  # AI Reporter: turns results into narrative snippets
  - type: "prompt"
    name: "prompt-race-result-analysis"
    connector:
      name: "google-genai"
      command: "invoke_prompt"
      model: "gemini-2.5-pro"
      location: "global"
      provider: "vertex_ai"
    inputs:
      race_results: "$.get('race_results')"
    outputs:
      snippets: "$"

  # Saves the generated snippets as searchable documents
  - type: "document"
    name: "update-snippets"
    condition: "len($.get('snippets-bulk', [])) > 0"
    config:
      action: "bulk-save"
      embed-vector: true
    connector:
      name: "google-genai"
      command: "invoke_embedding"
      model: "text-embedding-004"
      location: "global"
      provider: "vertex_ai"

The prompt's output schema (RaceResultAnalysis, in _prompts.yml) asks for an array of snippets, each with a title (e.g. "Race Overview", "Position Changes"), subject (a driver or team name), content, and a confidence score.

Customization Options ​

  • Swap gemini-2.5-pro for another model your project has configured, if you want a different cost/quality tradeoff for the race analysis step.
  • Install only the workflows you need — each is a standalone file, not an all-or-nothing bundle.
  • Combine with other connectors (e.g. a document/mapping task) to push F1 data into your own content pipeline.

Next Steps ​

  • Explore Workflows to understand how these tasks chain together.
  • Review Connectors to see how the FastF1 connector fits the platform's connector model.
  • See Prompts to understand the AI analysis step's schema.