Inspiration

Regulated product reviews often compare specifications, approved formulas, and batch certificates by hand. A field can be extracted correctly and still be wrong relative to the governing document. Reviewers need to see authority and observation side by side, and tie every conclusion to the exact source document, before they can defend a decision.

What it does

Using PDF as the demo source format, PDX EvidenceGate ingests a multi-document dossier, normalizes Nutrient extraction into traceable evidence, and runs ProDocuX deterministic checks. Findings that need human judgment enter a review queue; PDX Artifact Engine holds a digest-bound approval checkpoint until review is complete.

For each open finding, reviewers apply the right decision type: correct normalized evidence when a governing reference is wrong, or confirm the finding when source documents truly disagree, without rewriting immutable PDFs. ProDocuX reverifies after corrections; the run closes with recorded approval and a checksummed audit package. Correction history, provider cache, and Viewer mappings survive API restarts.

How we built it

If you clone the repository, you get a complete local stack, not a hosted-only demo.

  • Nutrient Data Extraction: reads PDFs and returns typed fields with page citations when you configure live API keys.
  • Nutrient Viewer: displays the exact source PDF in the browser while you review findings.
  • Review web app: queue of findings, correct or confirm each one, download the audit package when done.
  • API server: stores each run under ./runs so corrections and progress survive server restarts.
  • ProDocuX + PDX Artifact Engine dependencies: install from public PyPI packages (prodocux, pdx-artifact-engine); no private monorepo checkout required.
  • Extraction cache: reprocessing the same PDF bytes reuses stored results instead of calling Nutrient again.

Two ways to run it locally:

  1. No Nutrient account: run scripts/configure.py (option 1), start the API and web app, then click Try local preview. Bundled sample extraction data lets you explore the full findings → correct/confirm → audit flow.
  2. With Nutrient keys: add Data Extraction and Viewer keys to .env, then upload PDFs or run a live demo audit with real extraction and Viewer sessions.

For contributors: GitHub Actions runs automated tests against bundled sample data only, so routine development does not spend Nutrient API quota.

Challenges we ran into

Separate Nutrient products, separate setup

  • Problem: Data Extraction and Viewer are different APIs - they use different API keys and different usage limits.
  • Solution: scripts/configure.py collects both keys when you choose live mode, and the app configures each integration independently.

Extraction request shape

  • Problem: Nutrient extraction expects multipart uploads with an outer instructions JSON object - not only the PDF file.
  • Solution: The Nutrient adapter wraps each upload in the required instructions + document multipart shape.

Citation coordinates did not match our verifier contract

  • Problem: Nutrient returns citation boxes in render-space [x, y, width, height]; ProDocuX expects normalized [left, top, right, bottom].
  • Solution: EvidenceGate normalizes boxes during ingestion so downstream checks receive a consistent citation format.

Billable calls on recoverable failures

  • Problem: If validation fails after a live extraction call, a naive retry would call Nutrient again and charge twice.
  • Solution: Persist provider output and cache extraction by PDF digest (SHA256) before running ProDocuX, so retries and duplicate uploads reuse stored results.

Viewer free-tier document limits

  • Problem: Nutrient Viewer free tier caps how many distinct documents you can host; repeated uploads can fill the quota quickly.
  • Solution: Dedupe Viewer uploads by SHA256, surface slot usage in the UI, and warn before the limit is reached.

Accomplishments that we're proud of

  • End-to-end live extraction and Viewer routing with a findings-driven review queue.
  • Finding-level decisions: correct normalized evidence vs confirm observed disagreement, with a clear authority model.
  • Immutable PDFs with corrections applied only to normalized evidence and full correction history.
  • PDX checkpoint cancel-and-replace after reverification.
  • Restart-safe runs, audit artifacts, and allowlisted audit ZIP (no source PDFs or secrets).
  • Clone-and-run setup: PyPI dependencies, configure.py, and bundled samples, no private repo paths required.

What we learned

Document automation is not only extraction accuracy. Trust also needs a clear authority model, visible sources, immutable originals, deterministic checks, explicit human decisions, and reproducible provenance - not another opaque AI summary.

What's next for PDX EvidenceGate

  • Configurable dossier schemas beyond the cosmetic PIF demonstration.
  • Policy-driven review workflows - ProDocuX rule sets and metadata drive human steps (correct reference vs confirm deviation vs approve) instead of hard-coded per-check UI.
  • Workflow templates for common regulated dossiers (PIF, CoA release, label vs spec).
  • Managed object/database storage, organization auth, and role-based approval policies.
  • Operator-facing configuration (e.g. ReviewDesk) for policies and review templates on the same PDX stack.

Built With

  • artifact-engine
  • audit
  • compliance
  • data-extraction
  • document-processing
  • evidence-management
  • fastapi
  • github-actions
  • human-in-the-loop
  • next.js
  • nutrient
  • nutrient-data-extraction
  • nutrient-dws
  • nutrient-viewer
  • pdf
  • pnpm
  • prodocux
  • pydantic
  • pypi
  • python
  • react
  • rest-api
  • typescript
  • uvicorn
  • vinext
Share this project:

Updates