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.
Three additional capabilities available via API — each built on the same rule-based, auditable architecture without external ML dependencies.
Large-invoice anomalies now include z_score in the response — the number of standard deviations above the customer's mean. Severity: ≥5σ=high, ≥4σ=medium, <4σ=low.
Use method=semantic on the suggestions endpoint: word-level Jaccard similarity against historical journal descriptions. Handles different word order and partial matches better than keyword ILIKE.
Convert free-text queries (Ukrainian + English) to QueryStudio filter specs. No LLM required — rule-based keyword matching with 10+ entities and month extraction. Example: "прострочені рахунки за травень" → entity=invoices, overdue filter, month=5.