LedgerLens
ACTIVEDocument Vision & Validation
AI document intelligence for extracting and validating financial records from receipts and invoices.
Core Proposition
AI document intelligence platform that extracts structured financial records from receipt and invoice images, executes deterministic rule-based arithmetic validation, applies PII masking and cryptographic provenance watermarking, and routes low-confidence records to human-in-the-loop review.
Brittle OCR & Silent Financial Extraction Errors
Standard OCR and raw LLM vision extractions frequently suffer from brittle layout handling, incorrect field values, arithmetic discrepancies (e.g. Subtotal + Tax != Total), silent hallucinations, and lack of audit-ready provenance verification for sensitive invoices and receipts.
Three-Tier Validation Architecture
LedgerLens strictly isolates generative AI inference from deterministic validation rules and human decision-making, ensuring mathematical consistency and provenance before committing data.
Multi-provider vision models (OpenAI, Gemini, Groq) interpret unstructured receipt and invoice images guided by dynamic Pydantic schema contracts.
Deterministic Python validation engine evaluates 10+ mathematical rules (Subtotal + Tax == Total, Unit Price * Qty == Line Total, ISO currency verification) and recalibrates AI confidence scores.
Interactive split-pane review workspace where operators visually inspect watermarked provenance images, adjust flagged fields, and commit verified records.
Document Validation Pipeline
Document Image Ingestion
Accepts receipt and invoice image uploads (PNG, JPEG) and generates cryptographic file hashes for provenance tracking.
Fail-Closed Moderation & PII Redaction
Evaluates safety screening gates and automatically masks sensitive PII (SSNs, tax IDs, credit card numbers, phone numbers) prior to logging.
Multi-Provider Vision Extraction
Dispatches document images to configured vision models (OpenAI, Google Gemini, Groq) with embedded JSON schema prompting.
Structured Schema Normalization
Enforces dynamic Pydantic models (InvoiceSchema), standardizes field aliases, and validates date and currency ISO formatting.
Deterministic Financial Validation
Executes 10+ deterministic rule checks verifying arithmetic integrity (Subtotal + Tax == Total) and flagging discrepancies.
Confidence Recalibration & Human Review
Computes combined confidence metrics; extractions falling below threshold (< 75%) are automatically queued for split-pane manual review.
Provenance Watermarking & Persistence
Applies tamper-evident watermark stamps and persists structured records to Supabase PostgreSQL (public.cevondocs_documents) and dedicated object storage.
Verified System Capabilities
Multi-Provider Vision AI
Modular provider architecture with hot-swapping across OpenAI, Google Gemini, and Groq vision backends.
Dynamic Pydantic Schema Prompting
Embeds strict Pydantic JSON schemas directly into model prompts to enforce type-safe extraction contracts.
Deterministic Arithmetic Engine
Evaluates 10+ mathematical rules to detect arithmetic mismatches between line items, taxes, and totals.
Automated PII Redaction
Identifies and masks sensitive personally identifiable information (tax IDs, SSNs, phone numbers) before logging.
Split-Pane Review Workspace
Side-by-side verification interface comparing raw source images with editable financial schemas.
Telemetry & Observability
Prometheus metrics endpoint (/metrics) and Grafana dashboard tracking extraction latencies, token costs, and queue status.
Technical Specification & Stack
Origin & Operational Context
Developed under the CevonX product studio to solve financial receipt and invoice validation. Validated with a 57-test automated verification suite.
Internal database identifier: cevondocs. Public open-source repository available at https://github.com/Sahil2430/CevonDocs.