← Projects
LiveRailway · separate worker service that talks to the dashboard API

JV Assistant

Telegram bot that lets us log expenses by screenshot and ask questions about our money in plain English.

PythonTelegram Bot APIClaude Haiku + SonnetAPScheduler
Extracted
Merchant
Amount
Account
Category●●●
SaveEdit

The problem

Even with the dashboard doing all the heavy lifting, the slowest part of expense tracking is still the typing. Receipts arrive as photos in the family chat, statements arrive as PDFs in email, and the questions that actually matter ("how much did we spend on groceries this month?") tend to come up in the middle of dinner. Opening a dashboard at that point breaks the flow, and the alternative — promising yourself you'll log it later — never works.

The solution

JV Assistant is a Telegram bot that lives in the same chat we already use for everything else. You can snap a photo of a receipt and Claude Haiku will extract the merchant, amount, account and category. You can send a batch screenshot of credit card transactions and Sonnet will pull each line out separately, with a per-item review step before anything gets saved. You can ask a question in plain English and Sonnet will write SQL against a materialized view of every transaction. A nightly spend summary lands at 22:00 PHT, a full weekly budget breakdown lands on Sunday evenings, and free-text forecast entries ("add ₱4,500 monthly for the dentist starting July") get parsed into the right table without anyone touching the dashboard.

Features

  • Photo a single receipt and the bot extracts merchant, amount, account and category
  • Send a batch screenshot of credit card transactions and the bot pulls them out line by line with a review step
  • Ask plain-English questions about your spending and get back a clean answer
  • Quick-log commands for the times you don't want to fuss (`/log 500 grab food`)
  • Nightly spend summary delivered to Telegram at 22:00
  • Weekly budget breakdown delivered every Sunday evening
  • Add new forecast entries by typing them in free text

Architecture

  • Separate Railway worker service that calls the dashboard's REST API with a bearer token
  • Haiku handles single-receipt vision; Sonnet handles batch extraction where one image contains many transactions
  • Natural-language queries materialize `v_all_transactions` (a union of confirmed and pending rows) as a temp table, and Sonnet writes SQL against that
  • A known-payee dictionary and a set of internal-transfer skip patterns are baked directly into the vision prompt so the LLM doesn't keep re-learning our family
  • Spend summaries like `/today`, `/wtd` and `/mtd` are pre-computed SQL endpoints with no LLM call at all, so they come back instantly
  • APScheduler drives the nightly and weekly summaries through Telegram's `job_queue.run_daily`
  • A local SQLite fallback (`pending_local.db`) keeps things working when the dashboard service is mid-deploy