An open API service indexing awesome lists of open source software.

https://github.com/aimaster-dev/medical-ai-assistant

A smart AI assistant for clinics using LangGraph, LangChain, and OpenAI GPT. It handles patient queries, schedules appointments, detects emergencies, and updates medical records through multi-turn, memory-aware conversations.
https://github.com/aimaster-dev/medical-ai-assistant

ai-assistant appointment chatbot decision-router emergency gpt healthcare healthcare-automation langchain langgraph llm medical-ai memory multi-turn openai patient-record python smart-clinic-software triage-bot virtual-assistant

Last synced: 29 days ago
JSON representation

A smart AI assistant for clinics using LangGraph, LangChain, and OpenAI GPT. It handles patient queries, schedules appointments, detects emergencies, and updates medical records through multi-turn, memory-aware conversations.

Awesome Lists containing this project

README

          

# šŸ„ Good Health AI Assistant – Smart Medical Chatbot with LangGraph & GPT

An intelligent, memory-aware conversational assistant for **Good Health Clinic**, built with **LangGraph**, **LangChain**, and **OpenAI GPT**. This system routes patient queries, detects emergencies, manages appointments, and updates medical records — all through natural multi-turn conversations.

Flow Diagram

---

## ✨ Key Features

* šŸ¤– **AI-Powered Appointment Scheduling**
* šŸ‘¤ **Patient Profile Management** (history, allergies, treatments)
* 🚨 **Emergency Detection & Alert System**
* šŸ’¬ **Multi-turn Memory Conversations**
* 🧠 **LangGraph-Based Decision Routing**

---

## 🧩 How It Works

### šŸ”¹ `check_condition()`

Determines the route of conversation:

* Routes to `handle_emergency()` if message contains **"emergency"**
* Otherwise, calls `call_model()` for regular processing

### šŸ”¹ `call_model()`

* Retrieves patient data
* Generates GPT-based responses contextualized with history

### šŸ”¹ `handle_emergency()`

* Delivers urgent care instructions instantly

### šŸ”¹ `write_memory()`

* Updates and persists medical records securely

---

## āš™ļø Setup & Installation

### 1ļøāƒ£ Clone the Repo

```bash
git clone https://github.com/aimaster-dev/medical-ai-assistant
cd medical-ai-assistant
```

### 2ļøāƒ£ Install Dependencies

Make sure you're using Python 3.8+

```bash
pip install -r requirements.txt
```

### 3ļøāƒ£ Configure Environment Variables

Create a `.env` file:

```env
OPENAI_API_KEY=your-api-key-here
```

---

## šŸš€ Running the Assistant

To launch the chatbot:

```bash
python main.py
```

### šŸ’” Example Interaction

Routine Check-up:

```
User: I need to book a follow-up appointment.
Assistant: Hello Taher! I can help you schedule a check-up. When are you available?
```

Emergency:

```
User: This is an emergency! I’m having severe chest pain.
Assistant: We've detected an emergency. Please call emergency services or our 24/7 urgent line: +43 00 00 00.
```

---

## 🧠 Tech Stack

| Tool | Purpose |
| ----------------- | ------------------------------------ |
| **LangGraph** | Graph-based conversational routing |
| **LangChain** | LLM + Memory integration |
| **OpenAI GPT** | Natural language response generation |
| **Python** | Backend implementation |
| **InMemoryStore** | Persistent session-based memory |

---

## šŸ‘Øā€šŸ’» Maintainer

**Ying Zhou**
šŸ“§ [zying1309@gmail.com](mailto:zying1309@gmail.com)

> Contributions welcome! Fork the repo and submit a pull request šŸš€

---

## šŸ“ License

This project is licensed under the **MIT License**.