What We're Building
The Problem
Running a small Norwegian company means:
- Receipts arrive as email forwards, photos, PDFs
- Each receipt must be matched to a bank transaction in Folio
- Matched receipts sync to Fiken for bookkeeping
- Invoices must be registered in Fiken before due date
- Employee expenses (utlegg) need journal entries
- Bokføringsloven requires 5-year retention of all records
- Missing receipts and overdue invoices create compliance risk
This is tedious, error-prone, and time-consuming.
The Solution
An AI agent on Discord that does the bookkeeping automatically.
graph LR
D[Discord<br/>#invoices] --> R[Forward receipt]
D --> I[Forward invoice]
D --> E[Report expense]
D --> Q[Ask question]
D --> C[Daily checks]
R --> R1[Matched to Folio<br/>synced to Fiken]
I --> I1[Registered in Fiken<br/>reminder before due]
E --> E1[Journal entry<br/>reimbursement tracked]
Q --> Q1[Balance, history<br/>expense reports]
C --> C1[Missing receipts<br/>overdue invoices]
The 16 Use Cases
Document Processing (from #invoices)
- Card purchase receipt — match to Folio transaction, attach, syncs to Fiken
- Unpaid supplier invoice — register in Fiken, remind when due, pay via Folio
- Employee expense (utlegg) — register in Fiken, reimburse on next salary
- Recurring invoice/receipt — auto-apply learned pattern (no questions)
- New merchant — ask for account + VAT, save pattern for next time
Queries (from Discord conversation)
- Check Folio balance
- Check unpaid invoices in Fiken
- Check expenses by category/period
- Check outstanding utlegg per person
- Free-form accounting question
Proactive (bot initiates, daily cron)
- Missing receipt reminder — Folio transactions without attachment
- Invoice due date reminder — Fiken purchases approaching due
- Payment suggestion — list what's due, offer to pay via Folio
- Unpaid invoice alert — registered in Fiken but no matching Folio payment
Configuration (via PR, not direct write)
- Add/update learned pattern (merchant to account/VAT)
- Update company rules (receipt threshold, VAT rates)
Key Design Decisions
| Decision | Choice | Why |
|---|---|---|
| Interface | Discord, not web app | Where the user already is. Forward emails, ask questions naturally. |
| Agent runtime | Automate-E (custom) | k8s-native, persistent memory, horizontal scaling |
| Accounting API | Thin HTTP, no LLM | API only does I/O. LLM stays in the agent. Clear separation. |
| State | Event sourcing | Immutable audit trail. 5-year retention. Replay capability. |
| Quality | Proposal → Review → Execute | No direct writes. Known patterns auto-approve. New merchants need review. |
| Config changes | Git PRs, not direct writes | Audit trail. Review before merge. ArgoCD deploys. |