Agentic document AI for very large case files
An agentic Claude workflow that reads a million words of case files and returns a cited, verified result
OCR and text extraction for any file type, then AI agents that review, ask for what they need, draft and verify. Every point cites the page and line it came from.
- Client
- A US legal technology startup
- My role
- Software architect and lead engineer
- Year and duration
- 2026, In build
- Stack
- Claude API, OCR, AWS, KMS encryption, Multi-tenant SaaS
1M+
words per case file
4
agent stages from documents to result
0
days of data retention at the model provider

The problem
Legal teams work from case files that run past a million words: scans, PDFs, Word files, spreadsheets and email. Reading them takes days. The goal was an AI that does the reading and the first draft while every point stays traceable to its source and confidential data stays private.
Large files in
- PDF, Word, Excel, CSV, email with attachments and scanned images. Up to 200 MB a file and 2 GB per case.
- Scans go through OCR as a background job. Page and line numbers are kept, so every result can be cited.
Agentic workflow to the result
- Review. Claude reads the case in sections and keeps notes with page and line references. Notes are reused, so only new uploads get read again.
- Gather. The agent decides which documents it needs in full and the platform fetches them. Anything too large for one request is split across several.
- Draft and verify. A draft is written, then a second pass checks it against the rules and redrafts once if it fails.
- Guard. An in-house check blocks copied or confidential text before anything reaches the user.
It runs as a background job with live progress and an email when the result is ready. The cost of every stage is tracked and spending limits stop a job before it overruns.
Private by design
Everything runs in the client’s own AWS account with encryption keys the client holds. Claude runs with zero data retention. Each customer’s data is separated in the application and in the database. Every action is logged.