Property of www.width.ai.
System Purpose: Process a large corpus of medical documents, deposition transcripts, and legal documents into a single, chronologically-ordered PDF medical summary with hyperlinked document references.
example outputs:



The system follows a classification-first, fan-out/fan-in pipeline. Documents are first classified into three types, processed through specialized parallel pipelines, then merged and deduplicated into a unified chronological output.
Dive:
The system takes a large, unstructured corpus of documents (could be 1000s of pages) and produces a single chronological medical summary PDF. These documents arrive as a mix of medical records, deposition transcripts, and other legal documents, with no consistent formatting or labeling. The output is a clean, date-ordered timeline where each entry includes the date of the visit, the facility or provider, a summary of what happened, and hyperlinked references back to the exact source documents and page numbers.
The architecture follows a classification-first, fan-out/fan-in pattern. Every document first passes through a lightweight classifier that sorts it into one of three buckets: medical, deposition, or legal. From there, each bucket flows into a specialized processing pipeline tuned for that document type. The three pipelines run in parallel and independently produce structured records. Those records are then collected, deduplicated where the same visit appears across multiple sources, and merged into a unified chronology. The final step formats this chronology into a PDF with hyperlinked page references.
All LLM calls throughout the system are routed through OpenRouter, which allows different steps to use different models, a cheap, fast model for the simple classification task, and more capable models for the complex extraction and comparison work. The only external service outside of OpenRouter is the CaseUp API, which handles deposition transcript processing.
Input Corpus (100s of docs, 1000s of pages) │ ▼ [1. Classification] ──► 3-way split │ ┌────┼────────────┐ ▼ ▼ ▼ Medical Deposition Legal │ │ │ ▼ ▼ ▼ [4. OCR/ [2. CaseUp [3. Page-by- Vision+ API] page LLM] LLM] │ │ │ ▼ ▼ │ Timeline Date+Medical │ Records Extractions │ │ │ └───────┼────────────┘ ▼ [5. Deduplication & Merging] │ ▼ [6. PDF Generation] │ ▼ Chronological Medical Summary PDF