How hamdha-saheer/agentic-rag-insurance-lk works
This is a Streamlit advisor for Sri Lankan insurance questions. A user supplies a question and optional profile; the LangGraph supervisor selects up to two domains, domain agents query their separate indexes, and an aggregator returns advice and sources to the UI. The retrieval layer loads FAISS indexes, embeds queries, and generates cited answers with Groq. The README also documents optional Tavily search and OCR-based document preparation, but their implementation is not present in the shown tree. Evaluation is a separate workflow; its source was sampled.
Main entry points: rag_pipeline.py RAG pipeline · multi_agent.py Supervisor routing · evaluator.py Answer evaluator · app.py Streamlit advisor
Components 19
User interface
- Streamlit advisor
app.py
Query orchestration
- Supervisor routing
agents/multi_agent.py - Domain classifier
agents/domain_router.py - Motor agent
agents/multi_agent.py - Health agent
agents/multi_agent.py - Life agent
agents/multi_agent.py - General agent
agents/multi_agent.py - Answer aggregator
agents/multi_agent.py
Retrieval and generation
- RAG pipeline
agents/rag_pipeline.py - Query embeddings
agents/rag_pipeline.py - Domain FAISS indexes
agents/rag_pipeline.py - Prompt and generation
agents/rag_pipeline.py - Groq LLM
- Runtime configuration
config.py - Tavily search
Evaluation
- Answer evaluator
evaluation/evaluator.py - Ground-truth questions
evaluation/ground_truth.json - Evaluation results
evaluation/results
Other components
- Insurance user
Connections 27
- Insurance user → Streamlit advisor: asks question
app.py - Streamlit advisor → Supervisor routing: submits query
app.py - Supervisor routing → Domain classifier: classifies query
agents/multi_agent.py - Supervisor routing → Motor agent: dispatches motor
agents/multi_agent.py - Supervisor routing → Health agent: dispatches health
agents/multi_agent.py - Supervisor routing → Life agent: dispatches life
agents/multi_agent.py - Supervisor routing → General agent: dispatches general
agents/multi_agent.py - Motor agent → RAG pipeline: queries index
agents/multi_agent.py - Health agent → RAG pipeline: queries index
agents/multi_agent.py - Life agent → RAG pipeline: queries index
agents/multi_agent.py - General agent → RAG pipeline: queries index
agents/multi_agent.py - Motor agent → Answer aggregator: joins result
agents/multi_agent.py - Health agent → Answer aggregator: joins result
agents/multi_agent.py - Life agent → Answer aggregator: joins result
agents/multi_agent.py - General agent → Answer aggregator: joins result
agents/multi_agent.py - Answer aggregator → Streamlit advisor: returns advice
agents/multi_agent.py - RAG pipeline → Runtime configuration: reads settings
agents/rag_pipeline.py - RAG pipeline → Domain FAISS indexes: loads and searches
agents/rag_pipeline.py - RAG pipeline → Query embeddings: embeds query
agents/rag_pipeline.py - RAG pipeline → Prompt and generation: builds prompt
agents/rag_pipeline.py - Prompt and generation → Groq LLM: generates answer
agents/rag_pipeline.py - Answer evaluator → Ground-truth questions: loads questions
evaluation/evaluator.py - Answer evaluator → Domain classifier: routes questions
evaluation/evaluator.py - Answer evaluator → RAG pipeline: generates answers
evaluation/evaluator.py - Answer evaluator → Groq LLM: scores answers
evaluation/evaluator.py - Answer evaluator → Evaluation results: writes scores
evaluation/evaluator.py - RAG pipeline → Tavily search: optional web search
README.md