<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Sujnesh</title>
    <description>The latest articles on Forem by Sujnesh (@sujnesh).</description>
    <link>https://forem.com/sujnesh</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3828159%2Ff15805a1-f7dd-470c-ab80-c5e895b32345.png</url>
      <title>Forem: Sujnesh</title>
      <link>https://forem.com/sujnesh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/sujnesh"/>
    <language>en</language>
    <item>
      <title>Building RepWise: A Live AI Gym Coach That Rescues Your Workout</title>
      <dc:creator>Sujnesh</dc:creator>
      <pubDate>Mon, 16 Mar 2026 21:55:05 +0000</pubDate>
      <link>https://forem.com/sujnesh/building-repwise-a-live-ai-gym-coach-that-rescues-your-workout-1f86</link>
      <guid>https://forem.com/sujnesh/building-repwise-a-live-ai-gym-coach-that-rescues-your-workout-1f86</guid>
      <description>&lt;h1&gt;
  
  
  Building RepWise: A Live AI Gym Coach That Rescues Your Workout
&lt;/h1&gt;

&lt;p&gt;&lt;em&gt;This article was created for the purposes of entering the &lt;a href="https://geminiliveagentchallenge.devpost.com/" rel="noopener noreferrer"&gt;Gemini Live Agent Challenge&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;Most people don't quit workouts because they're lazy. They quit because something breaks.&lt;/p&gt;

&lt;p&gt;The bench is taken. Energy crashes mid-session. A movement hurts. You don't recognize the exercise your plan says to do next. You only have 15 minutes left instead of 30.&lt;/p&gt;

&lt;p&gt;These are real friction points that happen in every gym, every day. And no fitness app handles them. They generate a plan, hand it to you, and disappear.&lt;/p&gt;

&lt;p&gt;I wanted to build something that stays with you — and adapts when things go wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  What RepWise Does
&lt;/h2&gt;

&lt;p&gt;RepWise is a beginner-friendly, friction-aware live gym companion that runs in the browser.&lt;/p&gt;

&lt;p&gt;Here's the flow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Quick Setup&lt;/strong&gt; — You tell RepWise your level (beginner/intermediate), goal (build muscle, lose fat, quick session), available time, equipment, energy level, and context (crowded gym, low confidence, soreness).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Mission Generation&lt;/strong&gt; — Gemini generates a personalized workout plan with exercises, sets, reps, warmup, and coaching cues tailored to your inputs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Live Coaching&lt;/strong&gt; — Your phone camera tracks your movement using MediaPipe pose detection. RepWise counts reps, tracks sets with rest intervals, detects form issues (leaning forward, insufficient depth), and provides real-time&lt;br&gt;
coaching cues from Gemini.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Workout Rescue&lt;/strong&gt; — This is the core differentiator. When friction hits, you tap Rescue and select a reason: Equipment Busy, Low Energy, Short on Time, Discomfort, Don't Know This Exercise, or Easier Please. RepWise instantly&lt;br&gt;
rewrites the remaining workout while preserving your original goal.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Mission Complete&lt;/strong&gt; — A grounded summary showing actual exercises performed, sets completed, form score, and a Gemini-generated coaching debrief with next-step recommendations.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Why Workout Rescue Matters
&lt;/h2&gt;

&lt;p&gt;Rep counting and form detection are useful, but they're expected. Every fitness AI does some version of that.&lt;/p&gt;

&lt;p&gt;Workout Rescue solves a different problem: &lt;strong&gt;keeping the session alive when real-world conditions change.&lt;/strong&gt; It's the moment where the AI stops being a tracker and starts being a coach — one that makes a decision under changing&lt;br&gt;
  constraints, explains it, and keeps you moving.&lt;/p&gt;

&lt;p&gt;That's the kind of agency the Gemini Live Agent Challenge is about.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Gemini Is Used
&lt;/h2&gt;

&lt;p&gt;RepWise uses Gemini in three distinct ways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Gemini Live API (via ADK bidi-streaming)&lt;/strong&gt; — Real-time coaching during the workout session. Pose events and session context are streamed to Gemini, which responds with contextual coaching cues via WebSocket.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Gemini 2.5 Flash (structured planning)&lt;/strong&gt; — Workout generation, warmup creation, and exercise adaptation. The model returns structured JSON that the backend parses into exercise plans with sets, reps, and cues.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Gemini 2.5 Flash (reasoning)&lt;/strong&gt; — Post-workout debrief generation and workout rescue logic. When rescue is triggered, Gemini evaluates the remaining plan against the new constraint and produces a coherent adaptation.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How Google Cloud Is Used
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cloud Run&lt;/strong&gt; — The FastAPI backend is containerized and deployed to Cloud Run. Handles WebSocket connections for live coaching, REST APIs for session management, and Gemini API calls.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cloud Firestore&lt;/strong&gt; — Stores workout sessions with full rep event data, form scores, coaching summaries, and anonymous user profiles for continuity across sessions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Automated deployment&lt;/strong&gt; — A single &lt;code&gt;deploy.sh&lt;/code&gt; script enables, provisions, and deploys the entire stack.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Tech Stack
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;Technology&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Frontend&lt;/td&gt;
&lt;td&gt;JavaScript, HTML, CSS&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pose Detection&lt;/td&gt;
&lt;td&gt;MediaPipe Tasks Vision (in-browser)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Backend&lt;/td&gt;
&lt;td&gt;Python, FastAPI&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AI Coaching&lt;/td&gt;
&lt;td&gt;Gemini Live API + ADK&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AI Planning&lt;/td&gt;
&lt;td&gt;Gemini 2.5 Flash&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Deployment&lt;/td&gt;
&lt;td&gt;Google Cloud Run, Docker&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Persistence&lt;/td&gt;
&lt;td&gt;Google Cloud Firestore&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Testing&lt;/td&gt;
&lt;td&gt;Pytest (111 tests)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  What I Learned
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;MediaPipe in the browser is surprisingly capable.&lt;/strong&gt; Running pose detection at 10fps with joint angle computation and rep counting — all client-side — keeps the architecture simple and latency low.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Semantic events beat raw data.&lt;/strong&gt; Sending Gemini a structured pose event like &lt;code&gt;{"exercise": "squat", "rep": 8, "form_issue": "leaning_forward"}&lt;/code&gt; produces much better coaching than sending raw landmark coordinates.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fallbacks are non-negotiable for demos.&lt;/strong&gt; Every Gemini call has a deterministic fallback. Workout generation, rescue, warmup, debrief — all have local logic that activates if the API is slow or unavailable. The demo never breaks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Beginner/intermediate branching changes everything.&lt;/strong&gt; The same app feels meaningfully different for a beginner (3 simple exercises, reassuring cues, longer rest) versus an intermediate user (more exercises, tighter language,&lt;br&gt;
  performance framing). Small backend logic, big UX impact.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try It
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Live&lt;/strong&gt;: &lt;a href="https://repwise-384586125133.us-central1.run.app" rel="noopener noreferrer"&gt;repwise-384586125133.us-central1.run.app&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Code&lt;/strong&gt;: &lt;a href="https://github.com/sujnesh/repwise" rel="noopener noreferrer"&gt;github.com/sujnesh/repwise&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Built for the &lt;a href="https://geminiliveagentchallenge.devpost.com/" rel="noopener noreferrer"&gt;Gemini Live Agent Challenge&lt;/a&gt; — March 2026.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>gemini</category>
    </item>
  </channel>
</rss>
