Documentation Index
Fetch the complete documentation index at: https://mintlify.com/JuanSebasSV/healtyhelp/llms.txt
Use this file to discover all available pages before exploring further.
NutriBot — AI Nutrition Assistant
NutriBot is HealtyHelp’s built-in conversational assistant. It uses the Groq SDK with the LLaMA 3.3 70B Versatile model to answer nutrition and recipe questions, always staying within the context of the user’s personal health profile and the platform’s recipe catalog.How NutriBot Works
Every time a user sends a message, the server:- Fetches the user’s
name,healthProfile, andalergiafields. - Fetches the full recipe catalog, selecting only
nombre,desc,cat,salud,ingredientes, and corenutrifields (cal,prot,carb,gras). - Filters recipes by the user’s active
categorias(if any) and then removes any recipe whose ingredients contain an allergen from the combined allergy list. - Assembles a system prompt that includes the configurable base prompt, the filtered recipe list, and the user’s full health profile.
- Appends the last 10 conversation turns as chat history (user and assistant roles).
- Sends everything to Groq and streams back the response.
AI Model Configuration
| Parameter | Value |
|---|---|
| SDK | groq-sdk (Node.js) |
| Model | llama-3.3-70b-versatile |
max_tokens | 1024 |
| System prompt | Loaded from AIConfig MongoDB document (cached for 60 seconds) |
Allergy Filtering
Before the recipe list is sent to the AI, any recipe that contains an allergen in itsingredientes array is removed:
healthProfile.alergias[]— set via the health profile formalergia— the legacy single-value field
System Prompt Structure
The system prompt sent to Groq is assembled at request time and includes:- The configurable base prompt — loaded from the
AIConfigcollection (see Configuring the AI Prompt). - The filtered recipe list — one line per recipe in the format
• Nombre [cat] | Nkcal | desc. - The user’s health profile — conditions, active food categories, allergies, and preferences.
- Behavioral rules — constraining the model to only recommend listed recipes and respect medical conditions.
Example System Prompt Excerpt
This is the default prompt stored in theAIConfig document:
Conversation History
The last 10 messages from the client-sidehistory array are included in each request. Messages with role: "model" are mapped to role: "assistant" for the Groq API. The history is trimmed to always start with a user turn:
The Two Chat Interfaces
Floating Widget (RobotIA)
A small robot icon button fixed to the bottom-right corner of every page. Clicking it toggles a compact ChatCore panel. From this panel the user can expand to the full chatbot page via an “Expandir” button that navigates to /chatbot.
Full Chatbot Page (VistaChatbot)
Accessed at /chatbot. Features a two-column layout:
- Left panel — branding, and a list of NutriBot’s topic capabilities (chronic conditions, special diets, adapted recipes, allergies/intolerances, nutritional advice).
- Right panel — full-height
ChatCorein expanded mode with a “Minimizar” button that returns to the floating widget.
useChatStore hook, so the conversation history is preserved when switching between them.
Health Profile Management
Users configure the profile that NutriBot uses via the health profile settings form, which calls:condiciones, categorias, alergias, and preferencias arrays.
Configuring the AI Prompt
Read the current prompt
Update the prompt (authenticated users)
AIConfig MongoDB collection (single document) and cached in memory for 60 seconds (CONFIG_TTL_MS = 60 * 1000). Updating the prompt via the API clears the cache immediately (_configCache = null).
AIConfig Model
Rate Limit Handling
Groq returns HTTP429 when the API quota is exceeded. The server catches this (and 503, 500, 400, and quota-related error messages) and returns a user-friendly response instead of an error:
error === "rate_limit" and display the reply text in the chat bubble rather than throwing an error.
What NutriBot Will and Won’t Answer
NutriBot will help with:- Questions about any recipe in the catalog (ingredients, nutrition, preparation)
- Recommendations for recipes that fit the user’s health profile
- General nutrition guidance (macros, vitamins, minerals, hydration)
- Advice tailored to health conditions (diabetes, hypertension, keto, etc.)
- Clarifying the user’s active filters and conditions
- Answer questions outside nutrition, recipes, and healthy eating
- Invent recipes that are not in the filtered catalog
- Ignore the user’s allergens (allergen-containing recipes are removed before the prompt)
- Provide specific medical diagnoses or replace professional healthcare advice