A production-grade AI assistant for Medicaid domain knowledge, built with LangChain, LangGraph, and RAG (Retrieval-Augmented Generation). Powered by Groq for ultra-fast inference.
User Query
│
▼
┌─────────────────────────────────┐
│ LangGraph Orchestrator │ ← Stateful multi-agent workflow
│ ┌──────────┐ ┌─────────────┐ │
│ │ Router │→ │ RAG Agent │ │ ← Retrieves Medicaid documents
│ │ Node │ │ │ │
│ └──────────┘ └─────────────┘ │
│ │ ┌─────────────┐ │
│ └──────→ │ Policy │ │ ← Answers policy questions
│ │ Agent │ │
│ └─────────────┘ │
│ │ ┌─────────────┐ │
│ └──────→ │ Eligibility│ │ ← Checks eligibility criteria
│ │ Agent │ │
│ └─────────────┘ │
│ ┌─────────────┐ │
│ │ Summarizer │ │ ← Final answer synthesis
│ │ Node │ │
│ └─────────────┘ │
└─────────────────────────────────┘
│
▼
Response to User
| Component | Technology | Purpose |
|---|---|---|
| RAG Pipeline | LangChain + ChromaDB | Retrieve relevant Medicaid docs |
| Graph Orchestration | LangGraph | Route queries to the right agent |
| LLM Inference | Groq (Llama 3.1) | Fast, free inference |
| Embeddings | HuggingFace (local) | Encode documents + queries |
| Vector Store | ChromaDB | Store/search document chunks |
| CLI Interface | Rich (Python) | Beautiful terminal UI |
medicaid-ai-assistant/
├── config/
│ └── settings.py # All configuration (API keys, model names, paths)
├── data/
│ └── documents/ # Medicaid PDF/text documents go here
├── src/
│ ├── rag/
│ │ ├── document_loader.py # Load & chunk Medicaid documents
│ │ ├── embeddings.py # HuggingFace embedding setup
│ │ └── vector_store.py # ChromaDB setup & retrieval
│ ├── chains/
│ │ ├── rag_chain.py # LangChain RAG chain
│ │ └── qa_chain.py # Question-Answer chain
│ ├── agents/
│ │ ├── rag_agent.py # Retrieval-augmented agent
│ │ ├── policy_agent.py # Medicaid policy specialist
│ │ └── eligibility_agent.py # Eligibility checker agent
│ ├── graph/
│ │ ├── state.py # LangGraph state schema
│ │ ├── nodes.py # All graph node functions
│ │ └── workflow.py # LangGraph workflow builder
│ ├── tools/
│ │ └── medicaid_tools.py # Custom LangChain tools
│ └── utils/
│ ├── prompts.py # All prompt templates
│ └── helpers.py # Utility functions
├── tests/
│ ├── test_rag.py
│ └── test_graph.py
├── main.py # Entry point — CLI chatbot
├── ingest.py # Document ingestion script
├── requirements.txt
└── .env.example
git clone <your-repo>
cd medicaid-ai-assistant
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txtcp .env.example .env
# Edit .env and add your GROQ_API_KEYpython ingest.pypython main.py- "What are the income limits for Medicaid eligibility in 2024?"
- "Does Medicaid cover dental care for adults?"
- "What is the difference between Medicaid and Medicare?"
- "How do I apply for Medicaid if I just lost my job?"
- "What is a Medicaid waiver program?"
- Add more documents to
data/documents/and re-runingest.py - Add new agents in
src/agents/and wire them into the graph - Add new tools in
src/tools/medicaid_tools.py - Swap ChromaDB for Pinecone/Weaviate for production scale