SAM – Intelligent Immigration Assistant for H-1B & PERM

SAM is an intelligent assistant designed for international students and foreign professionals navigating the U.S. employment-based visa system.
It solves the biggest hurdles in the process — confusing rules, shifting timelines, and the challenge of finding real employers who actually sponsor — by combining live web scraping, structured database queries, and agentic AI reasoning in one unified, conversational interface.


What Makes SAM Different

  • Agentic AI Orchestration
    At SAM’s core is a LangChain-powered agent that autonomously decides how to answer each query — whether to:

    • Scrape live web sources in real time
    • Query historical LCA/PERM data from Supabase
    • Combine and cross-reference multiple data sources
    • Perform intermediate reasoning steps before responding
      This self-directed tool selection and execution allows SAM to handle complex, multi-step immigration questions seamlessly.
  • Live Data Ingestion
    Scrapes MyVisaJobs and official U.S. government websites in real time to pull employer rankings, petition counts, and wage data.

  • Centralized LCA/PERM Records
    Uses a Supabase database to store and query certified Labor Condition Applications and PERM filings for historical and analytical context.

  • Immigration-Aware Chatbot
    Powered by a Flask API backend and LangChain agents, SAM detects intent (e.g., “How many people from my university got H-1Bs last year?”) and executes live + database queries to return precise answers.

  • Source-Linked Responses
    Every answer is paired with clickable source “bubbles” so users can verify information immediately.


Key Technical Components

Backend

  • Flask REST API (/api/chat) for handling chat messages and returning structured responses
  • Agentic LangChain core that orchestrates scraping, database queries, and reasoning steps automatically
  • Supabase client for structured LCA/PERM queries with sync & async support

Live Data Layer

  • src/web_sources.py scrapers for MyVisaJobs employer and university pages (FY-aware URL handling)
  • Planned integrations with USCIS / DOL public data portals

Database Layer

  • Supabase schema with lca_filings, lca_worksites, and perm_disclosure tables
  • SQL JOIN queries combine filings with worksites for richer insights
  • Async methods for AI agent compatibility

Frontend

  • Dark-themed, modern chat UI with macOS-style chrome
  • Message bubbles, typing indicators, quick action buttons
  • Clickable source link bubbles for transparency

AI Integration

  • LangChain tools for combined LCA/PERM queries
  • Agent plans and executes multi-step workflows: scrape → query DB → filter → summarize
  • Async support for concurrent live + static lookups
  • Ready for LangGraph or other orchestrators for multi-agent setups

Impact

With SAM, visa-seekers can instantly:

  • Identify top H-1B sponsoring employers
  • See historical filing patterns for a specific company or school
  • Compare prevailing wage data across worksites
  • Plan their visa pathway with reliable, current information

Instead of juggling government XLSX files, outdated blog posts, and separate search tools, users get a single, interactive system that delivers both immediacy (live scraping) and depth (structured LCA/PERM data).

Built With

Share this project:

Updates