November 17, 2025
Docudiff
DocuDiff: Structured, AI‑Assisted PDF Comparison
Extract tables and line items from selectable PDFs, generate precise diffs, and let AI summarize the changes—fast, auditable document reviews at scale.

What Is DocuDiff? A Structured, AI‑Assisted Way to Compare PDFs at Scale
When two versions of a long contract land on your desk—hundreds of pages of drawings, specs, BOMs, POs, or policy schedules—the simple question “what changed?” is rarely simple. Generic “PDF compare” tools flatten tables into text, bury line‑item edits in noise, and miss the small adjustments that create big downstream risk. LLM‑only approaches aren’t the answer either: give a model two entire documents and you’ll spend tokens explaining layout quirks instead of isolating what actually moved.
DocuDiff (by xSkel) takes a different path. It treats the document as structured content first, then uses AI where it helps most—after the facts are clean. The result: precise, auditable diffs for line items and a concise summary that humans can trust.
The real problem: tables, context, and noise
Most high‑stakes edits hide in structure:
- A BOM row that changes material from 6061‑T6 to 7075‑T6.
- A tolerance added to a dimension line.
- A PO line with a quiet unit‑price drop and a subtle UoM tweak.
- A clause that shifts a single verb and flips risk.
If you treat the PDF as a wall of characters, these changes blur. If you hand two whole files to an LLM, it must rediscover structure from scratch and fights token limits, layout artifacts, and irrelevant text.
What we mean by “structured” (before AI)
DocuDiff is optimized for PDFs with selectable text. It extracts text, segments the document into logical chunks, and applies a declarative rule engine that understands columnar patterns and row identifiers. That lets it:
- Isolate line items (e.g., BOM rows, PO lines) by recognizing numeric line IDs or anchors.
- Capture multi‑column values even when alignment is spacing‑based rather than delimited.
- Validate fields with secondary regexes (e.g., “price must look like currency,” “tolerance must be ±N.NN”).
- Separate table regions from narrative text, so deltas aren’t double‑counted.
Only after this clean, structured pass does DocuDiff invite a language model to summarize the changes. The model isn’t sifting through entire documents; it’s reading a curated, compact set of extracted fields and diffs.
How DocuDiff works (at a glance)
- Ingest two versions of a document (original + modified).
- Annotation‑aware preprocessing strips embedded markups so comments don’t masquerade as content.
- Text extraction runs on selectable text using robust backends.
- Chunking & title detection split the document by patterns you define (e.g., “BILL OF MATERIALS”, “NOTES”, “TERMS”) and carry a small amount of context above each match to keep headings attached to content.
- Rule‑engine parsing finds repeating anchors (like a table header or row marker), expands spans to capture adjacent columns, navigates up/down lines when needed, and validates captured values.
- Line‑item classification marks chunks as “line items” when an ID is present (e.g.,
Line 120,Item 3.2). - Structured diffing compares matched line items and narrative content separately:
- Highlights adds / removals / changes at the field level.
- Collapses identical edits that occur in every row (e.g., “Vendor name normalized across 127 lines”) so reviewers don’t wade through repetition.
- Reports residual narrative differences (notes, clauses) without double‑counting table edits.
- AI‑assisted summary (optional) consumes the structured deltas and produces a concise, human‑readable brief focused on impact and review priority.
- Outputs include a human‑friendly change report and machine‑readable JSON/CSV suitable for downstream systems.
Why not “LLM‑only”?
- Signal‑to‑noise: Whole‑document prompts carry headers, footers, and repeated boilerplate the model must ignore.
- Token cost: Large files force aggressive truncation, leading to missed changes.
- Explainability: Without a deterministic pre‑pass, you can’t trace “why the model said that.”
DocuDiff’s design is deterministic first, generative second. The rule engine gives you auditable, repeatable diffs. The model turns structured deltas into a readable brief—nothing more mystical than that.
Under the hood (concise, practical details)
- Anchors & spans: Regex anchors locate rows; span‑expansion widens capture to adjacent “columns” when columns are spacing‑aligned.
- Context navigation: Rules can hop a line up/down to pull related cells.
- Validation & checks: Secondary regexes confirm value shapes;
check_emptyasserts blank separators to avoid “merged” cells. - Line ranges: Each rule returns the first/last matched line index to keep table regions out of narrative diffs.
- Diff utilities: Normalization, flattening, and conversions make it straightforward to feed PLM/ERP/DMS or analytics.
You don’t need to expose any of this to end users—but it matters for auditability and integration.
Trust and auditability
- Reproducible: Given the same PDFs and the same rules, you get the same diffs.
- Explainable: Every change ties back to a captured field with its before/after values and the rule that harvested them.
- Archivable: Store rule definitions and diff artifacts alongside the ECO/PO record for future audits.
Where DocuDiff excels
- Aerospace configuration & quality: BOM and tolerance changes in drawing packages; clean separation of note edits.
- Contracts & procurement ops: Price/UoM drift in line items; narrative clause tweaks highlighted separately.
- Document control & automation: Deterministic outputs (JSON/CSV + human report) you can route into review queues, dashboards, or gating workflows.


