Skip to content

Case study · Telegram assistant for voice and text records

PR-Agent

A privacy focused Telegram bot and Mini App that turns text or voice notes into work logs, notes, expenses, reminders, goals and meal entries. Built with FastAPI, Next.js and Supabase PostgreSQL.

By · Updated

PR-Agent banner: a friendly robot assistant surrounded by icons for tasks, notes, money, goals, meals and reminders

Overview

PR-Agent is a personal tracker inside Telegram. Send a text or voice note and it is saved as the right record (work log, note, expense, income, goal, reminder or meal), which you can review and edit in a Telegram Mini App.

What it does

  • Estimates calories and protein for Indian home food, shows the assumptions it used and flags vague portions for review.
  • Answers questions about your own spending and activity, such as totals for a period or the top spending category.
  • A Mini App to review, filter, edit and delete records.
  • An optional encrypted, masked vault for important personal facts; actions on it need confirmation.
  • Predictable slash commands such as /log, /note and /expense are always available.

Architecture

Telegram messages and the Mini App both go to a FastAPI backend, which uses Groq to transcribe voice and detect what each message is for, then saves it as one of the supported record types. Records are stored in Supabase PostgreSQL through SQLAlchemy, with Alembic migrations. Updates arrive by Telegram webhooks, and scheduled workers run background jobs.

Privacy and safety

  • Every query and change is scoped on the server to the signed in Telegram user.
  • Voice audio is not kept after transcription.
  • Text and voice requests share a daily allowance of 25. Past the limit, voice notes are rejected before transcription, so AI usage is capped too.

Testing and release checks

Release checks cover user isolation (no one can read, edit or delete another user’s records), the daily allowance, Mini App sign in and editing at Telegram’s mobile size, spending queries and meal logging. A local run on 23 August 2026 passed 345 backend tests, 12 frontend tests and 6 mobile browser flows, plus lint, type checks and a production build.