Screenshot of RecipeSnap.

Building a Peloton AI Personal Trainer


GitHub Repo

Recommendations don’t feel personal when dozens of options are displayed to the end user. Everyone has experienced scrolling through a seemingly endless number of options. I wanted to explore how LLMs can help alleviate recommendation fatigue and provide a more personal app experience. To explore this idea I decided to use Peloton, a service I should use every day, but definitely find myself falling behind.

Building the agent involved a few steps:

  1. Define the tools the agent has available. The tools definded in tools.py interact with the unofficial Peloton API to access workout history of the user as well as the classes available on the Peloton platform. Peloton also has a GraphQL API for managing classes classes in a user's stack within the app.
  2. Define the agent parameters. This includes defining the LLM to use, defining agent parameters, informing the agent of the tools available, and how to process agent output.
  3. Finally Streamlit is used to build a simple UI layer for the user to interact with the agent.

Here's a snippet of the agent in action!



For the most part I've been impressed with the recommendations from the agent. I've been able to offload the decision burden and focus on doing my workouts. When I do have a preference on a given day the chat interface allows me to instruct the agent to adjust that day's workout accordingly. Since I've been using my Pelo-Buddy I've been better at staying on track with my workouts. I've also been introduced to different class types and instructors than I would have otherwise.

There are a couple areas the agent makes errors:

  1. The agent doesn't always abide to the recommended workout time. By default the agent is instructed to keep workouts to 30 minutes unless the user instructs otherwise. The agent will sometimes recommend longer workouts. I'm trying to make these recommendations more consistent.
  2. After the agent recomments a workout it correctly understands the next step is to ask the user to add the workout to their stack. However, the agent doesn't always copy the class ID correctly to add to the stack that results in an error.

I'm going to continue to test out the agent. Make it more reliable and maybe add some more functionality. All the code is available on GitHub. Give it a try and let me know what you think!