Skip to content

taherfattahi/langgraph-medical-ai-assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
git clone https://github.com/taherfattahi/langgraph-medical-ai-assistant
cd langgraph-medical-ai-assistant
  1. Install Dependencies Ensure you have Python 3.8+ and install the required dependencies:
pip install -r requirements.txt
  1. Set Up Environment Variables Create a .env file with your OpenAI API key:
OPENAI_API_KEY=your-api-key-here

Usage

Run the chatbot assistant:

python main.py

Example Conversation:

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:

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.

About

Conversational AI assistant for Good Health Clinic

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages