An AI-powered medical chatbot utilizing Retrieval-Augmented Generation (RAG) to provide accurate and context-aware responses to medical queries. This chatbot enhances traditional medical Q&A by integrating retrieved knowledge from medical literature with a language model.
Ensure you have the following installed:
git clone https://github.com/your-repo/medical-chatbot.git cd medical-chatbot
pip install -r requirements.txt
uvicorn app:app --host 0.0.0.0 --port 8000
streamlit run medibot.py
from langchain.chains import RetrievalQA from langchain.llms import HuggingFaceHub from langchain.vectorstores import FAISS retriever = FAISS.load_local('medical_docs_index').as_retriever() rag_chain = RetrievalQA.from_chain_type(llm=HuggingFaceHub(model='mistralai/Mistral-7B-Instruct-v0.3'), retriever=retriever) query = "What are the symptoms of diabetes?" response = rag_chain.run(query) print(response)