{"id":21513839,"url":"https://github.com/bevinaa/medical-chatbot-application","last_synced_at":"2025-03-17T15:45:01.075Z","repository":{"id":261385133,"uuid":"884154081","full_name":"Bevinaa/Medical-Chatbot-Application","owner":"Bevinaa","description":"An End-to-End Medical Chatbot powered by generative AI, designed to provide accurate responses to medical queries. Built using Flask, Cohere’s Language Model, and Pinecone for Vector Storage.","archived":false,"fork":false,"pushed_at":"2024-11-06T09:20:01.000Z","size":11213,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-24T02:15:29.954Z","etag":null,"topics":["artificial-intelligence","cohere-ai","html-css-javascript","jupyter-notebook","llm-training","machine-learning","pinecone-db","python"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Bevinaa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-06T08:43:46.000Z","updated_at":"2024-11-06T09:22:11.000Z","dependencies_parsed_at":"2024-11-06T09:45:42.314Z","dependency_job_id":null,"html_url":"https://github.com/Bevinaa/Medical-Chatbot-Application","commit_stats":null,"previous_names":["bevinaa/medical-chatbot-application"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bevinaa%2FMedical-Chatbot-Application","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bevinaa%2FMedical-Chatbot-Application/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bevinaa%2FMedical-Chatbot-Application/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bevinaa%2FMedical-Chatbot-Application/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bevinaa","download_url":"https://codeload.github.com/Bevinaa/Medical-Chatbot-Application/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244060378,"owners_count":20391528,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["artificial-intelligence","cohere-ai","html-css-javascript","jupyter-notebook","llm-training","machine-learning","pinecone-db","python"],"created_at":"2024-11-23T23:18:26.874Z","updated_at":"2025-03-17T15:45:01.050Z","avatar_url":"https://github.com/Bevinaa.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **End-to-End Medical Chatbot Application**\n\n## **Overview**\n\nThis repository contains an **End-to-End Medical Chatbot** powered by **Generative AI**, designed to provide accurate and contextually relevant responses to medical queries. Built using **Flask**, **Cohere’s Language Model**, and **Pinecone** for vector storage, this chatbot can answer a wide range of health-related questions and offer context-aware follow-ups. The chatbot remembers previous queries to offer more personalized responses.\n\n---\n\n## **Key Features**\n\n- **Generative AI-Powered Responses**: Uses **Cohere’s Language Model** to generate medical answers.\n- **Context-Aware Conversations**: The chatbot can maintain the context of the conversation, enabling more accurate follow-up answers.\n- **Efficient Document Retrieval**: Integrated with **Pinecone**, a vector database, for fast and scalable document search.\n- **Flask Web Application**: A user-friendly web interface powered by Flask for seamless interaction.\n- **Easy Setup**: Simple installation steps and easy API key configuration for deployment.\n\n---\n\n## **Technologies Used**\n\n- **Flask**: Web framework for building the backend.\n- **Cohere**: Language model for generating answers.\n- **Pinecone**: Vector database for document retrieval and storage.\n- **HTML/CSS/Bootstrap**: Frontend for the chat interface.\n- **Python**: Programming language for implementing AI logic and web server.\n\n---\n\n## **Pre-requisites**\n\nTo get started with the project, you’ll need the following:\n\n- **Python 3.7+** (preferably in a virtual environment)\n- **Cohere API Key**: For generating AI responses.\n- **Pinecone API Key**: For vector search and document retrieval.\n- **Flask**: To run the web application.\n\n---\n\n## **Setting Up the Project**\n\nFollow the steps below to set up and run the chatbot on your local machine:\n\n### 1. Clone the Repository\n\nStart by cloning this repository to your local machine:\n\n```bash\ngit clone (https://github.com/Bevinaa/Medical-Chatbot-Application)\ncd End-to-end-Medical-Chatbot-Generative-AI\n```\n\n### 2. Set Up a Virtual Environment (Recommended)\n\nYou can set up a virtual environment to isolate dependencies for this project:\n\"venv\" is used here as environment name\n\n```bash\npython -m venv venv\n```\n\nActivate the virtual environment:\n\n- **Windows**:\n  ```bash\n  venv\\Scripts\\activate\n  ```\n- **Mac/Linux**:\n  ```bash\n  source venv/bin/activate\n  ```\n\n### 3. Install Dependencies\n\nInstall the required dependencies using `pip`:\n\n```bash\npip install -r requirements.txt\n```\n\n### 4. Create API Keys\n\nYou will need two API keys: **Cohere API Key** for the language model and **Pinecone API Key** for vector storage. Here's how to get them:\n\n#### Cohere API Key:\n1. Go to [Cohere API](https://cohere.ai/) and create an account if you haven’t already.\n2. Once logged in, navigate to the **API Keys** section and generate a new API key.\n3. Copy the API key for use in the project.\n\n#### Pinecone API Key:\n1. Visit [Pinecone](https://www.pinecone.io/) and create an account.\n2. After logging in, navigate to **API Keys** from your dashboard.\n3. Generate an API key and copy it.\n\n### 5. Configure API Keys\n\nCreate a `.env` file in the root directory of the project and add the following lines, replacing the placeholders with your actual API keys:\n\n```env\nCOHERE_API_KEY = your_cohere_api_key\nPINECONE_API_KEY = your_pinecone_api_key\n```\n\n### 6. Running the Flask Application\n\nOnce you've set up the environment and configured the API keys, you can run the Flask app with the following command:\n\n```bash\npython app.py\n```\n\nThe chatbot should now be running at `http://127.0.0.1:5000/`. Open this URL in your browser to interact with the chatbot.\n\n---\n\n## **How to Use the Chatbot**\n\n1. Visit the main page (`/`).\n2. You’ll see a user interface where you can type your health-related question.\n3. After submitting your question, the chatbot will generate a response based on the medical documents it retrieves from Pinecone.\n\nYou can ask follow-up questions, and the chatbot will maintain the context of your conversation to provide more relevant answers.\n\n---\n\n## **Project Structure**\n\n- **app.py**: Main Python script that runs the Flask application.\n- **chat.html**: HTML template for the chatbot user interface.\n- **requirements.txt**: List of Python dependencies for the project.\n- **src/**: Contains helper functions and code for document embedding and retrieval.\n- **.env**: Configuration file to store sensitive API keys.\n  \n---\n\n## **Contributing**\n\nIf you would like to contribute to this project, feel free to fork the repository, make changes, and submit a pull request. \n\nMake sure to follow the standard guidelines for Python projects and ensure that all dependencies are correctly listed in the `requirements.txt` file.\n\n---\n\n## **Contact**\n\nFor any questions, issues, or support, feel free to reach out:\n\nAuthor: **Bevina**  \nEmail: [bevina2110@gmail.com](mailto:bevina2110@gmail.com)\n\n---\n\n## **Output**\n\nBelow are some screenshots showing the chatbot interface and how it responds to user queries.\n\n### 1. Chat Interface\n\nThis is the main chat interface where users can ask health-related questions.\n\n![image](https://github.com/user-attachments/assets/13f62819-9227-447e-be54-632d5f5d13b5)\n\n### 2. Context-Aware Follow-up\n\nAn example showing the chatbot’s ability to maintain conversation context across multiple questions.\n\n![image](https://github.com/user-attachments/assets/c0e8f040-278f-482b-88b0-6e2c353a13e1)\n\n\n### 3. Sample Response\n\nAn example of a response generated by the chatbot based on a user query.\n\n![image](https://github.com/user-attachments/assets/83cdf79c-527a-41f9-9fdc-c72b4252ced7)\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbevinaa%2Fmedical-chatbot-application","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbevinaa%2Fmedical-chatbot-application","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbevinaa%2Fmedical-chatbot-application/lists"}