Rule-based anomaly detection (4 types). Posting suggestions from historical patterns. OCR interface ready for GPT-4 Vision, Google Vision or Tesseract — built on the Ports & Adapters pattern for easy provider swap.
The detector scans invoices over a configurable time window and returns anomalies with severity scores. The approach is deliberately rule-based — the rules are auditable, explainable, and require no training data.
Amount > mean + 3σ per customer (last 90 days)
Same amount + customer within 7 days
Outside 08:00–20:00 Kyiv or weekend
Total divisible by configurable threshold
The suggestion engine learns from the last 90 days of posted journal entries. When an accountant creates a manual entry, the engine returns the most frequently used debit/credit account pairs — ranked by confidence.
The OCR layer is built on the Ports & Adapters pattern. The interface defines the contract — any vision model can be plugged in without changing business logic. Today the mock is active; a real provider replaces it by swapping one dependency.
Anomaly detection, posting suggestions and document recognition are independent components that complement each other. A typical daily workflow:
Review flagged invoices by severity. High-severity items first — duplicates and outlier amounts resolved before the day's posting begins.
The system shows top-3 suggested debit/credit pairs. One-click accept fills the account fields. If wrong — override, and the next suggestion improves.
Upload a photo or scan. Once a real OCR provider is connected, the system extracts supplier, ЄДРПОУ, date, amount, VAT — and immediately offers posting suggestions based on this counterparty's history.