Skip to content

Repository files navigation

ClaimWright

Reads the documents behind a security-deposit insurance claim (lease, tenant ledger, move-out itemization, repair invoices) and recommends a payout, with every dollar traced to a document line. On a held-out test split it lands within $250 of the human adjudicator on 91% of claims, with a median error of $0, for about $0.33 a claim.

Claim detail: the recommended payout and the audit trail behind it

Batch history: past adjudication runs

Screenshots show synthetic sample claims, no real claimant data.

How it works

  • Claude Opus 4.8 reads the claim documents through a forced tool call and returns structured facts: each charge, the ledger balance, eligibility. A deterministic Python engine then applies the arithmetic, the policy cap, and the exclusions, so the payout is never a number the model made up.
  • The engine anchors on the ledger balance instead of summing repair line items. That change cut mean absolute error from $909 to $121; guardrails and hybrid reading took it to $62.
  • Each PDF page routes by text density: about 75% read free and lossless with pure-Python pdfminer.six, true scans go to Claude vision. No poppler or tesseract binaries, so the same code runs inside the packaged macOS desktop app (PyInstaller).
  • Extractions are stored and the engine is a pure function, so a candidate rulebook (JSON, config/rulebook.json) re-scores against the human decisions by replaying stored reads with zero API calls (python -m scripts.rescore).
  • The source CSV carries the human adjudicators' answers. An allow-list projection in core/csv_data.py keeps those columns out of the model input, and the boundary holds across the database round-trip; only the scoring code reads them.
  • Django-Ninja API over a framework-free core/, React + Vite frontend served same-origin, one SQLite workspace per user. Deployed on Railway. No LLM framework, just direct Anthropic SDK calls validated at the boundary with Pydantic.

The full design is in ARCHITECTURE.md.

Calibration workbench: held-out accuracy and the rulebook iteration history

Run it

Requires Python 3.13 and an ANTHROPIC_API_KEY.

python -m venv .venv && source .venv/bin/activate
pip install -e .
echo "ANTHROPIC_API_KEY=sk-ant-..." > .env
python manage.py runserver   # API + SPA at http://localhost:8000

VITE_USE_MOCKS=1 runs the frontend on bundled synthetic fixtures, no backend and no key needed.

About

Security-deposit insurance claim adjudication — Claude reads the documents, a deterministic engine decides the payout (sanitized portfolio build).

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages