How ilyassbelayachi/smart-immigration works
Smart Immigration Process is a preparation assistant for Canadian study-permit applicants; it provides sourced information and indicative rule checks, not decisions or submissions to authorities. The main workflow is an applicant request through the API: questions get lexical retrieval and either a cited answer or abstention; profiles get rule-based verdicts and, for checklist requests, document-preparation items. A separate ingestion command collects official pages for a corpus. The map reflects sampled source and README evidence; the demo UI and ingestion destinations are documented, but not all runtime details are sampled.
Main entry points: knowledge/routes.py Knowledge routes · dossier/routes.py Dossier routes · api.py FastAPI application · retrieval.py Lexical retrieval
Components 15
Knowledge assistance
- Knowledge routes
src/smart_immigration/knowledge/routes.py - Lexical retrieval
src/smart_immigration/knowledge/retrieval.py - Sourced answers
src/smart_immigration/knowledge/qa.py - Seed corpus
data/seed/seed_chunks.jsonl - Page ingestion
src/smart_immigration/knowledge/ingest.py - Page source list
data/sources.yaml
Applicant dossier
- Dossier routes
src/smart_immigration/dossier/routes.py - Permit rule engine
src/smart_immigration/dossier/rules.py - Permit rules
rules/study_permit_ca.yaml - Preparation checklist
src/smart_immigration/dossier/checklist.py
API and contracts
- FastAPI application
src/smart_immigration/api.py - Demo interface
frontend - Request and result schemas
src/smart_immigration/schemas.py
Other components
- Applicant
- Official IRCC pages
Connections 16
- Applicant → Demo interface: uses
README.md - Demo interface → FastAPI application: requests
- Applicant → FastAPI application: submits profile or question
README.md - FastAPI application → Knowledge routes: mounts routes
src/smart_immigration/api.py - FastAPI application → Dossier routes: mounts routes
src/smart_immigration/api.py - Knowledge routes → Request and result schemas: uses schemas
src/smart_immigration/knowledge/routes.py - Dossier routes → Request and result schemas: uses schemas
src/smart_immigration/dossier/routes.py - Knowledge routes → Lexical retrieval: loads index
src/smart_immigration/knowledge/routes.py - Knowledge routes → Sourced answers: requests answer
src/smart_immigration/knowledge/routes.py - Lexical retrieval → Seed corpus: loads fallback corpus
src/smart_immigration/knowledge/retrieval.py - Sourced answers → Lexical retrieval: searches passages
src/smart_immigration/knowledge/qa.py - Page ingestion → Page source list: reads sources
src/smart_immigration/knowledge/ingest.py - Page ingestion → Official IRCC pages: fetches pages
src/smart_immigration/knowledge/ingest.py - Dossier routes → Permit rule engine: assesses profile
src/smart_immigration/dossier/routes.py - Permit rule engine → Permit rules: loads rules
src/smart_immigration/dossier/rules.py - Dossier routes → Preparation checklist: builds checklist
src/smart_immigration/dossier/routes.py