Integrate legal risk analysis patterns from DocMind into the document processing pipeline.
Purpose
After OCR and basic classification, documents need legal risk scoring:
- Is this document from an ag-gag jurisdiction? Flag for legal review before use.
- Does it contain witness-identifying information that should be redacted?
- What is the litigation risk if this document is disclosed to coalition partners?
Scope
src/documents/legal_analyzer.py — legal risk analysis module
- Inputs: document text, jurisdiction metadata
- Outputs: risk score (low/medium/high/critical), risk factors, recommended handling
- Integrate with
src/documents/ingester.py — add legal analysis step after classification
- Add risk score to evidence index database
- Dashboard: add legal risk column to evidence view
Model
Follow DocMind's pattern: parallel clause classification, plain-English explanations,
risk distribution chart. Adapt for advocacy domain:
- Ag-gag exposure (source jurisdiction)
- Witness identity exposure (names, contact details in document)
- Chain of custody gaps
- Attorney-client privilege markers
Provider
Use zero-retention or local model only — see docs/security.md §AI Provider Routing
Integrate legal risk analysis patterns from DocMind into the document processing pipeline.
Purpose
After OCR and basic classification, documents need legal risk scoring:
Scope
src/documents/legal_analyzer.py— legal risk analysis modulesrc/documents/ingester.py— add legal analysis step after classificationModel
Follow DocMind's pattern: parallel clause classification, plain-English explanations,
risk distribution chart. Adapt for advocacy domain:
Provider
Use zero-retention or local model only — see docs/security.md §AI Provider Routing