Skip to content

MayanzaGo/Realtime-AI-Healthcare-Assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Real-Time AI-Powered Symptom Checker and Specialist Recommender

Project introduction

The Real-Time AI-Powered Symptom Checker and Specialist Recommender is an intelligent system designed to bridge the gap between vague symptom reporting and professional medical guidance. It leverages Large Language Models (LLMs), specifically Google's Gemini API, to interpret natural language health descriptions and provide reliable, intelligent suggestions in real-time.

Key objectives

  • Interpret natural language health descriptions to understand reported symptoms accurately.
  • Provide intelligent and reliable explanations for reported symptoms and likely medical conditions.
  • Recommend the type of medical specialist best suited for the patient's specific concerns.
  • Automate and enhance the initial medical evaluation process, offering real-time guidance.

Tech Stack

  • Python: Core logic for data processing, API interaction, and application orchestration.
  • PyCharm: Development environment for structuring and testing the application.
  • Streamlit: Framework for building the interactive and user-friendly web application interface.
  • Google Gemini API: Utilized for advanced Natural Language Processing (NLP) tasks, including semantic interpretation, symptom analysis, condition identification, and specialist recommendation generation.
  • python-dotenv: For secure management and loading of environment variables (e.g., API keys).

Core features

  • Symptom Interpretation: Analyzes and deciphers detailed symptom descriptions provided by the user.
  • Symptom Summarization: Generates concise summaries of the user's overall health concern for quick understanding.
  • Key Symptom Identification: Extracts and highlights the most indicative symptoms that point towards underlying medical conditions.
  • Likely Medical Conditions: Identifies potential medical conditions based on the interpreted symptoms, often with a likelihood assessment.
  • Specialist Recommendation: Provides recommendations for appropriate medical specialists, complete with a brief rationale for each referral.
  • Real-Time Processing: Delivers immediate AI-generated feedback and recommendations, enhancing user experience.
  • Robust Error Handling: Incorporates sophisticated error management for API calls and content safety, ensuring a stable and informative user experience.

Why Gemini?

Gemini's API offers state-of-the-art language understanding and generation capabilities, enabling deeper insights beyond simple keyword matching. Its ability to process complex natural language, infer context, and generate human-like medical interpretations and recommendations makes it an ideal choice for a modern, real-time AI-powered symptom checker, offering contextual relevance and nuanced understanding of health concerns.

Architecture

  • User Interface Layer (Streamlit): app.py handles user input and displays AI-generated responses.
  • API Interaction Layer: utils.py manages API key loading and facilitates robust communication with the Gemini API, including error management.
  • Prompt Management Layer: prompts.py defines a collection of carefully crafted prompts, each tailored to instruct the LLM for a specific medical query type, ensuring consistent and targeted responses.
  • LLM Core: The Google Gemini API serves as the intelligent backend, processing natural language queries, interpreting symptoms, identifying potential conditions, and recommending specialists based on the provided prompts.

Prompting strategy

  • The system employs a role-playing prompting strategy, assigning distinct medical personas (e.g., "Medical Triage Nurse," "Professional Medical Diagnostician," "Medical Referral Specialist") to the Gemini model for each specific task.
  • Each prompt is highly structured, specifying the AI's role, job objectives, focus areas (e.g., primary complaints, associated symptoms), and a rigid output format to ensure consistent and parseable responses.
  • This multi-faceted prompting allows for a granular and detailed analysis of symptoms, leading to distinct and actionable insights.

Setup and Run Instructions

To get this project up and running on your local machine, follow these steps:

Prerequisites

  • Python: Ensure you have Python 3.8 or higher installed. You can download it from python.org.
  • pip: Python's package installer, usually comes with Python.

Project set up

  1. Clone the repository (if hosted on Git) or download the project files to your local machine.

    git clone <your_repository_url>
    cd <your_project_folder>

Virtual Environment (Recommended)

It is highly recommended to create a virtual environment to manage project dependencies.

  1. Create a virtual environment:
    python -m venv venv
  2. Activate the virtual environment:
    • On Windows:
      .\venv\Scripts\activate
    • On macOS/Linux:
      source venv/bin/activate

Dependency Installation

Install all the required Python libraries using the requirements.txt file.

pip install -r requirements.txt

About

Real-time AI-powered symptom checker and specialist recommender using Google Gemini API and Streamlit

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages