EasyParse is an AI-powered PDF extraction workbench built around a structured two-pass pipeline:
-
Spec discoveryThe model inspects the PDF text and generates an extraction spec with:- document type
- top-level fields
- repeated groups
- nested subgroups when a repeated record contains its own repeated items
-
ExtractionThe model follows that spec to produce structured output. -
Validation + flatteningThe app runs deterministic checks, stores the structured JSON, and also flattens the result into editable review rows.
The repo no longer treats every PDF as one flat list of field_name -> field_value.
The frontend is now a React app built with Vite and organized into modular shadcn-style components instead of a single static script.
It now stores:
- the discovered extraction spec
- the structured extraction output
- a validation report
- flattened fields for fast review/edit/export
This makes repeated structures like transcript terms/courses, invoice line items, team members/tasks, and table-like records much easier to preserve.
- Install dependencies
npm install- Add your Gemini API key to
.env
GEMINI_API_KEY=your_key_here- Start the app
npm startOpen http://localhost:3000.
The repo ships a serverless entrypoint at api/index.js and a vercel.json
that routes all non-static requests through the Express app.
- Push the repo to GitHub and import it in Vercel (or run
vercelfrom the Vercel CLI). - In the Vercel project settings, add an environment variable:
GEMINI_API_KEY= your Gemini API key
- Deploy.
- Storage is ephemeral. Vercel serverless functions only have
/tmpas a writable path, and/tmpis wiped on cold starts. This app stores its SQLite file there, so uploaded documents will eventually disappear. For durable storage swapdb.jsfor an external database (Vercel Postgres, Turso, Supabase, Neon, etc.). - Request body size. Vercel caps serverless request bodies at 4.5 MB by default. Large PDFs near the 20 MB client-side limit will be rejected at the platform edge before they reach the app.
- Execution time.
vercel.jsonsetsmaxDurationto 60s, which is the hobby-plan ceiling. Very large PDFs may still time out; use Pro if you need up to 300s. - Uploads now use in-memory multer storage, so no
uploads/directory is needed at runtime.
- Upload one or more PDFs
- Choose a schema mode:
AI Discoverto let the model design the extraction schemaPredefined Schemato lock extraction to an established schema
- Choose a detail level:
corestandardexhaustive
- EasyParse:
- extracts PDF text
- either loads the chosen predefined schema or discovers a schema
- extracts structured data
- validates the output
- stores flattened review rows
- Review/edit fields in the modal
- Export the flattened review rows to Excel
The app now ships with several established schemas:
Academic TranscriptInvoiceResume / CVContract / Agreement
Users can still skip those and let the model infer the schema from the PDF.
documents now stores:
- filename
- document type
- detail level
- summary text
- extraction spec JSON
- structured output JSON
- validation JSON
- source excerpt metadata
extracted_fields stores flattened rows with:
- field path
- field label
- section label
- entry label
- value
- confidence
- evidence
- data type
- The current implementation still uses text extraction via
pdf-parse, so image-only/scanned PDFs still need OCR. - Long PDFs are excerpted before model submission, and the validation report flags that condition.
- User edits update the flattened row immediately and also patch the stored structured JSON when the field path is known.