Skip to content

Case Study · Private AI & Archival · Regulated Enterprises, Legal & Institutional Archives

Air-gapped document search and ISO archival for regulated teams

Engineered a local-first OCR preservation and hybrid search pipeline that turns scanned document vaults into searchable, citation-backed knowledge bases without uploading files to external clouds.

Target Sector

Regulated Enterprises, Legal & Institutional Archives

Core Engineering Stack
  • Python
  • TypeScript
  • Hybrid BM25 + Vector
  • Ollama
  • OCR & PDF/A
  • Docker

Verifiable Operational Outcomes

0 Bytes

External Cloud Egress

Runs 100% on local hardware

ISO PDF/A

Archival Compliance

Long-term preservation packages

Cited

Page-Level Answers

Exact keyword + semantic recall

01 · The Problem & Bottleneck

Organizations holding sensitive legal records and historical scans needed fast semantic search and long-term digital preservation, but compliance rules prohibited sending documents to third-party SaaS APIs.

  • Legacy scanned PDFs lacked embedded text layers, making exact legal clause or catalogue lookups impossible.
  • Pure vector search missed exact statute numbers, contract IDs, and proper nouns critical to legal and archival teams.
  • Data sovereignty mandates required 100% offline execution on workstation or campus hardware.
02 · Engineered Architecture

Combined an offline OCR and metadata cataloguing workflow (outputting ISO-standard PDF/A preservation packages) with a local-first hybrid BM25 + vector retrieval engine supporting on-premise LLM inference and strict paragraph-level citations.

03 · Production Verification

Verified zero network egress under firewall packet inspection while benchmarking exact-match legal identifier recall and page-citation accuracy across multi-hundred-page PDF vaults.

Implementation Architecture

How the system was engineered step by step

01 · Offline OCR & Human Proofreading

Digitise scans into ISO PDF/A archival packages

Built a local workstation pipeline that extracts text from scans, provides side-by-side human review and metadata cataloguing, and exports self-contained ISO PDF/A files.

02 · Hybrid Lexical + Semantic Indexing

Combine BM25 keyword precision with dense vector recall

Indexed document chunks using reciprocal rank fusion over BM25 and local embeddings so both exact reference codes and conceptual queries surface accurately.

03 · Cited Local Inference

Synthesize answers with mandatory page and paragraph links

Connected the retrieval index to local Ollama models (with optional private cloud fallback) that cite the exact document and page for every statement.

Inspect the Live Reference Implementation

Experience this architecture in our live platform builds

AskMyDocsLive Demo

Reference Hybrid BM25 + Vector Cited Search Platform

Open AskMyDocs
LibraDigitLive Demo

Reference Offline OCR & ISO PDF/A Preservation Suite

Open LibraDigit