Managing shared living expenses—like rent, WiFi, and utilities—is universally frustrating. The standard solution is forcing all your housemates to download a split-bill app, which no one ever updates.
I wanted a frictionless solution. People already use WhatsApp to coordinate bills and send screenshots of bank transfer receipts. So, I built Project Airi: an autonomous fiscal assistant that lives entirely inside WhatsApp.
Instead of manual data entry, users simply drop a bank receipt into the chat, and the bot reads the image, validates the payment, and updates the database. Here is the technical architecture behind it.
The Tech Stack
To make the bot fast, strongly typed, and resilient, I used:
- Core: Node.js & TypeScript
- Database: PostgreSQL managed via Prisma ORM
- Computer Vision: Tesseract.js (for local Optical Character Recognition)
- NLP Engine: OpenAI GPT-4o API
- Platform: WhatsApp Web.js (headless client integration)
The Core Problem: Processing Bank Receipts
The biggest engineering hurdle was data extraction. Bank transfer receipts are messy. Different banks use entirely different layouts, fonts, and terminologies. A standard regex script would fail the moment a new bank layout was introduced.
To solve this, I built a two-step extraction pipeline: Local OCR $\rightarrow$ LLM Structuring.
Step 1: Local OCR with Tesseract.js
When a user uploads a receipt image to the WhatsApp chat, the bot intercepts the media payload. Instead of sending the heavy image file directly to an expensive cloud API, I process it locally using Tesseract.js.
The OCR engine scans the image and extracts the raw text. The output is highly unstructured and often contains noise (like battery percentages from the screenshot or random UI text), but it secures the critical data: amounts, dates, and reference numbers.
Step 2: NLP Structuring with GPT-4o
This is where the bot becomes intelligent. I pipe the raw, noisy text string from Tesseract directly into the GPT-4o API with a strict system prompt.
The LLM acts as a data parser. It is instructed to ignore the noise and extract only the verified transaction amount, the date, and the payer. It then returns this data in a perfectly formatted JSON object.
By combining local OCR with an LLM, I created a highly fault-tolerant extraction system that doesn't care what bank the receipt came from.
State Management & Database
Once GPT-4o returns the validated JSON data, the backend takes over.
I utilized Prisma as my ORM to interface with a PostgreSQL database. The bot checks the extracted payment amount against the pending bills for that specific user.
- If the math checks out, Prisma updates the user's ledger to "Paid."
- The bot then pings the WhatsApp chat, confirming the payment and outputting a generated financial summary of who still owes what.
The Result
Project Airi completely automates fiscal tracking for shared living spaces. No new apps to download, no manual spreadsheets to update. It was built as a competitive proposal for APC2026, proving that advanced AI integrations don't need complex user interfaces—sometimes, the best UI is the chat app everyone is already using.
I’m Ahmad Akmal (RuumiDev), a software developer specializing in interface design, systems architecture, and practical AI. If you prefer structured, practical engineering, let's connect:
- GitHub: github.com/RuumiDev
- Website: ahmadakmal.dev
Top comments (0)