Professional articles

12.01.2025

Author: Kristián Krafčík

Can AI Be Your Personalized Coach for a Healthy Lifestyle?

As we enter an era of accelerating AI advancements, the potential for AI to transform personalized healthcare and wellness has never been more significant. With AI-powered health coaching, individuals can now receive highly personalized recommendations based on an extensive array of scientific research, all tailored to their unique fitness goals, health conditions and nutritional needs.

At ESTEN, we have leveraged Vertex AI from Google Cloud to develop an intelligent system that combines cutting-edge LLM Gemini with data-driven insights, delivering highly personalized health and wellness recommendations based on an extensive collection of scientific studies. Here’s how we approached the problem and the challenges we faced, along with the innovative solutions that made it possible.

The Challenge: Personalizing Health and Nutrition Recommendations

We had access to around 1700 PDF documents containing detailed medical studies that explored the effects of various nutrients on human health. Alongside these studies, we were provided with personas - representing individuals with different fitness goals, dietary habits, alergies and health conditions. Our challenge was to build a system capable of analyzing these studies and producing accurate, personalized product recommendations for each persona, specifically from the GymBeam product catalog.

Our Approach: Building a Personalized AI System

To address this challenge, we utilized Vertex AI, a powerful tool from Google Cloud that enables scalable AI development and deployment. Here’s a detailed breakdown of how we built the system:

  1. Data Storage and Integration:

    The first step was to upload the PDFs containing scientific studies into a Cloud Storage Bucket on Google Cloud. These documents were then linked to a Datastore in the Vertex AI platform, providing us a scalable NoSQL database for efficient data storage. For product information, we used PostgreSQL to store GymBeam’s product details, dossage and nutrient compositions, ensuring we could link the right product to each user.

  2. AI Model Implementation:

    The heart of our solution was Vertex AI’s Chat Grounding capability, which enabled us to connect the AI’s output with the research data from the PDFs. By utilizing the Vertex AI Search agent, we could query our Datastore and retrieve the most relevant studies for any given nutrient. This allowed us to integrate evidence-based recommendations into our AI-driven system seamlessly.

  3. Prompt engineering phase:

    To ensure that the AI understood the specific needs of each user, we employed iterative prompt engineering. By crafting highly specific prompts, we refined the AI’s output, ensuring that it returned relevant nutrient recommendations based on the user’s profile. The model’s ability to provide personalized suggestions based on scientific studies was enhanced through the use of Vertex AI Studio and its powerful chat capabilities.

  4. Vertex AI-Chat integration:

    The AI model was integrated into our backend infrastructure using the Vertex AI SDK, which provided us with the necessary tools to deploy the chat functionality. This allowed for smooth communication between the front-end user and the Vertex AI-Chat.

  5. Personalized Nutrient Recommendations:

    The output was structured in a JSON format, listing nutrients, dosages and recommended usage times, along with the corresponding research study files.

Overcoming Challenges: Fine-Tuning AI Output

While the system was promising, we faced several challenges:

  1. AI Restrictions: Initially, the AI rejected certain recommendations, citing concerns about suggesting medical data. This happened when we tried to prompt the model with general knowledge only. We have solved this issue with mentioned Vertex AI's Grounding feature.

  2. Inconsistent Output: Despite our best efforts with precise prompts, the AI occasionally returned inconsistent results. For instance, nutrient quantities were sometimes given in words instead of numbers, making the data difficult to process. We iteratively refined the input to ensure consistency in the output.

  3. Context Management: One of the key technical hurdles was ensuring the AI’s responses were tailored to the individual user. We implemented a context-reset mechanism, ensuring that each user’s profile data was correctly processed without interference from previous interactions.

The Outcome: AI-Driven Personalized Health Coaching

After overcoming technical challenges, we successfully implemented a personalized AI health coach that could recommend GymBeam products based on scientific evidence,into our web application in React + Node.js.

Here’s an example of how it worked for a specific user persona:

Persona: A 30-year-old male, 75 kg, 185 cm tall, exercises regularly with a mix of gym workouts and cardio. He suffers from depression, is on antidepressants, and has a food intolerance to artificial sweeteners. His goals include maximizing performance at work and improving sleep quality.

Recommended Products:

  • Creatine Monohydrate: 5g daily – Enhances strength and performance during high-intensity workouts.

  • Magnesium Chelate (Bisglycinate): 3 capsules daily – Supports relaxation and enhances sleep quality.

  • Omega-3: 2 capsules daily – Promotes overall well-being and has mood-boosting effects, beneficial for managing depression.

Key Takeaways: The Future of Personalized Health with AI

This project demonstrates the power of AI in the health and wellness sector, where Large Language Models like Gemini can sift through large volumes of scientific research to deliver personalized, evidence-based recommendations. By combining AI with cloud computing and advanced data analytics, we are able to build highly efficient, scalable systems capable of offering real-time, actionable insights.

This system not only enhances the user experience but also holds immense potential for advancing AI-driven healthcare solutions, where AI can serve as a personalized health coach for anyone, anywhere.

Description image