Executive TL;DR & Engineering Rules

Chain 5 deterministic SQL matching passes (exact UUID/reference, cent-exact invoice match, multi-invoice subset sum, contract discount tolerance, vendor RFC/EIN) before running 2 governed AI semantic passes and routing remaining variances to a 1-click controller inbox.

Deterministic passes clear 65–75% of clean bank lines at zero AI token cost and 100% mathematical certainty.
AI semantic passes resolve messy wire memos, consolidated retail chain remittances, and split customer payments—raising match rates to 85–94%.
Controllers review only genuine short-pays, unrecorded bank fees, or missing vendor tax XMLs (Art. 69-B / CFDI 4.0 REP).
Typical mid-market finance teams reclaim 35–60 hours per month and shorten month-end close by 3 to 5 business days.
In This Playbook
1. Inside the 7-Step Hybrid Deterministic + AI Reconciliation EngineArchitecture Reference Matrix

1. Inside the 7-Step Hybrid Deterministic + AI Reconciliation Engine

Pure rule-based bank feeds fail whenever a customer pays 7 invoices in one wire minus a 2% early-pay discount or types an abbreviated company name in the ACH/SPEI memo. Conversely, pure LLM matching is slow, expensive, and untrustworthy on raw numbers.

Sapi combines the best of both worlds: steps 1 through 5 execute in milliseconds inside SQL/TypeScript (exact reference/UUID, exact cent+counterparty, subset-sum invoice combinations, contract allowance tolerance, and recurring fee rules), while steps 6 and 7 apply AI entity resolution and stage human-approved journal entries.

Implementation Checklist
Validate SAT Art. 69-B blacklist status and XML UUID authenticity before releasing AP supplier runs in Mexico
Auto-draft Complemento de Pago (REP 2.0) or AR cash-application batches upon controller approval
Export full audit trail showing which of the 7 steps matched every single bank line
For CTOs & Architects: CFO Annual Automation ROI Formula (TypeScript)View Technical Pattern ▾Hide Technical Pattern ▴
Architectural Reference Pattern (Non-Proprietary)Production Pattern
export function calculateFinanceReconAnnualRoi(params: {
  monthlyReconHours: number;
  fullyLoadedControllerHourlyUsd: number;
  earlyPayDiscountsCapturedUsdYr: number;
  avoidedDuplicateOrPenaltyUsdYr: number;
  annualPlatformCostUsd: number;
}) {
  const hoursSavedYr = Math.round(params.monthlyReconHours * 0.78 * 12);
  const laborValueUsdYr = hoursSavedYr * params.fullyLoadedControllerHourlyUsd;
  const grossBenefitUsdYr =
    laborValueUsdYr + params.earlyPayDiscountsCapturedUsdYr + params.avoidedDuplicateOrPenaltyUsdYr;
  const netBenefitUsdYr = grossBenefitUsdYr - params.annualPlatformCostUsd;
  const paybackMonths = Number(((params.annualPlatformCostUsd / grossBenefitUsdYr) * 12).toFixed(1));
  return { hoursSavedYr, grossBenefitUsdYr, netBenefitUsdYr, paybackMonths };
}
Pattern Matrix

Legacy Bottlenecks vs. Sapi Production Architecture

Architecture DimensionLegacy Risk / Common PitfallSapi Production Pattern
Multi-Invoice Wire PaymentsAccountant tests invoice combinations manually in Excel for hoursBounded subset-sum solver + AI remittance advice parser in <2 seconds
Audit & Controller Sign-OffUnexplained auto-match rules or untracked spreadsheet editsStep-tagged confidence score + mandatory human sign-off on variances
Production Proof

Live Deployments Running This Architecture

Mexico · Monterrey, NL

Welita Chila & MonteMaíz (Molino del Norte)

Dual-Company ERP, Circular BOM Costing, Driver App & Sunday CFDI 4.0 Automation

Delivered a single multi-company ERP with instant database isolation, WhatsApp store×SKU demand elasticity matrix, FIFO flour costing, mobile `/chofer` ticket-photo app, 1-click Sunday CFDI 4.0 + PDF packet builder, and SAT e.firma XML reconciliation.

Mexico · Monterrey, NL

Durosa

Angular + Java Cloud ERP Upgrade with Automated Engineering Cost & Quoting Engine

Upgraded the legacy ERP into an Angular + Java enterprise platform featuring reactive cost-line calculation matching legacy rules, automated engineering catalog endpoints, and full client/parameter management.

Mexico · Monterrey, NL & Texas

Confidential Binational Automotive Supplier (NDA)

7-Step Governed AI Bank, AR/AP & SAT CFDI 4.0 Reconciliation Over Multi-Entity ERP

Deployed Sapi’s 7-step reconciliation pipeline: 5 deterministic SQL passes clear exact UUIDs, invoice subset sums, and contract tolerances first, followed by governed AI entity matching and a split-screen human exception inbox with automated Art. 69-B checks.

Turnkey Cloud SaaS

Companion Cloud Modules & Live Demos

$299/mo

Sapi RouteDSD & B2B Portal™

Unifies direct-store-delivery mobile apps (barcode delivery scan, signature & ticket camera capture, stale returns, daily settlement) with a secure MFA-protected B2B self-service customer ordering & invoice portal.

Explore Module
$199/mo

Sapi OrderAI™

AI operational intake that reads WhatsApp customer messages, purchase order PDFs, and IMAP email threads, matches SKUs and customer pricing with fuzzy verification, and drafts orders straight into SQL Server.

Explore Module
$49/mo

Sapi Kaizen / HTP™

Multi-tenant plant improvement platform where operators submit cost-saving ideas, managers run 4D/8D corrective workflows, and finance verifies real dollar savings and profit-sharing rewards.

Explore Module

Ready to Map Your Legacy System Into a 4–8 Week Cloud Rollout?

Walk us through your Access files, SQL Server stored procedures, or plant floor stations and get an actionable Phase-1 technical blueprint.

All Engineering Guides