Agentic Document Extraction banner
chatkausik chatkausik

Agentic Document Extraction

Data community

Description

Agentic Document Extraction (ADE) pipeline built from scratch on Claude. Upload a PDF, describe in natural language what you want to pull out, and watch the system draft a JSON schema, extract the fields, evaluate against a golden answer set, and iteratively refine the schema until it reaches ≥95% accuracy.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

Claude Document Extractor

A landing.ai-style Agentic Document Extraction (ADE) pipeline built from scratch on Claude. Upload a PDF, describe in natural language what you want to pull out, and watch the system draft a JSON schema, extract the fields, evaluate against a golden answer set, and iteratively refine the schema until it reaches ≥95% accuracy.

Inspired by [landing-ai/ade-sample-projects](https://github.com/landing-ai/ade-sample-projects/tree/main/Events/Data_Science_Dojo_2026), but replaces LandingAI's hosted APIs with **Claude** (Anthropic API) end-to-end.

Architecture

PDF ──▶ Parse (Claude native PDF) ──▶ Markdown
          │
          ▼
   Build Schema (NL goal + sample doc ──▶ JSON Schema draft-07)
          │
          ▼
   Extract (tool-use forces schema-valid JSON)
          │
          ▼
   Evaluate (vs data/golden_eval/golden.csv — numeric ±0.5%, strings normalized)
          │
          ▼
   <95%? ──▶ Refine (Claude proposes schema diff) ──▶ bump version ──▶ loop
  • Backend: FastAPI (/parse, /build-schema, /extract, /evaluate, /run-pipeline with SSE)
  • Frontend: Streamlit — Upload | Schema | Extract | Evaluate & Refine
  • Models: claude-opus-4-6 (primary), claude-sonnet-4-6 (fast ops)

Quick start

# 1. deps
make install

# 2. credentials
cp .env.example .env
# edit .env → set ANTHROPIC_API_KEY

# 3. sample PDFs + golden CSV
make samples

# 4. start backend & UI (two terminals)
make api
make ui

# 5. open http://localhost:8501

Then in the UI:

  1. Upload & Parse — drag in the 3 sample CBC reports
  2. Define Schema — prompt: "extract patient name, collection date, and all CBC metrics with values and units"
  3. Extract — runs against all docs in parallel
  4. Evaluate & Refine — view per-field accuracy; click Run refinement loop

Project layout

app/
  api/        FastAPI app + routes
  core/       parse, schema_builder, extract, evaluate, refine, pipeline
  models/     Py