Clinical Therapy Chatbot
A production-style therapy chatbot at New York Brain & Spine Surgery, blending rule-based clinical workflows with LLM-generated responses across multiple mental-health conditions.
A configurable multi-agent backend for a clinical setting. The constraint is the interesting part: in healthcare, an LLM’s conversational flexibility is an asset only if the surrounding system makes it safe. Pure prompt engineering does not get you there. Pure rule-based workflows get you something that doesn’t feel like talking to a person.
The system I built combines:
- Rule-based clinical workflows for the moments where determinism matters — intake, screening, escalation, safety keywords. These never call an LLM.
- LLM-generated responses for the connective tissue — reflection, paraphrase, gentle prompting — behind a structured prompt template that constrains tone and topic.
- A multi-agent layer that switches between condition-specific personas (each with its own clinical workflow set) based on session state.
Implementation was FastAPI on the API side, LLaMA for generation, and a small state machine on top managing session memory and escalation paths. The system was built so that the clinical team could iterate on prompts and workflows without touching the backend.
What I owned
- Backend API + application infrastructure (FastAPI + state management).
- The multi-agent dispatcher and condition-specific persona configs.
- Real-time conversational flow + safe state management between turns.
- Rapid prompt-iteration tooling for the clinical team.
Engagement ran May 2025 through March 2026.
Specifics are limited here for obvious clinical-confidentiality reasons. Happy to discuss in conversation.