Your AI-powered nutrition co-pilot with full observability
NutriPilot transforms food photos into personalized nutrition insights using a multi-agent ReAct architecture. Built for the "Commit to Change" AI Agents Hackathon.
Manual nutrition tracking is:
- Tedious: Logging a complex meal takes 10-15 minutes
- Inaccurate: Portion estimation errors of 30-50% are common
- Impersonal: Generic apps ignore your health goals and conditions
NutriPilot uses Gemini 2.0 Flash vision capabilities to:
- πΈ Instant Analysis: Upload a food photo β get complete nutrition breakdown in seconds
- π― Goal-Personalized Feedback: Recommendations tailored to your health goals (weight loss, diabetes, heart health)
- π Self-Improving: Calibration system learns from verified meals to improve accuracy
- π Fully Observable: Every AI decision traceable via Comet Opik
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Next.js Frontend β
βββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FastAPI Backend β
βββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β StudioOrchestrator (ReAct Pattern) β
β βββββββββββ βββββββββββ βββββββββββ β
β β OBSERVE β βββΆβ THINK β βββΆβ ACT β β
β βββββββββββ βββββββββββ βββββββββββ β
ββββββββββ¬βββββββββββββ¬ββββββββββββββββ¬ββββββββββββββββββββββββ
β β β
βΌ βΌ βΌ
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
βVisionAnalyst β β NutriAuditor β βGoalEvaluator β
β (Gemini 2.0) β β (USDA API) β β (Personalize)β
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β β β
ββββββββββββββ΄ββββββββββββββββ
β
βΌ
ββββββββββββββββββββ
β Comet Opik β
β (Observability) β
ββββββββββββββββββββ
| Agent | Role | Technology |
|---|---|---|
| VisionAnalyst | Food detection & portion estimation | Gemini 2.0 Flash Vision |
| BioDataScout | Fetch user health constraints | HealthKit (mock) |
| NutriAuditor | Validate nutrition data | USDA FoodData Central API |
| GoalEvaluator | Personalize recommendations | Goal-based rule engine |
| NutriCalibrator | Improve accuracy from feedback | Opik trace analysis |
- Python 3.11+
- Node.js 18+
- API Keys: Gemini, Opik, USDA (optional)
cd backend
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
# Configure environment
cp .env.example .env
# Edit .env with your API keys
# Run server
uvicorn app.main:app --reload --port 8000cd frontend
npm install
# Configure environment
cp .env.example .env.local
# Edit .env.local if needed
# Run dev server
npm run devVisit http://localhost:3000 to use NutriPilot!
# Upload any food image
POST /analyze
Content-Type: multipart/form-data
image: <food_photo.jpg>
user_id: demo_userResponse includes:
- Detected foods with portions
- Complete macronutrient breakdown
- Goal-specific feedback
- Overall meal score
Supported goals:
- π Weight Loss / Weight Gain
- πͺ Muscle Building
- β€οΈ Heart Health
- π©Ί Diabetes Management
- β‘ Energy & Vitality
The calibration system:
- Collects Opik traces from meal analyses
- Compares estimated vs verified calories
- Identifies systematic errors (e.g., "fried foods underestimated")
- Generates prompt improvement suggestions
Every request is traced:
orchestrator.process- Full analysis flowvision_analyst.process- Image analysisnutri_auditor.process- Nutrition validationgoal_evaluator.process- Personalization
nutripilot/
βββ backend/
β βββ app/
β β βββ agents/ # AI agents
β β β βββ vision_analyst.py
β β β βββ nutri_auditor.py
β β β βββ goal_evaluator.py
β β β βββ nutri_calibrator.py
β β βββ core/ # Orchestrator, state, schemas
β β βββ tools/ # External API wrappers
β β βββ main.py # FastAPI app
β βββ requirements.txt
βββ frontend/
β βββ app/ # Next.js pages
β βββ components/ # React components
β β βββ ImageUpload.tsx
β β βββ AnalysisResults.tsx
β β βββ Dashboard.tsx
β β βββ CalibrationReport.tsx
β βββ package.json
βββ opik_evals/ # Evaluation framework
β βββ actionability_metric.py
β βββ goal_adherence_metric.py
β βββ production_eval.py
βββ README.md
Run the evaluation suite:
cd opik_evals
pip install -r requirements.txt
python run_evaluation.pyCustom metrics:
- Actionability Score: Are suggestions specific and actionable?
- Goal Adherence Score: Does feedback align with user goals?
| Layer | Technology |
|---|---|
| LLM | Google Gemini 2.0 Flash |
| Backend | FastAPI, Pydantic v2 |
| Frontend | Next.js 14, React, Tailwind CSS |
| Observability | Comet Opik |
| Data | USDA FoodData Central API |
π₯ Watch Demo Video
π Opik Dashboard
Built with β€οΈ for the Commit to Change: An AI Agents Hackathon
MIT License - see LICENSE for details.
