A personal Telegram bot that makes counting calories easy. Instead of downloading a
dedicated app and searching a food database, I can simply send a natural-language message
describing what I ate. The bot uses a LLM to estimate the calorie count,
logs the entry to Google Sheets, and keeps a running daily total.
The project was built to help me lose weight by making calorie tracking as simple as possible. while I did
not manage to lose weight in the end, the bot was a fun and educational experiment
in building a real-world application using LLMs and APIs.
The Problem
Most calorie-tracking apps require you to open the app, search a specific food name, find
the right entry. It's a quick 30-second interaction, but that friction adds up over time and I
found it hard to maintain the habit.
The question was: what if tracking a meal was as easy as sending a Telegram message?
Natural language is flexible enough to describe "half a plate of chicken rice with soup"
without exact measurements, and an LLM is well-suited to convert that into a reasonable
calorie estimate.
The Solution
A Telegram bot removes all the friction: users are already in Telegram, there is no new
app to install, and sending a message is the lowest-effort interaction possible. The bot
accepts any natural-language meal description, asks the LLM to return a structured
JSON breakdown of items and estimated calories, and confirms the log in one reply.
Demonstration of meal logging, daily summary and Google Sheets integration
Features
Natural Language Meal Logging
Send any free-text description of a meal โ "two slices of toast with peanut butter
and a flat white" โ and the bot extracts items, estimates portions, and returns a
calorie breakdown per item plus a total.
Google Sheets Persistence
Every logged entry is appended to a Google Sheet โ one row per food item, with
columns for timestamp, description, quantity, and calories. A new sheet tab is
created automatically each week to keep the data organised.
Daily Summary on Demand
Send /list at any point and the bot replies with the day's total
calories, a breakdown of all meals logged, and a comparison against a configurable
daily target.
Architecture
Request flow:
User sends meal description via Telegram
Bot receives update via Telegram Bot API webhook
Message text passed to Groq LLM with a structured prompt requesting JSON output
LLM returns item list with calorie estimates per item
Rows appended to the active week's Google Sheet via Sheets API