← All projects
GenAI · own product · 2026

Nutrigordo

A nutrition assistant in Telegram. Meals are logged by text, photo or voice, and a PDF report is ready for your nutritionist.

model reads · code counts1,840kcal today● protein● carbs● fat

Built with

28typed actions the model can ask for
136automated tests
67scenarios built from real conversations
0hardcoded lists of foods or words

The problem

Trackers ask for grams. People say “the usual toast”. The bot had to understand that and still keep numbers a nutritionist can trust.

How a message is processed

A message arrives in Telegramtext, photo, album or voice note
FastAPI webhookTelegram gets an instant reply; the work continues in the background with a per-user lock
The model interprets the messagevoice notes are transcribed first; the reply is a list of typed actions validated against schemas
Code checks and saves every actiondates, duplicates and undo; branded products are looked up on the web
Reply with buttonsUndo, Save as is, answers to tap
language modelcodeTelegram

The design rule

The model interprets; the code decides. The model only returns structured fields; totals, dates and anything that deletes are handled in code.

Two failures that shaped it

A complaint undid a whole voice note

“110 calories for one cookie is impossible” was read as undo, and a whole lunch disappeared. Undo now needs a second check.

A product with several sizes got a random one

A can of soda was worth 66 or 106 kcal depending on which size the search found. Now the size is asked, with the real sizes as buttons.

Both are tests now. Fast tests block every deploy; real conversations are replayed against the model only where the code changed.

Stack

Telegram webhook, one FastAPI process on Render, OpenAI with outputs validated by Pydantic, and Supabase with row-level security per user.

The code is private. The web demo is a guided walkthrough of a real day with the assistant and does not need Telegram or an account.