← All projects
Independent

Cairn: private credit monitoring

Reads loan documents and financial statements whatever their layout, pulls out the key figures with citations, and computes the numbers a credit team checks every quarter.

Role
Lead AI Systems Architect
Built with
Python 3.12, FastAPI, PageIndex Flash, DeepSeek, Next.js / React, SQLite / PostgreSQL

Results

  • PageIndex Flash layout trees
  • Lease-token fenced async workers
  • Verbatim quote & scale validation

In more detail

Layout-independent private credit monitoring engine that builds hierarchical PageIndex Flash trees in isolated process groups, extracts cited financial facts and loan terms, and computes adjusted EBITDA margins and debt carrying amounts with atomic worker leases and lease-token fencing.

Key decisions

  1. Isolated Subprocess PageIndex Flash Tree Construction

    Streams borrower PDFs to disk with SHA-256 deduplication, spawns bounded process groups to extract native page text and PageIndex layout trees, and selects nodes within a strict evidence budget independent of document layout.

  2. Quote/Numeric Verification & Lease-Token Worker Fencing

    Rejects extracted financial facts with unmatched quotes or inconsistent scales/currencies, while atomic SQLite/Postgres worker leases with monotonic lease tokens prevent stale workers from overwriting results.