Architecture Case Study: legal

Legal Tech Automation

"Your legal team spends 80% of their time on repetitive document review. NDAs, contracts, compliance checks—all manually processed. Human error creeps in, deadlines slip, and your best lawyers are doing paralegal work."
CONSTRAINT: Contract Review & Risk Scoring
LOADING_ARCHITECTURE...

Technical Implementation

A DAG-based document processing pipeline. Gmail trigger → Tesseract OCR for scanned PDFs → Claude 4.5 for semantic extraction into structured JSON (parties, clauses, obligations, risk flags) → PostgreSQL for queryable storage. Each node is idempotent with automatic retry logic. Full audit trail for compliance.

ADR: DECISION: n8n (self-hosted) over custom Python scripts. RATIONALE: Visual workflow editor lets non-engineers audit and modify the pipeline. Built-in observability shows exactly where documents fail. Self-hosted means sensitive legal documents never leave your infrastructure.