A GraphRAG-based chatbot built using LangChain and Neo4j, designed for hospital systems. The chatbot retrieves structured and unstructured data about patients, visits, physicians, insurance payers, and hospital locations. This project also explores integrating graph databases and deploying the chatbot using FastAPI & Streamlit.
- GraphRAG (Graph Retrieval-Augmented Generation) for querying hospital data.
- LangChain-powered chatbot for patient and hospital-related inquiries.
- Neo4j graph database integration for structured data retrieval.
- FastAPI-based API for backend services.
- Streamlit frontend for chatbot interaction.
- ETL pipeline for Neo4j to handle hospital data ingestion.
- Dockerized deployment for seamless integration and scaling.
└── jkanishkha0305-medibot-graphrag/
├── README.md
├── docker-compose.yml
├── requirements.txt
├── chatbot_api/
│ ├── Dockerfile
│ ├── pyproject.toml
│ └── src/
│ ├── entrypoint.sh
│ ├── main.py
│ ├── agents/
│ │ └── hospital_rag_agent.py
│ ├── chains/
│ │ ├── hospital_cypher_chain.py
│ │ └── hospital_review_chain.py
│ ├── models/
│ │ └── hospital_rag_query.py
│ ├── tools/
│ │ └── wait_times.py
│ └── utils/
│ └── async_utils.py
├── chatbot_frontend/
│ ├── Dockerfile
│ ├── pyproject.toml
│ └── src/
│ ├── entrypoint.sh
│ └── main.py
├── data/
│ ├── data_exploration.ipynb
│ ├── hospitals.csv
│ ├── patients.csv
│ ├── payers.csv
│ ├── physicians.csv
│ ├── reviews.csv
│ └── visits.csv
├── hospital_neo4j_etl/
│ ├── Dockerfile
│ ├── pyproject.toml
│ └── src/
│ ├── entrypoint.sh
│ └── hospital_bulk_csv_write.py
└── tests/
├── async_agent_requests.py
└── sync_agent_requests.py
- Python 3.8+
- Docker & Docker Compose
- Neo4j
git clone https://github.com/jkanishkha0305/medibot-graphrag.git
cd medibot-graphragpip install -r requirements.txtCreate a .env file and define:
NEO4J_URI=bolt://localhost:7687
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=password
OPENAI_API_KEY=your_api_keydocker-compose up --buildcd chatbot_api/src
uvicorn main:app --host 0.0.0.0 --port 8000cd chatbot_frontend/src
streamlit run main.pyTo test API requests:
python tests/sync_agent_requests.pyFeel free to fork, open issues, or submit pull requests!
This project is licensed under the MIT License.