Transform your Garmin Connect data into personalized insights, training plans, and race prep strategies using a sophisticated multi-agent AI system.
Provider-agnostic: OpenAI (incl. GPT-5), Anthropic, and OpenRouter are supported.
- Parallel analysis across specialized agents (load, physiology, execution)
- Interactive reports with evidence and actionable next steps
- CLI-first, config-driven headless runs
- Telegram bot interface (deprecated) โ see Deprecated section below
- Privacy-first: local encrypted credentials; no cloud storage of personal data
- Built-in observability and cost tracking (LangSmith)
flowchart LR
subgraph Analysis Team
A[๐ Dr. Aiden<br/>Metrics] --> E[๐ง Maya<br/>Synthesis]
B[๐โโ๏ธ Marcus<br/>Activity Data] --> C[๐ Elena<br/>Interpreter]
D[โค๏ธ Dr. Helena<br/>Physiology] --> E
C --> E
E --> F[๐ James<br/>Analysis Formatter]
F --> PR[๐ผ๏ธ Plot Resolution]
end
subgraph Planning Team
S[๐งญ Coach Magnus<br/>Season Planner] --> DI[๐งฉ Data Integration]
DI --> W[๐
Coach Magnus<br/>Weekly Planner]
W --> PXF[๐จ Pixel<br/>Plan Formatter]
end
%% Integrated flow from analysis to planning
PR --> S
%% Weekly planner consumes analysis results directly (kept simple)
A -. signals .-> W
C -. patterns .-> W
D -. physiology .-> W
%% Outputs
F --> G1[๐ Analysis HTML]
PXF --> G2[๐ Planning HTML]
Each agent brings specialized expertise:
- Dr. Aiden Nakamura (Metrics) - Training load, VOโ max trends, performance metrics
- Marcus Chen (Activity Data) - Raw training data processing and pattern recognition
- Elena Rodriguez (Activity Interpreter) - Training pattern analysis and execution insights
- Dr. Helena Virtanen (Physiology) - Recovery, stress, and physiological markers
- Maya Lindholm (Synthesis) - Combines insights into comprehensive analysis
- James Morrison (Analysis Formatter) - Creates analysis HTML and handoff artifacts
- Coach Magnus Thorsson (Season Planner) - Long-term periodization frameworks and peak timing
- Coach Magnus Thorsson (Weekly Planner) - Practical 14โday training plans with zones and adaptations
- Data Integration (Planning) - Integrates analysis, plots, and competitions to contextualize planning
- Pixel (Plan Formatter) - Produces professional planning HTML with interactive checklists
Executive summary and key performance indicators with readiness signals
Execution patterns and coaching notes derived from recent runs and rides
Bubble map of ACWR versus chronic load (marker size = acute load) with annotated highโrisk exposures
Analysis Report Features:
- ๐ฏ Executive Summary with key findings and readiness scores
- ๐ Interactive Training Load Charts with ACWR analysis
- โค๏ธ Physiological Adaptation Tracking (HRV, stress patterns, VOโ max)
โ ๏ธ Critical Pattern Analysis identifying training inconsistencies- ๐ Competition Readiness Assessment with timeline planning
- ๐ก Actionable Recommendations prioritized by urgency
Periodized macrocycle with phase-specific goals, timeline, and progression guardrails
Structured day plan with intensity zones, adaptations, and monitoring cues
Planning Report Features:
- ๐๏ธ Season-Long Periodization with phase-specific goals
- ๐ Day-by-Day Workout Details with intensity zones and adaptations
- ๐ฏ Training Zone References for running, cycling, and swimming
- ๐ Volume and Intensity Monitoring with built-in flexibility
- ๐ Adaptive Workout Options based on readiness and fatigue
# 1) Create your configuration
pixi run coach-init my_training_config.yaml
# 2) Edit the config with your details, then run
pixi run coach-cli --config my_training_config.yaml# Run with an existing config
python cli/garmin_ai_coach_cli.py --config my_training_config.yaml [--output-dir ./data]
# Generate a new config template
python cli/garmin_ai_coach_cli.py --init-config my_training_config.yamlOptions:
- --config PATH โ Path to YAML or JSON config
- --init-config PATH โ Create a template config at PATH
- --output-dir PATH โ Override output directory from config
Outputs:
analysis.html- Comprehensive performance analysisplanning.html- Detailed weekly training planmetrics_result.md,activity_result.md,physiology_result.md,season_plan.md- Intermediate artifactssummary.json- Metadata and cost tracking with keys:total_cost_usd,total_tokens,execution_id,trace_id,root_run_id,files_generated,competitions
The Telegram chat interface is deprecated and will be removed in a future release. Prefer the CLI. If you still need to use it temporarily:
pixi run start-devRequires TELE_BOT_KEY in your environment. See the โProject Structureโ section for legacy notes.
- Garmin Connect account (your training data source)
- LLM API key for your chosen provider (OpenAI, Anthropic, or OpenRouter)
- Optional:
LANGSMITH_API_KEYfor observability - Legacy Telegram bot requires
TELE_BOT_KEYโ see โLegacy: Telegram Bot (Deprecated)โ above
- Create your environment file:
# .env (or .env.dev)
# Choose at least one provider
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
OPENROUTER_API_KEY=...
LANGSMITH_API_KEY=lsv2_... # Optional: professional observability
# AI mode default (overridden by config's extraction.ai_mode)
AI_MODE=developmentImportant: Provider mapping and AI mode
- If you only set OPENAI_API_KEY, set your config
extraction.ai_mode: "standard"(this mode maps to an OpenAI model by default), or update the mapping inservices/ai/ai_settings.pywithinpython.AISettings()so your chosen mode points to an OpenAI model (e.g.,gpt-4o,gpt-5-mini). - The CLI exports
AI_MODEfrom your config atcli/garmin_ai_coach_cli.py; model IDs are defined inpython.ModelSelector.CONFIGURATIONS, and the provider key is auto-selected inpython.ModelSelector.get_llm().
- Install and run (CLI):
pixi run coach-init my_training_config.yaml
pixi run coach-cli --config my_training_config.yamlpip install -r requirements.txt
python cli/garmin_ai_coach_cli.py --init-config my_training_config.yaml
python cli/garmin_ai_coach_cli.py --config my_training_config.yamlChoose your analysis depth and cost balance:
development- Fast iterations, cost-effective (7-14 days data)standard- Comprehensive analysis (21-56 days data)cost_effective- Balanced approach for budget-conscious users
-
๐ค OpenAI
gpt-5,gpt-5-minigpt-4.5,gpt-4.1,gpt-4o,gpt-4o-minio1,o1-mini,o3,o3-mini,o4-mini
-
๐ง Anthropic Claude
claude-4,claude-4-thinkingclaude-opus,claude-opus-thinkingclaude-3-haiku
-
๐ OpenRouter/DeepSeek
deepseek-chat,deepseek-reasoner
Configure in services/ai/ai_settings.py by updating the stage_models mapping in python.AISettings().
Important โ provider selection depends on your AI mode:
- Default mapping in
services/ai/ai_settings.py:standardโgpt-5(OpenAI)developmentโclaude-4(Anthropic)cost_effectiveโclaude-3-haiku(Anthropic)
- The CLI exports
AI_MODEfrom your configโsextraction.ai_modeatcli/garmin_ai_coach_cli.py. - If you only set
OPENAI_API_KEY, useai_mode: "standard"(default maps to an OpenAI model) or updatestage_modelsto point your chosen mode to an OpenAI model (e.g.,gpt-4o,gpt-5-mini) inservices/ai/ai_settings.py. Available model IDs are defined inpython.ModelSelector.CONFIGURATIONS, and the provider is auto-selected inpython.ModelSelector.get_llm(). - If you only set
ANTHROPIC_API_KEY, keepai_mode: "development"or"cost_effective"(both map to Anthropic by default) or change the mapping. - If you use OpenRouter (e.g., DeepSeek), map your mode to an OpenRouter model key from
python.ModelSelector.CONFIGURATIONS.
Analysis vs Planning context:
- Analysis context: how to interpret past data (e.g., risk tolerance, injury notes, priorities)
- Planning context: how to plan future training (e.g., emphasis, constraints, races). This is freeform text interpreted by the AI.
athlete:
name: "Your Name"
email: "[email protected]"
context:
analysis: "Recovering from injury; focus on base building"
planning: "Olympic triathlon in 12 weeks; build aerobic base"
extraction:
activities_days: 7
metrics_days: 14
ai_mode: "development" # or "standard" or "cost_effective"
competitions:
- name: "Target Race"
date: "2026-04-15"
race_type: "Olympic"
priority: "A"
output:
directory: "./data"
credentials:
password: "" # Leave empty to be prompted securely at runtimeathlete:
name: "Athlete Name"
email: "[email protected]"
context:
analysis: |
Completed my first 70.3 recently. Great result but exposed durability gaps
due to last-minute shoe change. Analyze this multisport activity in detail.
planning: |
## Start Date
Plan should start on **Monday, xxxx-xx-xx**.
## Important Needs
- Functional Strength, Durability & Triathlon Transfer
Integrate explicit daily micro-workouts (5โ10 min).
Goals: run economy & lower-leg robustness; bike posture & core transfer; durability & recovery.
- Shoe Adaptation & Running Technique
Get used to carbon plate shoes (front-foot style) with targeted technique/strength.
## Session Constraints (Shoes)
- Per-session shoe exclusivity: every run is tagged either `carbon` or `non-carbon`.
## Training Preferences
- No indoor bike trainer available.
- No swimming for now.
## Training Zones
| Discipline | Base Metric |
|------------|------------------------------|
| Running | LTHR โ 173 bpm / 4:35 min/km |
| Cycling | FTP โ 271W |
| Heart Rate | Max HR โ 193 bpm |
## Closing
Provide structured daily checklists to support both athletic and personal goals.
extraction:
activities_days: 21
metrics_days: 56
ai_mode: "standard"
competitions:
- name: "Franklin Meilenlauf"
date: "2025-10-12"
race_type: "Half Marathon"
priority: "A"
target_time: "01:40:00"
output:
directory: "./data"
credentials:
password: "" # leave empty for secure interactive inputTip: The advanced details live inside the context.planning text; the system is instruction-following and will respect these constraints.
Modern state-based AI orchestration with built-in observability:
# Parallel Analysis Phase
START โ [Metrics, Physiology, Activity Data] โ Activity Interpreter
โ โ โ
Synthesis Agent โ โ โ โ โ โ โ โ โ โ โ โ โ
โ
HTML Formatter โ Plot Resolution โ ENDKey Benefits:
- โ Built-in Observability - Professional LangSmith monitoring
- โ Parallel Execution - Metrics + Physiology agents run simultaneously
- โ Automatic State Management - Typed state with reducers
- โ Error Recovery - Node-level handling and retries
๐ Local Encryption โ ๐ Data Processing โ ๐ค AI Analysis โ ๐ Report Generation
(Per-user keys) (In-memory) (API calls) (Local storage)
- Encrypted Credentials - AES-256 encryption with per-user keys
- Local Data Storage - No cloud persistence of personal data
- Secure API Calls - Direct LLM provider communication
- Usage Tracking - Transparent cost monitoring
garmin-ai-coach/
โโโ ๐ค bot/ # Telegram interface & handlers (deprecated)
โโโ ๐ core/security/ # Encryption & usage limits
โโโ ๐ง services/
โ โโโ ๐โโ๏ธ garmin/ # Data extraction & models
โ โโโ ๐ง ai/langgraph/ # Modern AI workflow system
โ โโโ ๐จ ai/tools/plotting/ # Secure visualization tools
โโโ ๐ agents_docs/ # Architecture & planning docs
โโโ โก cli/ # CLI (primary interface)
โโโ ๐ main.py # Legacy Telegram bot entry point (deprecated)
โโโ โ๏ธ pixi.toml # Dependencies & tasks
# Code Quality
pixi run lint-ruff # Linting
pixi run ruff-fix # Auto-fix issues
pixi run format # Black + isort formatting
pixi run type-check # MyPy type checking
# Testing & Analysis
pixi run test # Run test suite
pixi run dead-code # Find unused code (Vulture)
# Utilities
pixi run list-users # User management- ๐ Platform Integration - Wahoo Integration
"The AI coaching insights helped me identify training inconsistencies I never would have caught myself. My Olympic distance time dropped by 14 minutes!"
For Athletes:
- ๐ฏ Get personalized insights your Garmin doesn't provide
- ๐ Understand your training patterns and physiological adaptations
- ๐โโ๏ธ Receive science-backed recommendations for improvement
- โฐ Save hours of manual data analysis
For Coaches:
- ๐ Comprehensive athlete analysis in minutes, not hours
- ๐ง AI-powered pattern recognition across multiple data streams
- ๐ Professional reports to share with athletes
- ๐ Identify training issues before they become problems
For Developers:
- ๐๏ธ Modern LangGraph architecture with professional observability
- ๐ Security-first design with comprehensive encryption
- ๐ Scalable multi-agent system with parallel processing
- ๐จ Beautiful visualization tools and report generation
MIT License - see LICENSE for details.
We welcome contributions! The codebase uses modern Python practices with:
- LangGraph for AI workflow orchestration
- Pydantic v2 for data validation
- Pixi for dependency management
- Ruff + Black for code formatting
Built with โค๏ธ for the triathlon community
Ready to transform your training data into actionable insights?
git clone https://github.com/your-username/garmin-ai-coach.git
cd garmin-ai-coach
pixi run coach-init my_training_config.yaml
pixi run coach-cli --config my_training_config.yamlYour AI triathlon coach awaits! ๐โโ๏ธ๐ดโโ๏ธ๐โโ๏ธ