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.
- 🤖 AI-Powered Appointment Scheduling
- 👤 Patient Profile Management (history, allergies, treatments)
- 🚨 Emergency Detection & Alert System
- 💬 Multi-turn Memory Conversations
- 🧠 LangGraph-Based Decision Routing
Determines the route of conversation:
- Routes to
handle_emergency()if message contains "emergency" - Otherwise, calls
call_model()for regular processing
- Retrieves patient data
- Generates GPT-based responses contextualized with history
- Delivers urgent care instructions instantly
- Updates and persists medical records securely
git clone https://github.com/co-dev0909/medical-ai-assistant
cd medical-ai-assistantMake sure you're using Python 3.8+
pip install -r requirements.txtCreate a .env file:
OPENAI_API_KEY=your-api-key-hereTo launch the chatbot:
python main.pyRoutine 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.
| 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 |
Ying Zhou 📧 zying1309@gmail.com
Contributions welcome! Fork the repo and submit a pull request 🚀
This project is licensed under the MIT License.
