
04 — Work
Pachico AI Nutrition Coach
Project Overview
Pachico (🍉) is an intelligent nutrition coaching agent built on LangGraph that helps users log meals, track macronutrients and hit nutrition goals through Telegram, a Next.js web app or a CLI. Designed as an affordable alternative to MyFitnessPal without paying the $11.77/month subscription. The agent queries the USDA FoodData Central database for authoritative nutrition data, generates macronutrient charts on demand and surfaces recipe suggestions, all for around $1.60/month in token spend (≈86% cheaper than MyFitnessPal).
Project Details
- Timeline
- November 2025
- Role
- Solo Developer — AI Engineer
- Team
- Solo
Challenge
Building a personal nutrition tracker capable of matching MyFitnessPal's daily-driver workflow: meal logging, macro tracking, weekly and monthly visualizations, and recipe suggestions without the $11.77/month subscription, and without burning token budget on every LLM call. The agent also had to feel reliable across three very different surfaces (Telegram chat, a Next.js web UI and a CLI) while preserving conversation memory across sessions.
Approach
Router-based LangGraph design: A structured-output Router (Instructor + Pydantic) classifies every message into exactly one of four paths — food_entry, data_review, chart, or general chat. Keeping each subgraph focused and predictable.
SQL-first analytics: Instead of pushing 30 days of meal history into the model context, the agent issues SQL queries against PostgreSQL and only feeds aggregated results back to the LLM, slashing token usage and latency.
Tools that return user-ready output: Charts are rendered server-side with Matplotlib and food entries are persisted through Pydantic-validated tools — the LLM orchestrates, it never generates the deliverables itself.
Authoritative data + transparent fallbacks: USDA FoodData Central is queried first; LLM estimations are used only as a fallback and are explicitly tagged as low-confidence.
One backend, three surfaces: A single FastAPI `/api/chat` endpoint serves the Telegram bot, the Next.js web client and the CLI, with LangGraph's checkpointer persisting per-thread conversation state.
Key Results
- —Built end-to-end in 9 hours
- —~$0.33/week in token cost (~$1.60/month, 86% cheaper than MyFitnessPal)
- —Single /api/chat endpoint serving Telegram, web and CLI simultaneously
- —Authoritative USDA nutrition data with clearly-labelled LLM fallbacks
Key Features
LangGraph router with four specialised subgraphs
USDA FoodData Central integration with LLM fallback
Human-in-the-loop confirmation before DB writes
Matplotlib-rendered macronutrient charts (weekly / monthly)
Multi-channel access: Telegram, Next.js web and CLI
Persistent conversation memory via LangGraph checkpointer
Gallery
Image

Image

Image

Image

Future Improvements
Vision-based food logging (photo → estimated portions with Human-in-the-Loop confirmation), barcode scanning, fitness-tracker integrations, and a richer web UI to close the remaining gap with MyFitnessPal.