Medical Chatbot is a conversational AI chatbot designed to provide information about medical conditions, symptoms, and treatments. It is built using Python, Streamlit for the frontend, FastAPI for the backend, and LangChain/LangGraph for the conversational logic.
- Interactive Chat Interface: A user-friendly web interface for interacting with the chatbot.
- Medical Information: Provides information on a wide range of medical topics.
- Disclaimer: Includes a disclaimer in every response to advise users to consult with a healthcare professional.
- Clear Conversation History: Allows users to clear the conversation history.
- Download Conversation: Download your chat as a text file with a timestamped filename for easy organization.
- Symptom Checker: Enter symptoms and get possible conditions.
- Feedback Submission: Submit feedback on chatbot answers.
- View Conversation History: See all previous conversations in the session.
- Python 3.7+
- An OpenAI API key
- Clone the repository:
git clone <repository_url> cd Medical Chatbot
- Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate - Install the dependencies:
pip install -r requirements.txt
- Set up your OpenAI API key:
Create a
.envfile in the root directory of the project and add your OpenAI API key as follows:OPENAI_API_KEY="your_openai_api_key"
- Start the backend server:
python main.py
- In a new terminal, start the frontend application:
streamlit run frontend.py
- **Open your web browser and navigate to
http://localhost:8501
.
├── api.py # Defines the FastAPI backend application.
├── frontend.py # Defines the Streamlit frontend application.
├── graph.py # Defines the LangGraph conversational graph.
├── main.py # The entry point for the backend server.
├── nodes.py # Contains the nodes for the LangGraph graph.
├── requirements.txt # Lists the Python dependencies for the project.
├── state.py # Defines the conversation state.
└── README.md # This file.
- fastapi
- uvicorn
- langchain
- langchain-openai
- streamlit
- requests
- langgraph
This chatbot is an AI assistant and not a real doctor. Please consult with a healthcare professional for any medical advice. The information provided by this chatbot is for informational purposes only and should not be considered as medical advice.