An Intelligent Multi-Agent Nutrition Assistant Powered by Google ADK & Gemini
NutriPlan AI is a fully featured multi-agent system designed to generate safe, personalized daily meal plans, compute macronutrients, and retrieve real-world nutrition facts via search.
It demonstrates practical use of LLMβpowered agents, sequential workflows, custom tools, memory reasoning, observability, and automated evaluation.
I personally built this project because I often struggle with the everyday question:
βWhat should I eat today?β
NutriPlan AI answers that question with structure, safety, and intelligence.
- Project Overview
- Demo
- Installation
- Running the Agent
- Project Architecture
- Multi-Agent Design
- Tooling
- Memory & Context Handling
- Safety Guardrails
- Observability & Logging
- Evaluation
- Project Structure
- Requirements
- License
NutriPlan AI is an intelligent, multi-agent nutrition assistant that helps users:
β Generate a personalized 1βday meal plan
β Calculate recommended macros based on calorie targets
β Retrieve nutrition facts using real Google Search
β Maintain lightweight memory during the conversation
β Enforce health safety guardrails for extreme calorie values
β Provide observability through logging and evaluation tooling
The system is built to be:
- Modular β each agent handles one responsibility
- Safe β strict calorie guardrails prevent harmful recommendations
- Intuitive β detects greetings, help requests, farewells, nutrition queries, and plan requests
- Extensible β additional tools or agents can be plugged in seamlessly
Clone the repository:
git clone https://github.com/minasmz/nutriplan-ai-agent.git
cd nutriplan-ai-agentCreate (optional) a virtual environment:
python3 -m venv venv
source venv/bin/activateInstall Google ADK with all extras:
pip install "google-adk[all]"Inside the project folder:
adk run nutriThis launches your full NutriPlan AI assistant.
NutriPlan AI is built using a root router agent that delegates every user message to the appropriate sub-agent:
User β Root Agent β {Greeting, Help, Preprocess, Meal Planner, Nutrition Search, Farewell}
- GreetingAgent β triggers on simple greetings
- HelpAgent β explains capabilities
- FarewellAgent β exits politely
- NutritionSearchAgent β answers nutrition fact questions
- NutritionFlowGroup (SequentialAgent)
- NutritionPreprocessAgent collects:
- daily_calories
- dietary_preferences
- NutritionistPlannerAgent generates macros + meal plan
- NutritionPreprocessAgent collects:
- Router chooses EXACTLY ONE agent per turn
This ensures clarity, determinism, and removes ambiguity.
NutriPlan AI demonstrates three key ADK concepts:
All agents run on Gemini 2.5 Flash, each with different instructions.
NutritionFlowGroup chains:
- Preprocessing
- Planning
Ensuring the meal plan is only produced when all inputs are known.
The root agent uses explicit tool-selection rules to determine flow.
NutriPlan AI uses two categories of tools:
A handcrafted macro calculator:
def calculate_macros(daily_calories: int) -> dict:
# 30% protein, 40% carbs, 30% fats
...
return {"protein_g": ..., "carbs_g": ..., "fats_g": ...}Used by NutritionistPlannerAgent to create the Recommended Macros section.
from google.adk.tools import google_searchUsed by NutritionSearchAgent to answer questions like:
- βHow many calories are in an avocado?β
- βIs brown rice higher in fiber than white rice?β
Although ADKβs full session memory tools aren't used here,
NutritionPreprocessAgent reads the entire conversation history to detect:
- previously stated calories
- previously stated dietary preferences
This prevents repetitive questions and creates a lightweight memory layer.
The planner refuses to generate a meal plan if:
daily_calories < 1000 OR > 5000
The agent returns a medical safety warning instead.
This demonstrates safe LLM deployment practices.
The project uses:
logger.info("Calculating macros for daily_calories=%s", daily_calories)ADK automatically outputs:
- Tool calls
- Agent routing
- LLM responses
- Execution metadata
tail -F /path/to/agents_log/agent.latest.logNutriPlan AI includes a custom eval set:
evals/nutriplan_basic_evalset.json
Run evaluation:
adk eval nutri evals/nutriplan_basic_evalset.json > evals/results.jsonADK stores results under:
nutri/.adk/eval_history/
tool_trajectory_avg_scoreresponse_match_score
nutriplan-ai/
β
βββ nutri/
β βββ agent.py
β βββ __init__.py
β
βββ evals/
β βββ nutriplan_basic_evalset.json
β βββ results.json
β
βββ README.md
- Python 3.11+
- google-adk (installed via pip)
- Gemini API key configured as:
GOOGLE_API_KEY
This project is released under the MIT License.
Feel free to fork, extend, remix, and build upon it.
This work was developed as part of the Kaggle Agents Intensive Capstone Project:
π https://www.kaggle.com/competitions/agents-intensive-capstone-project/
If you use this project or build on it, Iβd love to hear about it!
Happy learning! π






