Executive TL;DR & Engineering Rules

Separate probabilistic AI extraction from deterministic SQL execution: let AI parse messy WhatsApp messages, PDFs, bank statements, and ACORD submissions into typed staging records, enforce 100% contract-price/ledger rules in TypeScript & SQL, and route only low-confidence exceptions to a split-screen human inbox.

Never allow an LLM to compute invoice totals, insurance premiums, or tax rounding—use AI strictly for unstructured extraction and fuzzy entity matching.
Stage all AI outputs inside typed draft tables (DraftOrder, ReconCandidate) gated by confidence thresholds, Store×SKU elasticity checks, and human sign-off.
Layer AI over legacy MS Access and SQL Server ERPs today via @sapi/sql-bridge without waiting 18 months for a system rewrite.
Choose zero-retention cloud APIs for fast operational ROI today, and reserve VPC/local open-weights deployments for air-gapped or regulated PII workloads.
In This Playbook
1. The Golden Rule: Probabilistic Extraction + Deterministic ERP Commit2. Automating Finance & Underwriting Intake With Human Exception Queues3. Private / Local Enterprise AI vs. Zero-Retention Cloud EndpointsArchitecture Reference Matrix

1. The Golden Rule: Probabilistic Extraction + Deterministic ERP Commit

Most enterprise AI pilots fail in production because generic chatbots are either disconnected from the ERP (delivering zero operational savings) or given unsafe direct write access to financial and inventory tables.

In Sapi OrderAI and our 7-step accounting reconciliation engine, the LLM never invents a SKU price or posts an unverified journal entry. Instead, it maps unstructured customer shorthand ("3 cajas diezmillo sin hueso p/ mañana suc norte") to candidate customer/branch/SKU IDs, while deterministic SQL procedures enforce contract pricing, credit blocks, and 8-week Store×SKU demand bounds.

Implementation Checklist
Enforce strict JSON Schema / structured outputs on every document extraction call
Maintain a tenant-scoped Customer × Alias memory table so human corrections permanently train deterministic lookups
Flag quantity spikes >2.5σ above the 8-week Store×SKU rolling average before order release
For CTOs & Architects: Governed Staging & Deterministic Price/Elasticity Gate (TypeScript)View Technical Pattern ▾Hide Technical Pattern ▴
Architectural Reference Pattern (Non-Proprietary)Production Pattern
export async function stageOrderFromAiDraft(tenantId: string, draft: AiExtractedOrder) {
  const customer = await resolveVerifiedCustomer(tenantId, draft.customerHint);
  const pricedLines = await Promise.all(
    draft.lines.map(async (line) => {
      const sku = await matchSkuWithAliasMemory(tenantId, customer.id, line.rawText);
      const contractPriceCents = await getAuthoritativeSqlContractPrice(tenantId, customer.id, sku.id);
      const anomaly = await checkEightWeekElasticity(tenantId, customer.branchId, sku.id, line.qty);
      return {
        skuId: sku.id,
        qty: line.qty,
        unitPriceCents: contractPriceCents, // 100% deterministic SQL price — never LLM-generated
        requiresHumanReview: sku.confidence < 0.96 || anomaly.isSpike,
        anomalyReason: anomaly.reason,
      };
    })
  );
  return saveStagedOrderForReview({ tenantId, customerId: customer.id, pricedLines });
}

2. Automating Finance & Underwriting Intake With Human Exception Queues

CFOs and MGA underwriting directors face a similar bottleneck: high-volume incoming documents (bank statements, SPEI/ACH remittances, SAT CFDI 4.0 XMLs, or trucking ACORD applications, CDL driver lists, and loss runs) that require tedious cross-checking before posting.

By chaining deterministic exact-match passes first (UUID, exact invoice cent total, USDOT/VIN lookup) and invoking AI semantic matching only on unresolved multi-invoice remittances or unstructured PDFs, Sapi clears 75–90% of routine volume automatically while giving reviewers a side-by-side PDF-to-SQL audit screen for exceptions.

Implementation Checklist
Run exact UUID, reference ID, and cent-exact sum combinations before calling LLM inference
Log immutable actor, model version, source document hash, and human approver ID on every committed record
Keep human exception review under 15 seconds per item with split-screen source PDF highlighting
For CTOs & Architects: Audit-Ready Human-in-the-Loop Approval Commit (SQL DDL)View Technical Pattern ▾Hide Technical Pattern ▴
Architectural Reference Pattern (Non-Proprietary)Production Pattern
CREATE TABLE dbo.AiGovernanceAuditLog (
  AuditId          BIGINT IDENTITY(1,1) PRIMARY KEY,
  TenantId         NVARCHAR(40)  NOT NULL,
  WorkflowType     VARCHAR(32)   NOT NULL, -- 'ORDER_INTAKE' | 'BANK_RECON_7STEP' | 'MGA_SUBMISSION'
  SourceDocSha256  CHAR(64)      NOT NULL,
  ConfidenceScore  DECIMAL(5,4)  NOT NULL,
  WasAutoMatched   BIT           NOT NULL CONSTRAINT DF_AiAudit_Auto DEFAULT (0) WITH VALUES,
  ApprovedByUserId NVARCHAR(64)  NOT NULL,
  CommittedEntityId NVARCHAR(64) NOT NULL,
  CommittedAtUtc   DATETIME2(3)  NOT NULL DEFAULT SYSUTCDATETIME()
);

