metadata
title: Health-Insurance-RAG
emoji: π₯
colorFrom: indigo
colorTo: purple
sdk: docker
app_port: 7860
pinned: false
π₯ Health Insurance AI Copilot & RAG Pipeline
A high-fidelity AI copilot for answering structured and unstructured health insurance policy queries. Built with FastAPI, Streamlit, LangGraph, Mem0 agent memory, Docling layout-aware chunking, NetworkX Knowledge Graphs, and OpenAI GPT-4o.
Features
- Dynamic RAG Pipeline: Combines BM25 lexical search, dense vector embeddings, and Cross-Encoder reranking.
- Structured Knowledge Graph (Graph RAG): Maps relationships between insurance plans, drugs, conditions, and network providers for complex, multi-hop lookups.
- π§ Mem0 Session Memory: Agent remembers facts within a session (plan tier, drug preferences, prior auth history) for personalized, context-aware answers β resets cleanly on Space refresh.
- 5-Node LangGraph Orchestrator:
memory_search β classify_intent β retrieve β synthesize β memory_add - High-Fidelity Developer Console: Interactive UI to inspect and visualize live agent orchestration node workflows.
- Unified Sidecar Container: FastAPI backend and Streamlit frontend served on a single port (
7860).
Deployment on Hugging Face Spaces
- Push this repo to your HF Space (Docker SDK, port 7860)
- Go to Settings β Variables and Secrets and add:
OPENAI_API_KEYβ your OpenAI keyGOOGLE_API_KEYβ your Google key (optional)
- The Space will build automatically β Mem0 runs in-memory, no extra setup needed.
API Endpoints
| Method | Path | Description |
|---|---|---|
POST |
/chat |
Send a query, get answer + memory facts used |
GET |
/memory/{session_id} |
Inspect what Mem0 remembers for a session |
DELETE |
/memory/{session_id} |
Clear session memory (keep chat history) |
DELETE |
/session/{session_id} |
Clear full session including memory |
GET |
/health |
Health check |
GET |
/dev-console |
Live developer console |