Skip to content
Back to Projects

Hospital Center AI

9 AI specialists triaging emergency patients

LangGraph PostgreSQL WebSocket FastAPI D3.js

Architecture

Patient -> Triage -> [8 Specialists in Parallel] -> Consensus -> Selected Specialist -> Conversational Chat

Overview

A patient describes symptoms. The triage agent analyzes urgency and routes to 8 medical specialists evaluating simultaneously. A consensus agent selects the best match, then the patient enters a conversational chat with that specialist -- all backed by persistent PostgreSQL memory and LangGraph checkpointing.

Specialists: General Medicine, Cardiology, Neurology, Pediatrics, Dermatology, Traumatology, Psychiatry, Oncology.

48 source files, ~6300 LOC. Strict mypy, parametrized SQL (zero injection surface), retry with exponential backoff, structured logging, JWT + HMAC cookie auth, HIPAA/GDPR consent flow, non-root Docker containers, 70%+ test coverage enforced.

Tech Stack

Layer Technology
Orchestration LangGraph 1.0 (parallel state machine)
LLM Groq API (Llama 4 Scout / OpenAI-compatible)
Backend FastAPI + Uvicorn (async, 4 workers)
Database PostgreSQL 15 (conversations + checkpoints)
Real-time WebSocket (Socket.IO)
Auth JWT + HMAC session cookies
Frontend Jinja2 + D3.js graph visualization
Deploy Docker Compose (multi-stage, non-root)

Demo Video