A Streamlit-based web application that provides accurate immigration information through AI-powered search of official government websites.
- AI-Powered Responses: Utilizes OpenAI's GPT-4o and embedding models to provide accurate, context-aware responses
- Official Source Data: Scrapes and indexes information from official government immigration websites
- Multi-Country Support: Currently supports US and Canadian immigration resources
- Automatic Updates: Configurable scraping interval to keep information current
- Vector Search: Uses embeddings and semantic search to find the most relevant information
- Chat Interface: User-friendly chat UI built with Streamlit
- Data Persistence: Stores scraped content and embeddings in Supabase
- Python 3.12.9 or higher
- Streamlit
- OpenAI API key
- Supabase account and credentials
-
Clone the repository:
-
Install dependencies:
pip install -r requirements.txt
- Create a
.env
file with your credentials:
OPENAI_API_KEY=your_openai_api_key
SUPABASE_URL=your_supabase_url
SUPABASE_KEY=your_supabase_key
SCRAPE_INTERVAL_DAYS=7
- Run the application:
streamlit run app.py
The application requires the following tables in your Supabase database:
immigration_website_chunks
- Stores the website content chunks and embeddingsimmigration_website_scrape_status
- Tracks when websites were last scraped
Schema definitions are available in the database_setup.sql
file.
- Select the country and specific immigration websites from the sidebar
- Click "Check & Update Website Data" to ensure you have the latest information
- Ask your immigration-related questions in the chat interface
To add or modify the immigration information sources, edit the constants.py
file:
us_websites = {
"USCIS General": ["https://www.uscis.gov/..."],
"Work Visas": ["https://www.uscis.gov/working-in-the-united-states", ...],
# Add more categories and URLs
}
canada_websites = {
"Immigration Canada": ["https://www.canada.ca/en/immigration-refugees-citizenship..."],
# Add more categories and URLs
}
The application follows these main processes:
-
Data Collection:
- Scrapes content from official immigration websites
- Breaks content into manageable chunks
- Computes vector embeddings for each chunk
- Stores chunks and embeddings in Supabase
-
Query Processing:
- Receives user questions via chat interface
- Converts question to vector embedding
- Retrieves most relevant content chunks using similarity search
- Sends context and question to GPT-4o for processing
- Returns answer with citation sources
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This tool is meant to provide general information about immigration procedures and is not a substitute for legal advice. Always consult with an immigration lawyer or official government resources for your specific case.
- Run locally with the following command:
streamlit run app.py
- How long can I get my pgwp after studying in Canada?
- Can my common law spouse be included in my express entry application?
- What programs are eligible for the pgwp?
- How long can I work in Canada with a pgwp?
Here are some test questions you can use to evaluate your Immigration Consultant Assistant with Supabase integration:
- "What are the eligibility requirements for a green card in the United States?"
- "How long does the naturalization process typically take?"
- "What's the difference between adjustment of status and consular processing?"
- "Can you explain the child status protection act?"
- "What documents are needed for the green card interview?"
- "What visa options do I have if I want to work temporarily in the US?"
- "How can I apply for citizenship if I'm married to a US citizen?"
- "What are the current processing times for employment-based green cards?"
- "Explain the public charge rule and how it affects green card applications."
- "What happens if my green card application is denied?"
- "I've been a permanent resident for 4 years. Can I apply for citizenship?"
- "How does having a criminal record affect my immigration status?"
- "What happens to my immigration status if I get divorced during the green card process?"
- "Can I travel outside the US while my adjustment of status application is pending?"
- "How do I renew my employment authorization document?"
- "I'm on an H-1B visa. What's the process to get a green card and eventually citizenship?"
- "What immigration benefits are available to immediate relatives of US citizens?"
- "How do priority dates work for family-based immigration, and how can I check my status?"
- "What are my options if my visa has expired but I'm still in the US?"
- "How do I prepare for the naturalization test and interview?"
- What are the main eligibility criteria for Express Entry?
- How does the Comprehensive Ranking System (CRS) work for Express Entry applications?
- What is the difference between the Federal Skilled Worker Program and the Federal Skilled Trades Program?
- What family members can I sponsor to immigrate to Canada?
- What are the income requirements for family sponsorship?
- How long does the Express Entry application process typically take?
- What is an Invitation to Apply (ITA) in the Express Entry system?
- What documents are required for a complete Express Entry profile?
- What are the differences between the Ontario Immigrant Nominee Program streams?
- How does the BC PNP Tech program work?
- What are the requirements for Alberta's Rural Immigration Stream?
- What are the unique features of Quebec's immigration system compared to other provinces?
- Which Manitoba PNP streams are available for entrepreneurs?
- What are the advantages of applying through Saskatchewan's Express Entry category?
- How does Nova Scotia's Labour Market Priorities Stream identify candidates?
- What is the New Brunswick Strategic Initiative stream designed for?
- What business immigration options are available through Prince Edward Island?
- What are the requirements for healthcare professionals under Newfoundland and Labrador's PNP?
- How does the Yukon Community Program differ from other territorial nominee programs?
- What industries are prioritized in the Northwest Territories nominee program?
- What are the settlement fund requirements for Nunavut's nominee program?
- How long can I stay in Canada with a study permit?
- What are the requirements for a Post-Graduation Work Permit (PGWP)?
- Can I work while studying in Canada?
- What is the Student Direct Stream and which countries are eligible?
- How can I extend my study permit if my program takes longer than expected?
- What is the difference between LMIA-based work permits and LMIA-exempt work permits?
- How does the Global Talent Stream work?
- What are the requirements for an Open Work Permit?
- How can I transition from a temporary work permit to permanent residence?
- What is the maximum duration of a TFWP (Temporary Foreign Worker Program) work permit?
- What are the residency requirements for Canadian citizenship?
- How do I prepare for the Canadian citizenship test?
- What language proficiency level is required for citizenship?
- Can I hold dual citizenship when becoming a Canadian citizen?
- How long does the citizenship application process take?
- How do immigration programs differ for skilled workers versus entrepreneurs?
- What are the differences in processing times between Express Entry and Provincial Nominee Programs?
- How has COVID-19 affected Canadian immigration policies and processing?
- What is a Police Clearance Certificate and when is it required?
- What are the differences in healthcare coverage for permanent residents versus temporary residents?
- How do I prove my language proficiency for different immigration programs?
- What are the main differences between applying for immigration to Quebec versus other provinces?
- How do the Atlantic Immigration Program and Provincial Nominee Programs compare?
- What are my options if my immigration application is refused?
- How do education credential assessments work for foreign degrees?