Adam BlansettSenior Full-Stack & AI Engineer
Featured WorkActive Open-Source Development (MIT)

AI Finance Operations Platform

Self-hosted AI finance operations platform in active development for invoice reconciliation, AP/AR matching, cash flow forecasting, and expense auditing.

Engineering RoleLead Systems & AI Architect

01. Problem & Context

Finance and accounting teams spend hours manually reconciling purchase orders against receipts and vendor invoices, matching AP/AR ledger entries, updating rolling cash flow projections, and auditing employee expenses—while general-purpose cloud AI tools risk exposing sensitive tax IDs, bank details, and financial ledgers.

02. Engineering Solution

Architected an open-source, self-hostable finance operations baseline combining a Python 3.12 FastAPI and Pydantic v2 backend, PostgreSQL 16 (pgvector), Redis 7, and a React 18 / TypeScript frontend served via non-root Nginx containers. With production security guardrails, offline deterministic mock mode, local Ollama routing, and a 4-job GitHub Actions CI pipeline established, the domain modules—ingestion, reconciliation, forecasting, and audit—are in active development.

03. System Architecture

The platform is organized around four modular backend domains (ingestion, reconciliation, forecasting, and audit) running on FastAPI, PostgreSQL 16 with pgvector, Redis 7, and a Vite + React 18 frontend. A pure ASGI security-header middleware, fail-fast production validator, and versioned /api/v1/health/live and /api/v1/health/ready probes form the verified runtime baseline while domain workflows are actively built out.

Core Architectural Components

Invoice & Statement Ingestion (ingestion/)

Planned and active PDF, CSV, and ERP statement and invoice parser with content-hash duplicate detection prior to ledger entry creation.

Three-Way & AP/AR Reconciliation (reconciliation/)

Deterministic rule checks paired with semantic matching across purchase orders, receiving records, vendor invoices, and AP/AR ledger items with controller anomaly flags.

Rolling 13-Week Cash Flow Forecasting (forecasting/)

Scenario-based cash flow projection engine modeling receivables aging, recurring payables commitments, and runway variance explanations.

Expense Policy Auditing & PII Redactor (audit/)

Automated expense policy compliance engine, duplicate receipt screening, SOX-ready immutable approval logs, and outbound cloud PII redaction.

04. Notable Engineering Decisions

Fail-Fast Production Configuration Validation

validate_production_security() refuses startup under APP_ENV=production if default development secrets or wildcard CORS origins remain configured, preventing accidental insecure deployments.

Local-First Ollama Inference & Cloud PII Redaction

Financial records contain vendor EINs, bank identifiers, and payroll-adjacent expenses. An offline deterministic mock adapter powers CI, while LLM_REDACT_PII_FOR_CLOUD=true scrubs PII prior to any cloud inference alongside local Ollama support.

Controller Approval Gates & Full-Stack CI Baseline

High-impact accounting actions require explicit controller review states backed by Ruff, Mypy, pytest, TypeScript, Vitest, Vite production builds, Docker Compose checks, npm audit, and Trivy scanning before domain modules ship.

05. Engineering Challenges & Solutions

Challenge: Preventing sensitive financial identifiers from leaking during LLM-assisted invoice parsing or variance explanations.

Engineering Solution: Enforced default cloud PII redaction (LLM_REDACT_PII_FOR_CLOUD) and local open-weight Ollama inference support alongside strict typed Pydantic v2 schemas.

Challenge: Building modular accounting workflows that remain testable without live external LLM or ERP dependencies.

Engineering Solution: Included an offline deterministic mock LLM mode, health probes, and isolated GitHub Actions CI checks across both FastAPI and React packages.

06. Implementation Highlights

  • Python 3.12 FastAPI + Pydantic v2 API with /api/v1/health/live and /api/v1/health/ready probes
  • Pure ASGI security-header middleware and fail-fast validate_production_security() startup checks
  • Planned domain architecture for ingestion/, reconciliation/, forecasting/, and audit/ modules
  • Local Ollama model routing, offline deterministic mock mode, and default cloud PII redaction
  • React 18 + Vite + TypeScript + Tailwind frontend tested with Vitest and served via non-root Nginx
  • 4-job GitHub Actions CI pipeline covering Ruff, Mypy, pytest, Vitest, Docker Compose, npm audit, and Trivy