Authors: Geoffrey Duncan Opiyo, Hillary Arinda, Justine Okumu, Deo Mugabe
Tags: RAG · AI · Immigration · LangChain · LangGraph · Multi-Agent · Session Management · Python · AAIDC-M2
U.S. immigration information is dense, scattered across lengthy PDFs, policy manuals, and form instructions that change over time. Applicants, families, workers, and students must translate legal jargon into actionable steps, often without reliable, up-to-date guidance.
AskImmigration 1.0 solved part of this challenge by delivering retrieval-augmented, citation-backed responses from vetted official PDFs and structured form data. However, it was limited to a single-agent RAG pipeline, which struggled with multi-step tasks and complex fee planning.
AskImmigration 2.0 builds on that foundation. It introduces a multi-agent architecture for session-aware context handling, dynamic fee analysis, real-time policy checks, and built-in quality validation. This evolution transforms a static question–and–answer tool into a strategic immigration assistant designed to help millions of immigrants make informed decisions with confidence.
AskImmigration 2.0 specifically aims to:
Our original AskImmigration used a straightforward RAG approach—effective but limited:
Version 2.0 represents a fundamental architectural transformation: a multi-agent system where specialized agents coordinate through intelligent workflow orchestration, strategically deploying tools based on question analysis and validation requirements.
AskImmigration 2.0 operates as a coordinated ecosystem of specialized agents working together like a well-orchestrated team. When you ask an immigration question, the system doesn't just search documents—it thinks strategically about your needs and coordinates the right combination of tools and expertise.
The Manager Agent analyzes your question and develops a comprehensive strategy. Is this a simple factual query or a complex procedural question? Does it involve fees, timelines, or eligibility requirements? Based on this analysis, it orchestrates the optimal combination of tools and processing approaches.
The Synthesis Agent takes the coordinated results and builds a contextual response that integrates information from multiple sources. Meanwhile, the Reviewer Agent ensures quality and completeness before delivering the final guidance.
For full setup and examples, see our README.
The brain of the system that analyzes incoming questions and coordinates the entire workflow. Rather than applying the same approach to every question, it strategically determines what tools are needed, in what sequence, and with what level of detail.
For a simple question like "What is an F-1 visa?" it might deploy just document retrieval. But for "What's the cost and timeline for changing from F-1 to H-1B status with my family?" it coordinates document research, fee calculations, web searches for current processing times, and comprehensive synthesis.
Our multi-agent system orchestrates a suite of specialized tools:
RAG Retrieval Tool searches through curated immigration documents with semantic understanding, prioritizing official sources and contextually relevant information.
Fee Calculator Tool performs dynamic immigration cost analysis, handling complex family scenarios, premium processing options, and fee variations across different visa types.
Web Search Tool provides real-time updates on policy changes, current processing times, and the latest regulatory developments that affect immigration procedures.
Session Management Tool maintains conversation context, enabling natural follow-up questions and progressive guidance that builds on previous discussions.
Receives the Manager's strategic recommendations and executes them by calling the advised tools. Based on the Manager's analysis, it might use fee calculator tool, web search tool, or enhanced RAG retrieval to gather the specific information needed. Then it synthesizes all results into comprehensive, contextual responses that understand how different pieces of immigration guidance connect to your situation.
Validates response accuracy, completeness, and usefulness. When revisions are needed, it coordinates feedback loops back through the system, ensuring every response meets high standards before delivery.
The system is built on a compiled state graph using LangGraph. Each user query flows through conditional nodes:
The workflow integrates the SessionManager, which:
The multi-agent workflow enables sophisticated coordination that adapts to question complexity:
Simple Questions get streamlined processing through optimized tool selection.
Complex Scenarios trigger comprehensive analysis with multiple tools working in coordination.
Follow-up Questions leverage conversation context and previous tool results for efficient processing.
Quality Control ensures every response is validated before delivery, with revision workflows when needed.
✅ Strategic Multi-Agent Coordination
Manager Agent analyzes questions and orchestrates optimal tool combinations, ensuring the right resources are deployed for each immigration scenario.
✅ Intelligent Tool Orchestration
Tools work together synergistically—RAG provides context, fee calculator handles costs, web search updates current policies, all coordinated by strategic analysis.
✅ Document-Grounded Intelligence
Enhanced RAG retrieval with strategic document selection, semantic search optimization, and official source prioritization for reliable immigration guidance.
✅ Dynamic Workflow Adaptation
System adapts processing strategy based on question complexity, urgency, and type—simple questions get streamlined processing, complex scenarios get comprehensive analysis.
✅ Quality Control Pipeline
Reviewer Agent validates each component and coordinates revisions when needed, ensuring accuracy and completeness.
✅ Session-Aware Context
Persistent conversation memory enables follow-up questions, topic continuity, and progressive immigration guidance across multiple interactions.
✅ Real-Time Integration
Web search capabilities provide current processing times, policy updates, and regulatory changes, ensuring advice reflects the latest immigration landscape.
Component | Technology |
---|---|
Multi-Agent Orchestration | LangGraph + StateGraph |
Strategic Coordination | Manager Agent + Structured Output |
Tool Registry | Custom Tool Management System |
Document Intelligence | ChromaDB + HuggingFace Embeddings |
Session Persistence | SQLite + Session Manager |
API Framework | FastAPI + Pydantic Models |
LLM Engine | LangChain + GROQ/OpenAI |
Quality Control | Reviewer Agent + Component Validation |
Frontend Interface | React + TypeScript |
Configuration | YAML + Environment Management |
Observability | LangSmith |
When you ask about H-1B costs, the Manager Agent doesn't just search documents. It recognizes this as a fee inquiry and coordinates the fee calculator tool alongside document retrieval, ensuring you get both procedural guidance and accurate cost breakdowns.
For questions like "How do I change from F-1 to H-1B status?" the system orchestrates multiple tools: document retrieval for procedures, web search for current timelines, fee calculations for costs, and synthesis of all information into actionable guidance.
When you ask "What about my spouse?" after discussing H-1B, the system understands the context and coordinates tools specifically for H-4 dependent status, building on the previous conversation intelligently.
Every response goes through quality validation. If the Reviewer Agent detects incomplete information or accuracy concerns, it coordinates revision workflows to improve the response before delivery.
Metric | Result |
---|---|
Response Time | 2-3 seconds (new questions), 1-2 seconds (follow-ups) |
Session Memory | Unlimited conversation turns per session |
Follow-up Accuracy | >95% correct context understanding |
Tool Integration | All 3 tools working simultaneously |
Quality Control | <2% responses require revision |
// Single endpoint triggers full multi-agent workflow const response = await api.query( "What's the cost and timeline for H-1B premium processing?", sessionId ); // Response includes coordinated results from multiple agents and tools { "answer": "H-1B premium processing costs $2,500 and guarantees...", "tools_used": ["rag_retrieval", "fee_calculator", "web_search"], "workflow_strategy": "comprehensive_analysis", "quality_validated": true }
🎯 Strategic Intelligence: The Manager Agent develops comprehensive response strategies, selecting optimal tool combinations and processing approaches rather than applying one-size-fits-all solutions.
⚙️ Tool Orchestration: Strategic coordination of RAG retrieval, fee calculations, web searches, and session management based on intelligent question analysis, not random tool usage.
🔄 Quality Assurance: Systematic validation ensures every response meets quality standards, with coordinated revision workflows when improvements are needed.
🎭 Specialized Expertise: Each agent has distinct responsibilities and capabilities, enabling sophisticated task delegation and coordinated problem-solving.
🔧 Adaptive Processing: The system intelligently adapts its approach—simple questions get streamlined processing, complex scenarios get comprehensive multi-tool analysis.
Scale of need
47.8 million immigrants lived in the United States in 2023, and ≈ 75 % held lawful status (naturalized citizens, green-card holders, or temporary-visa holders).
Daily challenge
From H-1B extensions to family reunifications, immigrants must navigate complex rules. Existing guidance is often fragmented and generic, causing costly errors and missed opportunities.
AskImmigration 2.0 advantage
A multi-agent engine delivers strategic, coordinated advice at scale—bringing expert-level guidance to millions who previously lacked comprehensive support.
Traditional RAG Approach: Searches documents for "F-1 to H-1B" and returns generic information.
AskImmigration 2.0 Multi-Agent Approach:
Result: Instead of basic document excerpts, users get complete guidance including procedures, costs, timelines, and next steps.
Traditional Approach: Basic fee lookup with limited context.
Multi-Agent Orchestration:
Result: Comprehensive family immigration cost analysis with strategic guidance.
🤖 Additional Specialist Agents: Document Analysis Agent for uploaded USCIS notices, Case Tracking Agent for status integration, Legal Research Agent for advanced policy interpretation.
🌐 Enhanced Tool Ecosystem: Form completion guidance, document generation capabilities, appointment scheduling integration.
🎯 Advanced Orchestration: Parallel tool processing, conditional workflow branching, human-in-the-loop attorney review integration.
# Install and configure the system git clone git@github.com:okumujustine/AskImmigrate2.0.git cd AskImmigrate2.0 pip install -r requirements.txt # Set up your environment echo "GROQ_API_KEY=your_api_key" > .env echo "OPENAI_API_KEY=your_api_key" > .env # Experience strategic coordination python backend/code/cli.py --agent -q "H-1B premium processing for family of 4"
# Run backend on port 8088 uvicorn backend.code.api:app --host 0.0.0.0 --port 8088 & # Run frontend on port 4044 cd frontend && npm run dev -- --port 4044
🔐 License: This project is licensed under the MIT License
AskImmigration 2.0 represents a paradigm shift from simple RAG systems to sophisticated multi-agent orchestration. Our coordinated ecosystem of specialized agents and intelligent tools provides comprehensive immigration guidance that adapts to question complexity, user context, and information requirements.
The strategic coordination between Manager, Synthesis, and Reviewer agents—combined with intelligent tool orchestration—ensures that every response is accurate, complete, and contextually relevant. This isn't just a chat system; it's an AI immigration advisor that thinks strategically, coordinates resources intelligently, and delivers comprehensive guidance.
By orchestrating multiple AI agents and specialized tools, AskImmigration 2.0 transforms complex immigration scenarios into clear, actionable guidance—making the U.S. immigration system more navigable for everyone.
Ready to experience coordinated AI intelligence? Visit our GitHub repository and see multi-agent orchestration in action.