https://github.com/lehuyhongnhat/llm-rag-chatbot-with-langchain
  
  
    This project builds a medical Q&A chatbot using a Large Language Model (LLM) with Retrieval-Augmented Generation (RAG). Developed with LangChain and Docker, it employs Prompt Engineering and a vector database to ensure accurate, relevant answers. 
    https://github.com/lehuyhongnhat/llm-rag-chatbot-with-langchain
  
chatbot docker docker-compose gemini-api langchain medical-chatbot-with-llm-and-rag neo4j prompt-engineering python rag vector-database
        Last synced: 7 months ago 
        JSON representation
    
This project builds a medical Q&A chatbot using a Large Language Model (LLM) with Retrieval-Augmented Generation (RAG). Developed with LangChain and Docker, it employs Prompt Engineering and a vector database to ensure accurate, relevant answers.
- Host: GitHub
- URL: https://github.com/lehuyhongnhat/llm-rag-chatbot-with-langchain
- Owner: LeHuyHongNhat
- License: mit
- Created: 2024-11-12T03:15:37.000Z (12 months ago)
- Default Branch: master
- Last Pushed: 2025-03-13T02:30:07.000Z (8 months ago)
- Last Synced: 2025-03-13T03:26:08.670Z (8 months ago)
- Topics: chatbot, docker, docker-compose, gemini-api, langchain, medical-chatbot-with-llm-and-rag, neo4j, prompt-engineering, python, rag, vector-database
- Language: Python
- Homepage:
- Size: 20 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
- 
            Metadata Files:
            - Readme: README.md
- License: LICENSE.md
 
Awesome Lists containing this project
README
          
# 🏥 Hospital System RAG Chatbot

*Một chatbot thông minh sử dụng LangChain và RAG để tương tác với hệ thống bệnh viện*
[](https://choosealicense.com/licenses/mit/)
[](https://www.python.org/downloads/)
[](https://fastapi.tiangolo.com)
[](https://neo4j.com/)
## 📋 Giới thiệu
Chatbot thông minh này được xây dựng với LangChain và RAG (Retrieval-Augmented Generation) để cung cấp trải nghiệm tương tác tự nhiên với hệ thống bệnh viện. 
### Khả năng chính:
- 🔍 Truy vấn thông tin về bệnh viện, bác sĩ và bệnh nhân
- 📊 Phân tích dữ liệu về lượt khám và chi phí
- 💬 Xử lý đánh giá và phản hồi của bệnh nhân
- ⏱️ Theo dõi thời gian chờ tại các bệnh viện
- 🏦 Quản lý thông tin bảo hiểm và thanh toán
## 🚀 Tính năng
### Core Technologies
- **RAG với LangChain** 
  - Kết hợp dữ liệu có cấu trúc và phi cấu trúc 
  - Tạo câu trả lời chính xác và tự nhiên
- **Neo4j Graph Database**
  - Lưu trữ dữ liệu quan hệ phức tạp
  - Truy vấn hiệu quả với Cypher
- **FastAPI Backend**
  - API hiệu năng cao
  - Tài liệu API tự động với Swagger
  - Dễ dàng mở rộng
- **Streamlit Frontend**
  - Giao diện người dùng thân thiện
  - Tương tác trực quan
  - Cập nhật realtime
- **Xử lý ngôn ngữ tự nhiên**
  - Hỗ trợ tiếng Việt
  - Hiểu ngữ cảnh và ý định người dùng
## 🛠️ Tech Stack
[](https://python.langchain.com/docs/get_started/introduction)
[](https://neo4j.com/)
[](https://fastapi.tiangolo.com/)
[](https://streamlit.io/)
[](https://www.python.org/)
## ⚙️ Cài đặt
### 1. Clone repository
```bash
git clone https://github.com/LeHuyHongNhat/LLM-RAG-Chatbot-with-LangChain.git
cd LLM-RAG-Chatbot-with-LangChain
```
### 2. Tạo môi trường ảo
```bash
conda create -n chatbot python=3.10
conda activate chatbot
```
### 3. Cài đặt dependencies
```bash
pip install -r requirements.txt
```
### 4. Cấu hình môi trường
```bash
# Tạo file .env từ mẫu
cp .env.example .env
# Cập nhật các biến môi trường trong .env
```
### 5. Khởi động ứng dụng
```bash
# Terminal 1 - Backend
cd chatbot_api
uvicorn src.main:app --reload --port 8000
# Terminal 2 - Frontend
cd chatbot_frontend
streamlit run src/main.py
```
## 📁 Cấu trúc Project
```
chatbot-pro/
├── chatbot_api/           # Backend FastAPI
│   ├── src/
│   │   ├── main.py       # Entry point
│   │   ├── agents/       # LangChain agents
│   │   ├── models/       # Pydantic models
│   │   └── utils/        # Helper functions
│   └── requirements.txt
├── chatbot_frontend/      # Frontend Streamlit
│   ├── src/
│   │   └── main.py       # UI components
│   └── requirements.txt
├── docs/                  # Documentation
├── tests/                 # Unit tests
└── README.md
```
## 💡 Ví dụ Sử dụng
Chatbot có thể trả lời nhiều loại câu hỏi:
| Loại câu hỏi | Ví dụ |
|--------------|-------|
| 🏥 Thông tin bệnh viện | "Có những bệnh viện nào trong hệ thống?" |
| ⏰ Thời gian chờ | "Thời gian chờ hiện tại ở bệnh viện Wallace-Hamilton là bao lâu?" |
| 💰 Chi phí | "Chi phí trung bình cho các lượt khám bảo hiểm y tế là bao nhiêu?" |
| 👨⚕️ Thông tin bác sĩ | "Bác sĩ nào có thời gian điều trị trung bình ngắn nhất?" |
| 📈 Thống kê | "Tỷ lệ lượt khám có đánh giá tại mỗi bệnh viện là bao nhiêu?" |
## 🤝 Đóng góp
Mọi đóng góp đều được chào đón! Quy trình đóng góp:
1. Fork repository
2. Tạo branch mới (`git checkout -b feature/AmazingFeature`)
3. Commit thay đổi (`git commit -m 'Add some AmazingFeature'`)
4. Push lên branch (`git push origin feature/AmazingFeature`)
5. Mở Pull Request
## 📝 License
Distributed under the MIT License. See [`LICENSE`](LICENSE) ([View on GitHub](https://github.com/LeHuyHongNhat/LLM-RAG-Chatbot-with-LangChain/tree/master?tab=MIT-1-ov-file)) for more information.
## 📧 Liên hệ
Lê Huy Hồng Nhật - [@LeHuyHongNhat](https://github.com/LeHuyHongNhat)
Project Link: [https://github.com/LeHuyHongNhat/LLM-RAG-Chatbot-with-LangChain](https://github.com/LeHuyHongNhat/LLM-RAG-Chatbot-with-LangChain)
---
⭐️ Nếu dự án này hữu ích, hãy cho nó một ngôi sao trên GitHub! ⭐️