MonthClose AI – Finance Co-pilot for SMEs

AI co-pilot for Portuguese SMEs: every bank line matched to its invoice, month closed, numbers explained.

github
  • 115 Raised
  • 178 Views
  • 2 Judges

Tags

  • Automation

Categories

  • Automation
  • Data Handling
  • Room 3

Gallery

Description

The problem

Small Portuguese companies close their books once a month, and it hurts. Invoices arrive by email, receipts sit in pockets, and the bank statement goes to the accountant with half the documents missing. The accountant chases the owner, the owner chases suppliers, and the month closes late, with errors and VAT at risk. I run one of these companies, so this pain is my own.

What MonthClose AI does

MonthClose AI is a finance co-pilot for the owner. It follows one rule: no bank movement without a document.

  1. Reads the finance mailbox (Gmail). It extracts each invoice, receipt, payslip, tax guide and credit note, and classifies it under Portuguese accounting (SNC) and VAT rules.
  2. Files every document in Google Drive, in month folders with clear names.
  3. Imports the bank statement and links every bank line to its supporting documents. It handles one-to-one, many-to-one, one-to-many, platform payouts net of commissions, settlements and partner reimbursements.
  4. Flags fraud. A changed IBAN, urgency language or a short payment deadline marks the document as suspect, and it is never booked.
  5. Prepares the month close. A checklist, pending items for the owner, and Gmail drafts asking for what is missing (never sent automatically).
  6. Lets the owner close with pending items, with the reason recorded. If the missing invoice turns up later, by email or by phone scan, with or without context, the system recognizes it, links it, and resolves the item without reopening the closed month. The report shows it under "resolved after close".
  7. Phone scan. The owner photographs a receipt and gets it read, validated and matched in about 12 seconds, with live progress.
  8. Agenda and monthly report. What to pay or issue this week, and a readable report where the figures are computed by code and the text is written by AI.

AI decides, code verifies, the owner approves

Grok (xAI API) reads documents, including photos with vision, classifies them, proposes matches and writes the report. Every amount is then checked by deterministic code: base + VAT = total per rate, allocations summing to the bank line within €0.01, and running balances. Anything below the confidence threshold goes to the owner for approval. Each decision stores its confidence and justification.

Results (built and measured during the event)

Tested on a fictional company with 34 emails, a 31-line September bank statement and 12 months of history, against an independent answer key the AI never saw:

  • Documents: 37/37 found; issuer tax number correct 36/37; amounts correct 35/37 (the 2 differences are a credit-note sign convention and a meal-card fee split).
  • Bank reconciliation: 31/31 lines handled, 0 wrong links, 30 identical to the answer key; the other one is the same meal-card fee split.
  • Late documents: after the month was closed, 3 of 3 owner-accepted pending items were resolved (a missing guest invoice, a lost domain invoice, and a customer transfer explained only by email text). A credit note was applied to the next invoice.
  • Real integrations: Gmail (reads only a dedicated label) and Google Drive (app-owned folder), with OAuth.

Built with

Python, FastAPI, SQLModel/SQLite, pdfplumber, xAI Grok API (text and vision), Gmail API, Google Drive API. The UI is mobile-first, in Portuguese and English. Built solo in Cursor with Grok agents during the hackathon.

What comes next

  • An installable app (PWA) for the owner and the accountant, with a shared approval flow.
  • VAT deductibility rules learned from the company's history.
  • Due-date alerts.
  • Quarterly reports and cash-flow projections.
  • An accountant back-office.

Attachments