Skip to content
← Back to .dev

Conversational AI agent for personalized coaching and automated scheduling — turns natural language into structured workouts and syncs to your smartwatch.

TypeScriptVercel AI SDKWhatsAppTwiliointervals.icuRedisRAGGarmin

Live Preview

https://trainsync.ca

Overview

TrainSync is a multi-turn conversational AI agent for personalized coaching and automated scheduling. It lives in WhatsApp with persistent state, contextual memory, and a RAG pipeline. Built with the Vercel AI SDK, it creates workouts, tracks fitness metrics, and syncs to Garmin via OAuth.

Key Highlights

  • 01Multi-turn AI agent with persistent state and contextual memory across conversations
  • 02RAG pipeline for relevant training data retrieval and personalized recommendations
  • 03Natural language workout parsing: '5km easy' → structured workout
  • 04AI tools: get_recent_workouts, get_fitness_metrics, create_workout, upload_workout
  • 05Garmin API integration via OAuth for end-to-end workout sync
  • 06Performance targets: 1-3s response time, 1 Redis read per request, ~2KB user profiles
  • 07Comprehensive test suite with Vitest
  • 08Sport-agnostic: supports running, cycling, triathlon, and general fitness

Architecture

WhatsApp → Twilio → Webhook Handler → AI Agent (Vercel AI SDK) → intervals.icu + Vercel KV