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

https://github.com/taherfattahi/langgraph-medical-ai-assistant

Conversational AI assistant for Good Health Clinic
https://github.com/taherfattahi/langgraph-medical-ai-assistant

agent gpt graph langchain langgraph openai

Last synced: 7 months ago
JSON representation

Conversational AI assistant for Good Health Clinic

Awesome Lists containing this project

README

          

# Conversational AI assistant for Good Health Clinic

Using LangGraph, LangChain, and OpenAIโ€™s GPT models, the system processes patient queries, updates their medical records, and provides intelligent responses based on their history.

## Features
- AI-powered Appointment Scheduling
- Patient Profile Management (tracks medical history, allergies, past treatments)
- Emergency Detection & Alert System
- Multi-turn Conversations with Memory
- Graph-based Conversational Flow with Decision Routing

## Code Overview
๐Ÿ”น ```check_condition()```

Routes the conversation:

- If the message contains ```"emergency"```, routes to ```handle_emergency()```
- Otherwise, routes to ```call_model()```

๐Ÿ”น ```call_model()```
Retrieves patient history and generates AI responses using OpenAI's GPT model.

๐Ÿ”น ```handle_emergency()```
Provides immediate emergency instructions.

๐Ÿ”น ```write_memory()```
Updates and stores patient medical records.

## Installation
1) Clone the Repository
```bash
git clone https://github.com/taherfattahi/langgraph-medical-ai-assistant
cd langgraph-medical-ai-assistant
```
2) Install Dependencies
Ensure you have Python 3.8+ and install the required dependencies:

```bash
pip install -r requirements.txt
```
3) Set Up Environment Variables
Create a .env file with your OpenAI API key:

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

## Usage
Run the chatbot assistant:

```bash
python main.py
```

Example Conversation:
```plaintext
Hello Taher! Thank you for reaching out. I can help you schedule an appointment for your routine check-up. May I know your availability for the appointment?
```
For emergencies:

```plaintext
User: This is an emergency! I'm experiencing severe chest pain.
Assistant: Weโ€™ve detected an emergency. Please contact emergency services immediately or call our 24/7 urgent line: +43 00 00 00.
```

## Technologies Used
- LangGraph - Graph-based conversation routing
- LangChain - Memory and LLM integration
- OpenAI GPT - AI-powered responses
- Python - Core language
- InMemoryStore - Persistent patient data storage

## Contributors
๐Ÿ‘จโ€๐Ÿ’ป Taher Fattahi
๐Ÿ“ง Contact: taherfattahi11@gmail.com

Contributions are welcome! Feel free to fork the repo and submit pull requests. ๐Ÿš€

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