Inbound Letter Handling
When correspondence arrives — a validation letter, a summons, a creditor response — it doesn’t get handled ad hoc. It moves through a defined pipeline in Foundation, with a human review gate before anything goes out the door. This is the walkthrough of that process; the machinery behind it lives in Architecture.
The stages
Section titled “The stages”A scanned document is an InboundLetter record, and its status field tracks
exactly where it is:
- Pending OCR → OCR in progress → OCR complete. The scanned PDF is read by OCR (Tesseract). Output includes a confidence score and any extracted account numbers.
- Pending classification → in progress → complete. An AI agent (Claude) reads the OCR text and classifies the letter — is this a validation letter, a summons, a settlement offer, a credit-bureau response? There are dozens of recognized file types.
- Pending review → human review complete. A staff member checks the machine’s work. This is the gate: nothing proceeds on the model’s say-so alone.
- Pending attorney review → approved / rejected. Where the matter is legal (a summons, an FDCPA issue), an attorney signs off.
- Response generated. Once approved, Foundation drafts the outbound response from a template and renders it to PDF.
If anything goes wrong along the way, the letter lands in an error state for follow-up rather than silently stalling.
Why it’s shaped this way
Section titled “Why it’s shaped this way”Two forces drive the design:
- Speed where it’s safe. OCR and classification are automated so staff aren’t hand-sorting a mailbag. The machine does the first pass.
- A human on anything that matters. Classification is a suggestion, not a decision. Every letter clears human review, and legal matters clear an attorney, before a response is generated. The automation narrows the work; it doesn’t replace the judgment.
Related
Section titled “Related”- Debt Status Codes — the statuses a letter’s outcome can push a debt into (validation, active lawsuit, and so on).
- System Map — the pipelines and services that run these stages.
Source: foundation/inbound/models.py (InboundLetter status workflow),
foundation/docs/OCR-PIPELINE.md.