Purpose
Scan a folder of visa documents, validate against country checklist, produce gap analysis and approval probability score.
Steps
- List all files in the target folder
- Read and extract text from each document via OCR
- Load checklist from /checklists/{country}.json
- PII Scrubbing Layer eg. Strip raw passport numbers before sending to LLM — send structure only
- Compare docs vs checklist
- Generate structured report with Gaps + Probability Score + Key Insights
- Save report to folder as visa-review-report-{Current Date and Time}.md
Process
- Input Collection: Ask user for the folder path containing visa documents and the target country
- File Discovery: List all files in the specified folder
- Document Processing: For each document:
- Extract text using OCR (try multiple methods: macOS Vision, EasyOCR, Tesseract)
- Apply PII scrubbing to remove sensitive data like passport numbers, SSNs, etc.
- Structure the extracted data for comparison
- Checklist Loading: Load the appropriate country checklist from /checklists/{country}.json
- Validation & Gap Analysis: Compare document contents against checklist requirements
- Scoring: Calculate approval probability based on completeness and accuracy
- Report Generation: Create a detailed markdown report with:
- Identified gaps
- Approval probability score (0-100%)
- Key insights and recommendations
- Output: Save report as visa-review-report-{timestamp}.md in the same folder
Inputs
- Folder path containing visa documents
- Target country (for checklist selection)
Outputs
- Markdown report file: visa-review-report-{timestamp}.md
Dependencies
- OCR tools (macOS Vision, EasyOCR, Tesseract)
- JSON checklist files in /checklists/ directory
- Basic text processing utilities
Guardrails
- PII scrubbing must be applied before any LLM processing
- Handle missing checklists gracefully
- Support common document formats (PDF, JPG, PNG, etc.)
- Provide clear error messages for unsupported formats