Friday, September 19, 2025

Part 3: Next-Gen Personal Running and Health Coach: Smarter AI, Deeper Insights, and Context-Aware Analytics

 Part 1 — https://medium.com/@bhattshailendra/extracting-running-data-out-of-nrc-nike-nike-run-club-using-apis-bcee76a714c3

Part 2 — https://medium.com/@bhattshailendra/from-extracting-running-data-to-transforming-it-into-ai-powered-insights-with-nike-nrc-strava-0f19742b2f11

Building on Part 2’s foundation of extracting, embedding, and querying running data from Nike NRC, Strava, Garmin, and OpenAI-powered vector search, in this part I have expanded the application to incorporate multimodal data, contextual external knowledge, and agentic tooling for more accurate AI insights.

My architecture now does the following:

Press enter or click to view image in full size


Step 1 — Multiple running, knowledge based and health data sources are ingested and normalized into the back-end.

Step 2 — Data — including multi-modal records are embedded and stored in the vector database.

Step 3 — User queries are routed through the chat app initiate vector-based similarity searches for pertinent personal data.

Step4 — The OpenAI GPT-5 LLM synthesizes responses, enhanced by injected external knowledge and agentic tool outputs.

Step 5 — Insights and predictions are returned in conversational form, evolving with feedback and new data.

Sunday, September 14, 2025

Part 2 - From Extracting Running Data to transforming it into AI-Powered Insights with Nike NRC, Strava, Garmin and OpenAI

Few years back in my earlier article (https://www.shailendrabhatt.com/2020/11/extracting-running-data-out-of-nrcnike.html), I explained how to extract running data from Nike NRC using public endpoints and basic API scripts. At that time, this was a step up from manual tracking, a way to view runs, pace, and totals using dashboards and exported files. Seeing progress week-to-week and analyzing simple trends locally felt empowering and encouraging to go back to do the next run. Also, back then running api's were publically available, which they no longer are and that was another reason to store this information locally for future references. 


Part 1 - Feeding Historical data to Open AI

In this article, I am trying to move beyond static tracking to an autonomous coach that suggests plans in real-time based on historical data. Instead of just visualizing past metrics in dashboards, I have tried using OpenAI’s models (GPT-5) and vector search databases to analyze my performance. The idea was to use the tools to correlate training variables and create predictions for upcoming runs, all based on my own historical data.

Part 2 - Storing run data into Vector Database

Leveraging OpenAI’s LLMs, I added chat-based analysis—so the app answers training questions  in natural language instead of just showing numbers. 




Step 1: The first step was bringing together Nike NRC, Strava data into a unified dataset. After several manually exporting activity logs, I finally automated the pipeline for both Nike NRC and Strava using API's. The updated codebase is present here --> https://github.com/shailendrabhatt/runanalysis-usingopenai 

Step 2: The next step was feeding the data into a Vector database. All summary of runs are sent to the Open AI's embedding endpoint.

var embeddingPayload = new { input = runSummary, model = "" };var response = await httpClient.PostAsJsonAsync("https://api.openai.com/v1/embeddings", embeddingPayload);var embedding = await response.Content.ReadFromJsonAsync<EmbeddingResponse>();

For semantic analysis, runs and embeddings are indexed using a vector database

Step 3: The application features a chat window. When prompted about my running trends or wanting any advice, the chat backend sends context data with the query to the OpenAI endpoint:

var gptRequest = new {    model = "gpt-4-turbo", messages = new[] { new { role = "system", content = "You are a running coach." },      new { role = "user", content = "Analyze my last four days of training and suggest improvements." }  } };var resp = await httpClient.PostAsJsonAsync("https://api.openai.com/v1/chat/completions", gptRequest);

By integrating OpenAI’s GPT-based models as a chat interface on top of my fitness vector database, I can now do more than just browse charts:

I ask, “When did I last have a similar training block to this month?”, and the LLM summarizes and compares periods—even if I don’t remember the dates or specific workouts.

Even questions like, “Did my pace improve after switching shoes?” or “Which kind of recovery week led to my highest VO2max gains?” The LLM pulls contextually relevant vectors (embeddings) from the DB that has almost 10 years of my running information, draws parallels and trends, and gives coherent, actionable feedback.

I have now started to actually trigger the query just before a workout to evaluate how long I should do that specific run. The next step is to fetch the Garmin data, which seems to be a tricky case and then integrate the heart rate, stress levels to get more accurate feedback. 

Building Microservices by decreasing Entropy and increasing Negentropy - Series Part 5

Microservice’s journey is all about gradually overhaul, every time you make a change you need to keep the system in a better state or the ...