EyreAustero

Pocket Ledger AI: Telegram Finance Tracker

What It Does

A personal finance management system that lets me track all my expenses through a Telegram chatbot — by typing, sending voice messages, or snapping photos of receipts. It also automatically captures transactions from my Gmail and Yahoo email accounts. Everything is logged to a central spreadsheet with AI-powered categorization, duplicate detection, and monthly reporting.

The Problem

Tracking personal expenses manually is tedious and inconsistent. Receipts pile up, bank notification emails go unread, and by month-end you have no clear picture of where your money went. I needed a system that could meet me where I already am — my phone and my inbox — and do most of the work automatically, without me having to open an app or fill out a form.

How It Works

Telegram Bot (4 input methods):

I send the bot a message like “Jollibee ₱250 cash” and it extracts the merchant, amount, category, and payment method using AI, then saves it to Google Sheets. If I’m in a rush, I can send a voice message instead — the system transcribes it automatically using OpenAI Whisper and processes it the same way. I can also photograph a receipt and the system reads it using GPT-4o vision. For timezone accuracy, I share my location once and the bot remembers my local time zone for all date-based queries.

Beyond logging, the bot is a full query interface. I can ask “how much did I spend on food this month?” or “show me my expenses for March 2025” or “find all Grab receipts” — and it returns formatted results instantly. I can also edit, delete, and restore entries by their Entry ID, all through the chat.

Email Auto-Logger (runs in the background):

The system monitors my Gmail and Yahoo inboxes for transactional emails — bank notifications, payment confirmations, e-commerce receipts. When it detects one, it extracts the transaction details, checks for duplicates against existing entries (using flexible matching on amount, date, and merchant), and logs it automatically. Promotional emails from the same senders are filtered out so they don’t create false entries.

Recurring Expenses Engine:

Monthly bills like rent, loan payments, and subscriptions are logged automatically on their due dates. The system tracks progress (“Month 8 of 24”) and marks the final installment. If the server was down on a due date, it catches up automatically the next time it runs.

Monthly Auto-Report:

On the 1st of every month, the system generates and sends a complete financial summary to Telegram — total spending by category, budget performance with alerts for categories approaching or exceeding limits, top 5 largest expenses, and a breakdown of where entries came from (manual vs. email vs. recurring).

Architecture:

The system runs on n8n (self-hosted) and consists of 1 main workflow, 10 specialized sub-workflows, and 1 companion email monitoring workflow — approximately 100 nodes total. Sub-workflows handle specific jobs: saving entries, listing expenses, checking duplicates, editing/deleting/restoring entries, detecting timezones, processing recurring items, and generating reports.

Screenshots

Build scale: 1 main workflow · 1 companion email workflow · 7 specialized sub-workflows · 100+ n8n nodes

Telegram Bot in Action: receipt transaction check with duplicate detection, followed by a confirmed saved entry with extracted amount, merchant, category, payment method, and Entry ID.

What Makes It Interesting

Deterministic logic where it matters, AI where it adds value.

Early versions tried to make the AI handle everything — categorization rules, formatting rules, routing decisions. Every time I added a “CRITICAL” instruction to the AI’s prompt to fix one behavior, it broke another. The turning point was recognizing that deterministic tasks (like detecting payment methods from keywords, or formatting output) should be handled by Code nodes with predictable logic, not by an AI that interprets instructions differently each time. The AI now focuses on what it’s genuinely good at: understanding natural language input and extracting meaning from unstructured text. This is similar to how in engineering you wouldn’t use a tolerance of ±0.001mm on a non-critical dimension — you match the precision to what the job actually requires.

Flexible duplicate detection for email transactions.

The email auto-logger needs to catch duplicates without being too strict or too loose. A rigid exact-match approach would miss duplicates where the bank rounds the amount or the date is off by a day. Instead, the system uses a 2-of-3 matching approach: if two out of three fields (amount within ±₱1, date within ±1 day, merchant name after removing noise words) match an existing entry, it flags it as a likely duplicate. This is the same principle as a multi-factor evidence standard — no single factor is conclusive, but corroboration across factors builds confidence.

Chose the right database for the job, not the “best” one.

Google Sheets instead of PostgreSQL for the main data store was a deliberate choice. For a personal tracker handling hundreds of rows (not millions), Sheets provides a visual interface I can check anytime, requires zero database administration, and is free. PostgreSQL would have been over-engineering — adding infrastructure complexity for capabilities I don’t need yet. The system is designed so that if I ever outgrow Sheets, the migration path is clean because all reads and writes go through a single sub-workflow. This follows the YAGNI principle (You Aren’t Gonna Need It) — build for what’s confirmed, not what’s hypothetical.

Tech Stack

n8n (self-hosted)

Workflow automation platform

Telegram Bot API

User interface for expense logging and queries

OpenAI GPT-4o-mini

Natural language understanding and categorization

OpenAI GPT-4o

Receipt photo analysis

OpenAI Whisper

Voice message transcription

Google Sheets

Primary transaction ledger

PostgreSQL / Supabase

Conversation memory

Gmail API + Yahoo IMAP

Email transaction auto-logging

TimeZoneDB API

Location-based timezone detection

Description

  • June 14, 2026

AI-powered expense tracker with text, voice, receipt, and email auto-logging.