A sophisticated AI-driven medical chatbot designed for accurate and efficient information retrieval. This system integrates advanced natural language processing (NLP) models with vector databases to provide precise responses based on medical literature. The chatbot supports large language models like Llama 3.1 from Meta, offering scalable solutions for diverse healthcare applications.
.
├── app.py # Main application entry point
├── data/ # Data files for knowledge base
│ └── Gale Encyclopedia of Medicine. Vol. 2. 2nd ed.pdf
├── LICENSE # Project license
├── Medical_Chatbot.egg-info/ # Package metadata
│ ├── dependency_links.txt
│ ├── PKG-INFO
│ ├── SOURCES.txt
│ └── top_level.txt
├── notebooks/ # Jupyter notebooks for testing and experiments
│ ├── CRUD_pinecone.ipynb
│ ├── RAG_without_systemprompt.ipynb
│ └── RAG_with_systemprompt.ipynb
├── README.md # Project documentation
├── requirements.txt # List of dependencies
├── setup.py # Python package setup
├── src/ # Core source code
│ ├── helper.py
│ ├── __init__.py
│ ├── prompt.py
│ └── __pycache__/
├── static/ # Static files (CSS, assets)
│ └── style.css
├── store_to_vectordb.py # Script for storing data into the vector database
└── templates/ # HTML templates for the web interface
└── chat.html
Before setting up the project, ensure the following tools are installed:
- Python 3.10
- Conda or
venvfor virtual environments - Ollama for managing Llama models
git clone https://github.com/devrahulbanjara/Medical-Chatbot.git
cd Medical-ChatbotCreate a .env file in the root directory and add your Pinecone API key:
PINECONE_API_KEY="your-pinecone-api-key"
conda create -n chatbot python==3.10 -y
conda activate chatbotpython3 -m venv chatbot
source chatbot/bin/activate # Linux/macOS
chatbot\Scripts\activate # Windowspip install -r requirements.txtcurl -fsSL https://ollama.com/install.sh | shDownload the installer from the Ollama official repository.
Download the model suitable for your needs:
ollama pull llama3.1 # Default 8B modelTo pull a larger model:
ollama pull llama3.1:70b # 70B parameter modelFor additional versions, refer to the Ollama model library.
Place any additional data files (in PDF format) inside the data/ directory.
Run the following script to ingest your data into the vector database:
python store_to_vectordb.pyTo start the chatbot application:
python app.pyContributions are welcome. If you would like to contribute:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them.
- Submit a pull request (PR) for review.
We appreciate community contributions and will review pull requests promptly.
This project is licensed under the MIT License.
- Meta AI for the Llama 3.1 model
- Pinecone for vector database services
- Ollama for seamless model integration
For more information, please refer to the official documentation or contact the project maintainers.
