<- Back to Work

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.

Next.jsTypeScriptGPT-4.1 VisionjsPDF
MPH Field Docs home screen showing Invoice Generator and Book Formatting workflows
The application separates the billing and book workflows at the entry point.

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.

MPH Field Docs billing workflow with multiple uploaded images and editable transcription
Billing workflow: multiple handwritten images become editable transcription before formatting.

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.

Generated MPH Field Docs invoice PDF with aligned line items and prices
Generated invoice output: structured content rendered through deterministic PDF layout code.

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.

MPH Field Docs Book Chapter workflow with manuscript upload and transcription review
Book Chapter workflow: image preprocessing, transcription, review, and DOCX export.
DOCX export produced by the MPH Field Docs book workflow
DOCX output from the reviewed manuscript transcription.

08 / Architecture

Next.js routes keep AI processing close to the workflow.

Browser / Next.js UI
two workflow paths

Billing workflow

POST /api/transcribe
OpenAI
GPT-4.1 Vision
editable output
Editable Transcription
reviewed text
POST /api/format-billing
deterministic export
OpenAI formatting -> jsPDF

Book workflow

Client Image Preprocessing
orientation and compression
POST /api/transcribe
editable output
Editable Transcription
deterministic export
DOCX Export

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