3. Private / Local Enterprise AI vs. Zero-Retention Cloud Endpoints

Executive teams frequently ask whether they need dedicated on-premise GPUs to adopt AI safely. For 85% of mid-market manufacturers and distributors, enterprise zero-data-retention cloud endpoints (with contractual opt-out from model training and PII redaction) deliver superior accuracy at a fraction of the infrastructure cost.

When regulatory mandates, defense/ITAR contracts, or strict board policies forbid external API calls, Sapi architects custom private VPC or on-premise model deployments connected to read-only SQL views—clearly scoped as a dedicated enterprise engineering track.

Implementation Checklist
Verify zero-data-retention (ZDR) and zero-training terms on all cloud model providers
Strip sensitive account numbers or irrelevant columns before sending prompt context
Scope local/on-premise open-weight models only when data residency or offline plant constraints require it
For CTOs & Architects: Deployment Architecture Selection RuleView Technical Pattern ▾Hide Technical Pattern ▴
Architectural Reference Pattern (Non-Proprietary)Production Pattern
// Tier 1 (Fastest ROI — Live Today): Zero-Retention Cloud API + SQL Staging + Human Inbox
// Best for: WhatsApp/PDF OrderAI, 7-Step Bank/CFDI Recon, Store×SKU Anomaly Alerts

// Tier 2 (Regulated Enterprise — Custom Track): Dedicated VPC Endpoint (Azure OpenAI / Bedrock)
// Best for: Multi-state MGA Underwriting Submissions, ACORD/MVR Triage, Corporate BI Copilots

// Tier 3 (Air-Gapped / Sovereign — Custom Track): On-Premise Local Model + @sapi/edge-bridge
// Best for: Isolated Plant Networks, Defense Fabricators & Strict Data-Sovereignty Mandates
Pattern Matrix

Legacy Bottlenecks vs. Sapi Production Architecture

Architecture DimensionLegacy Risk / Common PitfallSapi Production Pattern
Pricing & Financial AccuracyUnconstrained chatbot guesses prices or rounds taxes inconsistentlyAI extracts SKU/customer intent only; SQL & TypeScript compute 100% of prices and taxes
Legacy ERP CompatibilityConsultants demand a $500K ERP replacement before starting AI automationConnects directly to existing SQL Server / MS Access via staged validation tables
Exception HandlingSilent auto-posting creates costly warehouse mis-shipments or accounting write-offsSplit-screen human review inbox for <96% confidence matches or >2.5σ quantity spikes
Data Privacy & ResidencyEmployees paste customer lists and financials into consumer AI web tabsRBAC-governed zero-retention APIs or custom VPC/local enterprise deployments
Production Proof

Live Deployments Running This Architecture

USA · Round Rock, TX

Colinas Foods / Colinas Products

11-App Unified Cloud Ecosystem Built Alongside Live MS Access & SQL Server

Deployed 11 specialized cloud modules over the single source-of-truth SQL Server: HACCP Jerky Batch Tracker, Glove-Ready Warehouse Scanner PWA, MFA Customer Portal, Procurement & AP Matching, RFID FLSA Time Clock, Driver POD App, MotivBoard, CEO BI Cockpit, and a WhatsApp/PDF AI Order Bot.

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

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.

Turnkey Cloud SaaS

Companion Cloud Modules & Live Demos

$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
$1,299/mo

Sapi MGA Core™

Specialized cloud policy administration & multi-line rating engine for commercial trucking MGAs and agencies. Computes Cargo, Auto Liability, GL & Long Haul rates with 1-click native DOCX/PDF binders, ID cards, and loss-run analytics.

Explore Module

Technical Buyer & Architect FAQs

Which Sapi AI capabilities are live in production today versus custom or emerging?

WhatsApp/PDF purchase order extraction (Sapi OrderAI sandbox + guided pilots), 7-step AI bank/AR/CFDI reconciliation, Store×SKU demand anomaly alerts, and governed SQL reporting are proven in production. Private local LLMs and multi-agent MGA underwriting triage are delivered as custom architecture engagements.

How fast can we pilot AI purchase order intake or bank reconciliation?

A guided OrderAI or reconciliation pilot typically connects to your SKU/customer master in 2–4 weeks with zero disruption to your current ERP.

Can plant and sales teams interact with Sapi AI tools in both English and Spanish?

Yes. Our order extraction and exception workbenches are built specifically for bilingual US–Mexico commercial operations, including regional product nicknames and Spanglish buyer messages.

Explore Other Engineering Playbooks

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