Skip to content

devangdev/Comorbid_Copilot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Comorbid Copilot 🩺

An AI-powered clinical decision support tool designed to help medical practitioners quickly identify and analyze potential drug-drug and drug-disease interactions. Leveraging a Retrieval-Augmented Generation (RAG) system, this application queries a knowledge base built from official FDA drug label data to provide evidence-based insights.

✨ Features

  • AI-Powered Analysis: Uses a RAG system to provide answers based on FDA data.
  • Dual Interaction Modes: Offers both a simple "Prompt Mode" and a guided "AI Mode" for structured queries.
  • User Authentication: Secure login and signup for personalized history.
  • Persistent History: Saves and loads user query history from local storage.
  • PDF Document Upload: Extracts text from uploaded medical documents for analysis.

🛠️ Tech Stack

  • Frontend: React.js, Vite
  • Backend: Python, Flask
  • AI / ML: LangChain, FAISS, Sentence Transformers, Replicate
  • Database: FAISS Vector Store, SQLite (optional)

🚀 Getting Started

Follow these instructions to set up and run the project on your local machine.

Prerequisites

Make sure you have the following installed on your system:

Installation

  1. Clone the repository:

    git clone [https://github.com/YourUsername/Comorbid-App.git](https://github.com/YourUsername/Comorbid-App.git)
    cd Comorbid-App
  2. Backend Setup:

    # Navigate to the backend directory
    cd backend
    
    # Create and activate a virtual environment
    python -m venv venv
    source venv/bin/activate  # On macOS/Linux
    # venv\Scripts\activate    # On Windows
    
    # Install Python dependencies
    pip install -r requirements.txt
  3. Frontend Setup:

    # Navigate to the frontend directory from the root
    cd frontend
    
    # Install Node.js dependencies
    npm install

⚙️ Environment Variables

The backend requires an .env file to store API keys and other configuration.

  1. In the /backend directory, create a file named .env.

  2. Add the necessary variables. It should look something like this:

    # Example .env file
    REPLICATE_API_TOKEN="your_replicate_api_token_here"
    

🏃 Usage

You need to run the backend and frontend servers in two separate terminals.

  1. Build the Vector Database (One-time setup): Before the first run, you must create the FAISS index from your source data.

    # From the /backend directory, with venv active
    python create_database.py
  2. Start the Backend Server:

    # From the /backend directory, with venv active
    python app.py

    The backend will now be running on http://127.0.0.1:5000.

  3. Start the Frontend Server:

    # From the /frontend directory
    npm run dev

    Open your browser and navigate to the URL provided (usually http://localhost:5173).

📜 License

This project is licensed under the MIT License - see the LICENSE file for details.

📬 Contact

Devang - GitHub Profile

About

An AI assistant that helps medical practitioners analyze drug interactions using a RAG system and FDA data. A clinical support tool for safer prescribing in complex patient cases. For detailed instructions on how to set up and run the project, please see the sections below.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors