EsotericWork

DOCUMENT × AI

PageWright

Enterprise document automation that solves the combinatorial explosion. 18 million template variations compressed into 100 instruction files. Built on the architecture proven in regulated industries.

pagewright.ai(coming soon)

ROLE

Creator

YEAR

2024-2025

STACK

Next.js · Python · OpenAI

STATUS

Available

THE PROBLEM

Complex documents in regulated industries have a combinatorial explosion problem. Every combination of jurisdiction × document type × stakeholder × special conditions produces different requirements.

Traditional solutions fail predictably: template libraries become unmaintainable at scale, rule engines explode with conflicts, and generic AI can't guarantee compliance. The math makes this obvious.

TRADITIONAL TEMPLATES

Documents × Categories × Regulations

× Stakeholders × Conditions × Formats

200 × 30 × 3 × 10 × 20 × 5

18,000,000

templates required

PAGEWRIGHT MDRS

Base + Domain Overrides

+ Regulatory Layers

+ Conditional Logic

~100

instruction files

180,000× reduction in storage. Hierarchical composition instead of enumeration. O(n) instead of O(n^m).

THE BREAKTHROUGH

MDRS (Markdown Document Retrieval System) solves the explosion through hierarchical composition instead of enumeration. Documents assemble dynamically from layered instructions, each with priority rules.

The critical discovery: AI models edit Markdown without syntax errors (100% success rate vs 70-90% for JSON/YAML). This makes instructions human-readable, AI-editable, and git-versioned.

HIERARCHICAL PROMPT ASSEMBLY

25

BASE INSTRUCTIONS

Default section behavior

50

REPORT TYPE

Initial vs Reevaluation

75

DOMAIN OVERLAYS

Disability, category, etc.

100

REGULATORY

District/jurisdiction rules

Higher priority wins conflicts. Layers merge additively otherwise. One system, infinite variations.

HOW IT WORKS

Smart Ingestion

AI identifies document types from 200+ categories with 99% accuracy. PDFs, images, Word docs, handwritten notes. Multi-model pipeline routes to optimal extraction strategy.

Section Determination

Automatically determines which of 30+ sections to include, their order (different per jurisdiction), and maps 100+ uploaded files to the correct sections. This is the hardest problem-others don't even attempt it.

Hierarchical Generation

Assembles perfect prompts from layered instructions. Base → Domain → Regulatory → Specific. Resolves conflicts by priority. Generates each section with precisely engineered context.

Unlimited Length

Can generate 8-page summaries or 150+ page comprehensive reports. No context limits. No consistency degradation. Tested to 1000+ pages.

PROVEN RESULTS

Architecture proven on Psych Assessment AI-Level 8/10 complexity, harder than 90% of legal/medical documentation.

95%

LABOR REDUCTION

20 hours → 1 hour

99%

COMPLIANCE

Built-in, not bolted-on

$0.40

TOKEN COST

vs $2,500 traditional

8min

GENERATION

vs 15 hours manual

The QA team burden eliminated entirely. Compliance built-in from the start means no revision cycles. Psychologists review instead of write-95% reduction in cognitive load on the most dreaded part of their job.

TARGET MARKETS

PageWright excels where documents are too complex for simple AI, too variable for templates, and too important to get wrong.

TARGET VERTICALS (LEVEL 6-8 COMPLEXITY)

HEALTHCARE

Prior auth, clinical assessments, discharge summaries

LEGAL

Regulatory filings, compliance reports, case summaries

FINANCIAL

Loan origination, audit reports, risk assessments

INSURANCE

Claims processing, policy docs, investigation reports

The sweet spot: Too complex for simple AI. Too variable for templates. Too important to get wrong.

WHY THIS MATTERS

The hard part isn't the AI model - it's the information architecture. How do you structure content for infinite variability while still enabling AI-human collaborative editing?

MDRS reduces complexity from O(n^m) to O(n). That's the difference between "theoretically possible" and "actually works in production." The same architecture that handles psychological assessments can handle insurance claims, legal contracts, or medical documentation.

The implementation isn't trivial - hierarchical composition, AI-editable structures, and validation at scale all took time to figure out. But the pattern is proven and generalizes well.