The T3 Project
A personal training app that brings together my Garmin runs, training plan, nutrition targets and recovery, with an AI coach that can read all of it.
Overview
I’ve been working on this as both a personal training tool and a way to deepen my understanding of application architecture, AI systems, and what it takes to make different pieces work together reliably.
The idea is to bring together the things that shape my training: what I ran, what I’m planning to run, how I’m fuelling it, and what’s happening with my recovery.
These features work today:
- Activities: syncs Garmin automatically every 5 hours. Shows each run with distance, pace, heart rate, cadence, elevation and calories, plus kilometre splits.
- Training: calculates my VDOT and pace zones from a recent race using Jack Daniels’ formula. Sets heart rate zones from resting, max and threshold HR. Generates a phased training plan (base → build → peak → taper) and a Comeback plan with conservative and aggressive return-VDOT targets after time off.
- Nutrition:
- Energy: BMR (Mifflin-St Jeor) scaled to TDEE by activity level, then adjusted for my goal.
- Daily targets: calories, carbs, protein, fat, fiber and water, plus calcium, magnesium, iron, potassium and sodium. These come from a DRI-based calculator and I can edit them.
- Fuelling: pre-run, during-run and post-run plans, diet type, allergies and intolerances, and my supplement stack.
- Injury & Recovery: keeps track of my current injury and recovery context so Ask Intelligence can take it into account when I ask questions about training. For example, I can ask what strength exercises might help me train around an injury, with the relevant context available to the agent.
- Runner Profile: physiology, experience, weekly volume, longest run and available training time. The training and nutrition numbers are calculated from this.
- Knowledge Corpus: I upload sports-science, nutrition and training documents. They’re chunked, embedded and stored in pgvector for search.
- Ask Intelligence: a Gemini agent with ten read-only tools covering activities, splits, training profile, PRs, recovery, goals, profile, nutrition, schedule and knowledge search. It decides which tools to call before answering. This lets me ask questions that require context from different parts of the app, such as what training or strength work might make sense given my current injury and recent training. If a model is overloaded, it falls back to the next Gemini model, then to Mistral, and every call is traced in Langfuse.
Context
Garmin tells me what I ran, and a spreadsheet tells me what I should eat, but neither knows about the other, and neither can tell me what either one means for tomorrow.
I wanted a single place built on formulas I trust: Daniels for pacing, Mifflin-St Jeor and WHO/IOM for nutrition. I also wanted a coach that could read all of it.
I also wanted the app to understand that training doesn’t happen in a vacuum. I might be coming back from time off, dealing with an injury, or simply trying to figure out how to train around something that’s bothering me.
Rather than building a separate injury-management system, I wanted that context to be available to the AI coach. That way I can ask something like, “What strength training can I do to better manage this injury?”, and have the answer take into account what it already knows about my training, recovery, and goals.
The project has also become a way for me to deepen and apply what I’ve been learning about application architecture and AI systems. Rather than studying each component in isolation, I’ve been figuring out how they work together in something real: the data layer, APIs, frontend, retrieval, agent, tools, observability, and the logic connecting them.
My first design for the coach was a nine-stage multi-agent pipeline. I eventually replaced it with one agent that decides which data to pull. That change was useful beyond the architecture itself, because it made me think about what the application actually needs, rather than adding complexity simply because the technology makes it possible.
Problem
There were two problems I kept coming back to.
The first was making the numbers trustworthy. Nutrition targets had to come from established formulas, not LLM guesses, so the calculations are deterministic and the agent reads them through a tool instead of inventing them. The same principle applies to training calculations: if a number can be calculated reliably, I would rather calculate it than ask a model to guess.
The second was knowing whether the agent was actually using the application intelligently, and the Langfuse traces showed that it wasn’t always. A plain “Hi” triggered two data lookups and took 11 seconds. “What are some core workouts?” called four tools, three of them about my personal data, and took 45 seconds.
Those weren’t just performance issues. They showed me that giving an agent access to more information doesn’t automatically make it better. It needs to know what information is relevant, when to retrieve it, and when it doesn’t need anything at all.
The same thinking applies to personal context. A question about strength training is different when the system knows what I’ve been training for, what I’ve recently done, and what I’m currently dealing with. The challenge is making that context available without making every question unnecessarily complicated.
Reflection
I’ve been learning a lot from this project, but not all of it is about running or AI.
It’s become a way for me to apply and deepen what I already know about developing AI applications, while getting more comfortable with the parts that only become obvious when you have to make the whole thing work together. I’ve had to think about architecture, data models, APIs, frontend components, retrieval, agent design, tool selection, observability, performance, failure cases, and how different pieces of personal context should flow through the system.
I’ve also found that the interesting problems aren’t always about generating an answer. Sometimes the useful part is giving the AI enough context to make the answer relevant. A question like “What strength training can I do?” could produce a generic answer, but when the system knows my training history, goals, recovery, and current injury context, it becomes a much more specific question.
That’s the part of AI applications I’m particularly interested in: figuring out what information a model should have before it answers.
I’m still changing the architecture as I learn more, and some parts will probably be replaced, simplified, or rebuilt. That’s fine. I’m less interested in getting the architecture right on the first attempt than in understanding why it should work a certain way.
The T3 Project is a training app, but it’s also become my sandbox for exploring how data, deterministic logic, AI, and personal context can work together in a real application. The training data just happens to be mine.