In estate settlement, organizations receive large volumes of documents (death certificates, wills, deeds, tax forms, statements, etc.). Manually triaging and validating these is time-consuming and error-prone.
The challenge:
- Classify documents into a fixed taxonomy.
- Validate category-specific compliance rules (e.g., death certificates must contain
"Certificate of Death"and"Date of Death"). - Automate routing between these steps in a clean, testable way.
This solution is built as a multi-agent system:
-
Router (Master Agent)
- Receives an input document.
- Orchestrates flow: → Classification → Compliance → Output.
-
Classification Agent
-
Uses keyword & text parsing (with optional PDF parsing via
utils/pdf.py). -
Maps documents to taxonomy codes:
01.0000-50Death Certificate02.0300-50Will/Trust03.0090-00Property Deed04.5000-00Financial Statement05.5000-70Tax Document00.0000-00Miscellaneous
-
-
Compliance Agent
-
Runs category-specific checks:
- Death Certificates → must have
"Certificate of Death"and"Date of Death". - Wills/Trusts → must have
"Last Will and Testament"or"Trust Agreement".
- Death Certificates → must have
-
Others auto-validate as
valid: true.
-
-
Models & Utils
models/types.py→ typed DTOs forDocument,ClassificationResult,ComplianceResult.utils/pdf.py→ text extraction from mock PDFs.utils/llm.py→ placeholder for LLM classification fallback (not required but included for extensibility).
The design emphasizes clear separation of concerns (routing vs classification vs compliance) and testability (Pytest suite included).
git clone <your_repo_url>
cd alix_agentpython -m venv .venv
source .venv/bin/activate # On Linux/Mac
.venv\Scripts\activate # On Windowspip install -r requirements.txtCopy the sample env:
cp .env.example .envExecute the unit tests:
pytest -vCovers:
- Classification logic
- Compliance validation
- API endpoints
Classify and validate mock documents:
python -m alix_agent.cli --input ./mock_pdfsStart FastAPI server:
uvicorn alix_agent.api:app --reloadEndpoints:
GET /health→ health checkPOST /classify→ upload a document for classification/validation
Example:
curl -X POST "http://127.0.0.1:8000/classify" \
-F "file=@mock_pdfs/01_death_certificate_Eleanor_Bennett.pdf"- Automated routing of estate documents.
- Deterministic classification + rule-based compliance checks.
- Fully testable with CLI + API interfaces.