Skip to content

PitLane-AI

PyPI version Python versions License

Claude Agent SDK Demonstration

PitLane-AI demonstrates practical patterns for building AI agents:

  • Skills - Composable, domain-specific agent capabilities
  • Progressive Disclosure - Just-in-time context via temporal awareness
  • Tool Permissions - Layered restrictions for safe agent behavior

AI-powered Formula 1 data analysis built with Claude's Agent SDK. Uses FastF1 for telemetry and jolpica-f1 for historical data.

What It Analyzes

  • Lap Time Analysis - Compare driver performance with visual lap time distributions
  • Tyre Strategy - Visualize pit stop patterns and compound usage across races
  • Race Telemetry - Access detailed session data for qualifying, practice, and race sessions
  • Driver Information - Query F1 driver rosters, codes, and metadata from 1950 to present
  • Event Schedules - Browse complete season calendars with session timings and locations

Quick Start

Before you begin

PitLane-AI requires an Anthropic API key. Get one at console.anthropic.com and set it in your environment:

export ANTHROPIC_API_KEY=sk-ant-...
# Install
pip install pitlane-agent

# Create workspace
pitlane workspace create --workspace-id my-analysis

# Analyze Monaco qualifying
pitlane analyze lap-times --workspace-id my-analysis \
  --year 2024 --gp Monaco --session Q \
  --drivers VER --drivers HAM
# Install
pip install pitlane-web

# Run web server
uvx pitlane-web --env development

# Visit http://localhost:8000
from pitlane_agent import F1Agent

agent = F1Agent(session_id="my-analysis")

async for chunk in agent.chat("Compare Verstappen and Hamilton lap times at Monaco 2024"):
    print(chunk, end="")

Next Steps

Getting Started Install PitLane-AI and run your first analysis
Architecture Understand the agent system, skills, and temporal context
User Guide Learn how to use the web interface
Developer Guide Contribute and build custom skills

Key Features

Skills - Three specialized skills handle different F1 domains: f1-analyst (lap times, strategy), f1-drivers (driver info), and f1-schedule (calendars). Each skill has its own tool restrictions. Learn more →

Temporal Context - The agent knows "where we are" in the F1 season. Queries like "analyze the last race" work without specifying which race. Learn more →

Tool Permissions - Demonstrates layered security: WebFetch limited to F1 domains, Bash restricted to pitlane CLI, file access constrained to workspace. Learn more →

License

PitLane-AI is licensed under the Apache License 2.0. See the License page for details.