← Selected work

Open-source document intelligence · 2025–Now

DocuLens AI

Reliable document AI begins with provenance, measurable retrieval, and asynchronous work—not a clever prompt.

10K+

documents designed for

<800ms

retrieval latency

<3s

end-to-end response

01

Problem

Business documents contain decisions, obligations, and evidence, but most systems flatten them into text and return answers that are difficult to audit. Teams need a way to ingest files at scale, retrieve the right context, and trace every answer back to a source.

02

Why it matters

A plausible answer without provenance is operationally weak. In document-heavy work, the system must make failure visible: what was retrieved, which page supported the answer, and how confident the pipeline is.

03

Architecture

  1. 01React console
  2. 02FastAPI gateway
  3. 03Durable event
  4. 04Celery worker
  5. 05Docling + chunks
  6. 06pgvector retrieval
  7. 07Grounded answer
The event record is the durable boundary between HTTP and model work. Workers can retry slow extraction or provider calls without holding request threads, while typed pipeline contexts preserve an audit trail.

04

Product surface

DocuLens AI workspace showing document intelligence workflows
DocuLens AI landing pageDocuLens AI evidence-first question answering studio

05

Technical challenges

01

Preserving evidence

Every vector carries document, chunk, page, title, and token metadata so citations survive ingestion, retrieval, and answer generation.

02

Separating latency classes

FastAPI acknowledges work quickly; Celery handles extraction and model calls with bounded execution, late acknowledgement, and worker-loss recovery.

03

Making retrieval testable

Offline Recall@K and MRR utilities turn chunking and ranking changes into experiments instead of aesthetic prompt tweaks.

06

Tradeoffs

Modular monolith over early microservices

One deployable backend keeps operations and contribution simple until scaling evidence justifies extraction.

Dense-first retrieval

A coherent baseline came before hybrid ranking; reciprocal-rank fusion is reserved for a labelled benchmark.

Read-only public showcase

Recruiters can inspect completed workflows without public uploads, visitor data, or model spend.

07

Experiments

  1. 01Measured retrieval independently from generation with labelled relevant-chunk fixtures.
  2. 02Bounded chunks by tokens while preserving layout and page provenance.
  3. 03Added provider-neutral structured outputs to compare model behavior behind the same contract.

08

Results

Sub-800ms retrieval and under-three-second end-to-end responses in the project benchmark.

One operator surface for ingestion, classification, summaries, search, QA history, and lifecycle actions.

MIT-licensed implementation with CI, typed contracts, deployment runbooks, and an openly accessible product tour.

09

Lessons learned

  • Evaluation belongs beside retrieval code, not in a separate demo notebook.
  • Citation UX is part of model reliability because it changes how people verify and act on answers.
  • A public demo can communicate a system honestly without exposing mutable infrastructure.

10

Future work

  • Publish a redistributable labelled retrieval benchmark.
  • Evaluate dense and keyword fusion with reciprocal-rank fusion.
  • Add OpenTelemetry traces and provider latency and cost dashboards.