Skip to content

AI Accountant

Automated bookkeeping for Invotek AS. An AI agent on Discord processes receipts, invoices, and expenses by talking to Folio (banking) and Fiken (accounting).

You forward a receipt on Discord
  → Book-E extracts the data
    → Proposes an action (with confidence score)
      → Auto-approved (known pattern) or sent for review
        → Executed in Folio/Fiken
          → You get a confirmation in the thread

Architecture at a Glance

Layer What Pattern
Between services Event-driven, async, shared event store Inter-Service Communication
Inside each service Clean Architecture (Entities → Use Cases → Adapters) Clean Architecture
State management Event sourcing, append-only, immutable Event Sourcing
Quality control Proposal → Review → Execute Review Process
Deployment GitOps, SHA-based images, ArgoCD Deployment

Components

Component Role Code
Book-E Discord agent — extracts data, proposes actions automate-e repo
Accounting API Thin HTTP service — Folio/Fiken calls, event store ai-accountant repo
PostgreSQL Events, patterns, history StatefulSet on k3s
CronJob Daily compliance checks k8s CronJob

Start Here

  1. What We're Building — the problem, the solution, the 16 use cases
  2. C4 Level 1 — who uses the system and what it connects to
  3. C4 Level 2 — the containers and how they communicate
  4. Clean Architecture — how code is organized inside each service
  5. Event Sourcing — why every action is an immutable event