02 / Applied AI System
MPH Field Docs
AI Document Automation
AI-assisted document automation for turning handwritten field notes into structured, reviewable, client-ready output.

01 / Problem
From handwritten field notes to usable documents.
Contractors often capture estimates, invoices, job notes, and project details by hand while working in the field. Turning those notes into clean client-facing documents creates repetitive administrative work and introduces opportunities for transcription mistakes or missing details.
MPH Field Docs was built to reduce that friction without removing human control from the final output.
02 / Workflow
AI handles the conversion work. The user controls the final document.
Capture
Upload one or more handwritten document images
Transcribe
GPT-4.1 Vision produces literal transcription
Review
User edits or corrects transcription
Format
A constrained AI pass creates professional structure
Export
PDF or DOCX output
Human review happens before professional formatting. AI handles the conversion work; the user controls the final document.

03 / AI Responsibilities
Separate transcription from interpretation.
Stage 1 / Literal transcription
GPT-4.1 Vision preserves line breaks, spelling, punctuation, and page order. It does not summarize or correct the source; unclear words are marked as [unclear].
Stage 2 / Constrained formatting
A second AI pass improves clarity while preserving reviewed work items and pricing. It avoids invented materials, quantities, dates, warranties, or promises and produces plain-text structure for deterministic rendering.
The formatting stage operates on already-reviewed text. It does not replace the user's review.
04 / Human in the Loop
AI does the conversion. The contractor approves the content.
The transcription appears in an editable text area before formatting or export. The user can correct handwriting-recognition errors, add missing context, remove unwanted content, verify pricing and scope, and decide when the document is ready to format.
Human review is intentionally placed between perception and generation.
05 / Multi-image Input
A field workflow that keeps page order intact.
The billing workflow supports multiple uploaded images. Images are converted for GPT-4.1 Vision input and submitted as part of the transcription request, with parallel async processing where appropriate, high-detail vision input, and page order preservation.
06 / PDF Generation
Document generation required more than AI output.
The formatted response is not simply dumped into a file. The jsPDF export path contains deterministic layout logic for invoice title/header treatment, company contact information, section detection, numbered line items, aligned price columns, currency formatting, wrapped descriptions, bullets and detail lines, multi-page continuation, page-overflow handling, and spacing rules.
AI creates structured content. Deterministic layout code creates the actual professional PDF.

07 / Book Workflow
The same transcription boundary supports manuscript work.
The Book Chapter workflow accepts handwritten manuscript images, reads EXIF orientation, corrects orientation where necessary, and resizes and compresses large images to JPEG before upload. It uses the same vision transcription path, allows review, and exports the result as DOCX.
Canvas-based client image processing, DOCX generation, and FileSaver download keep this secondary workflow practical without changing the central human-review model.


08 / Architecture
Next.js routes keep AI processing close to the workflow.
Billing workflow
Book workflow
AI processing happens through Next.js App Router API routes. User review separates perception from deterministic document output.
09 / Applied AI Boundary
Constrained AI around deterministic document logic.
AI handles handwriting perception, language cleanup, and professional wording. Deterministic application code handles user control, file handling, image processing, document layout, price alignment, page breaks, PDF creation, and DOCX creation.
Models handle ambiguous interpretation. Code handles deterministic output.
10 / Technology
A focused application stack.
- Next.js
- TypeScript
- React
- OpenAI
- GPT-4.1 Vision
- Tailwind CSS
- jsPDF
- DOCX
- FileSaver