The goal of this project was to develop a general health query chatbot as part of the Developer’s Hub internship. The chatbot leverages a Large Language Model (LLM) to answer general health-related questions while implementing prompt engineering for clear, friendly responses and safety filters to prevent harmful medical advice.
- Medical PDF documents stored locally in the
data/directory. - These PDFs were used to build a knowledge base, which the chatbot references via a Retrieval-Augmented Generation (RAG) pipeline.
- Text from PDFs is split into manageable chunks and embedded using HuggingFace sentence embeddings (
all-MiniLM-L6-v2) for efficient retrieval with FAISS.
- Language Model: Groq LLM (
openai/gpt-oss-120b) for answering queries. - Embeddings Model:
sentence-transformers/all-MiniLM-L6-v2from HuggingFace. - Vector Store: FAISS for storing and retrieving chunk embeddings.
- Pipeline: LangChain for building the RAG-based conversational agent.
- The chatbot is able to answer general health questions such as:
- “What are the common symptoms of diabetes?”
- “Is paracetamol safe for children?”
- Safety filters successfully detect emergencies (e.g., heart attack, stroke) and risky medication queries, providing appropriate guidance instead of direct medical advice.
- Integration of PDF knowledge base with the LLM enables context-aware responses supported by sources.
- Built using Streamlit, the chatbot offers an interactive UI with quick-question buttons and real-time chat.
- Clone the repository:
git clone https://github.com/SyedaAttiraHashmi/AI-ML-Internship-Task1-Health-Query-Chatbot.git
Install dependencies: pip install -r requirements.txt • Set your GROQ_API_KEY in a .env file. • Run the Streamlit app: streamlit run app.py