The challenge
Receipts and invoices arrived in many formats, and getting answers about spending meant digging through files by hand.
What we built
We developed an invoice automation system around a Telegram bot. It detects the input type and routes it to the right workflow, extracts text with Google Cloud Vision OCR, structures the data with GPT-4 and stores it in Supabase with per-user isolation. Users can ask questions about their invoices in natural language, by text or voice.
How we built it
- 1
Accept whatever the user sends
Users send a photo of a receipt, a PDF, a typed message or a voice note. The bot detects the input type and routes it to the matching workflow.
- 2
OCR plus structured extraction
Google Cloud Vision reads text from images, Whisper transcribes voice messages, and GPT-4 turns the result into structured invoice data.
- 3
Private by design
Data is stored in Supabase with per-user isolation, so each person can only see and query their own invoices.
- 4
Ask questions in plain language
Users can ask things like how much they spent with a supplier last month, by text or voice, in Portuguese, and get an answer from their own data.
Key features
- Handles photos, PDFs, text messages and voice messages
- Smart routing by input type
- OCR with Google Cloud Vision API
- Structured extraction with OpenAI GPT-4
- Voice transcription with OpenAI Whisper
- Supabase storage with user isolation
- Natural-language queries in Portuguese
The outcome
Capturing an expense takes a few seconds from a phone, and answering questions about spending no longer means digging through folders of receipts.

