Architecture & Trust

How DueWise turns records into intelligence.

Four layers, each with a clear boundary. The deterministic engine is the source of truth, a workspace-trained model scores late-payment risk, and AI explains both from your own workspace data.

L1Live

Workspace records

Customers, invoices and payments stored per company workspace. Access is enforced by row-level database policies tied to workspace membership, not by the interface alone.

L2Live

Deterministic engine

Settlement, ageing, customer payment behaviour, collection likelihood, priorities and 7/30/90-day forecasts. Same records and date always give the same output.

L3Live

Late-payment risk model

Logistic regression trained on each workspace’s own settled invoices once at least 10 exist. Inputs: customer late rate, history depth, invoice amount and days overdue. Output: late-payment probability (0–100%) and an A–D grade per open invoice.

L4Live

AI analysis layer

A language model reads authenticated workspace aggregates — open balances, ageing, forecast and customer behaviour — and returns structured review guidance. It explains engine outputs and never writes to source records.

Model governance

Prediction is earned by data, not assumed.

The late-payment risk model (logistic regression, trained per workspace) follows these implemented rules. It predicts whether an invoice will be paid after its due date. Cash-flow forecasts always use the separate published rule-based calculation.

Training
Trains on the workspace’s fully settled invoices; each is labelled late or on time by comparing its final payment date with its due date.
Activation
Training and scoring use one requirement: at least 10 fully settled invoices. There is no separate deployment gate.
Fallback
Below 10, no risk scores are shown and the deterministic forecast continues unchanged.
Evaluation
Leave-one-out cross-validation: every settled invoice is scored by a model trained without it. Held-out accuracy, precision and recall for late payment (0.5 threshold) are reported with each model.
Calibration
Held-out Brier score is reported against a base-rate baseline, with predicted-versus-observed late rates in four probability bands. Metrics are recomputed whenever the workspace model retrains.

Data controls

Isolation

Every finance table is scoped to a workspace ID and protected by database policies.

Authentication

Authenticated sessions are required for every workspace page and server function.

Traceability

Forecast lines export with balance, expected date, probability and the rule applied.

AI boundary

AI output is labelled, read-only and generated only from the signed-in workspace’s data.

Portability

Customers, invoices and payments export to CSV at any time.