MedWeight
AI-Powered Patient Engagement & Clinical Coaching Platform
Current as of March 2026
Executive Summary
1. What the Application Is Designed to Do
MedWeight is a clinical-grade, AI-powered patient engagement platform built for the Obesity Medicine and Diabetes Institute. It operates through two complementary interfaces: an SMS-based chatbot accessible to patients via text message 24/7, and a PHP-based administrative portal that gives clinicians and staff real-time visibility into patient conversations, clinical flags, screening signals, coaching status, and population-level analytics.
The platform is designed to address a fundamental gap in chronic disease management: the 99% of a patient's journey that happens between clinic visits. For patients managing obesity, diabetes, metabolic syndrome, mental health comorbidities, and the complex behavioral challenges associated with these conditions, MedWeight provides continuous, intelligent support that operates at a level of clinical sophistication no single human provider could deliver at scale.
The system's scope extends well beyond medication management. It encompasses a comprehensive educational curriculum, structured coaching programs with dedicated AI coach personas, validated clinical screening instruments, and a governance infrastructure designed for clinical accountability. The core design objectives are:
Patient Education
Automated patient education and engagement through a comprehensive video-based academy spanning seven clinical domains
Structured Coaching
Structured, opt-in coaching programs with customizable scheduling, session guardrails, and behavioral accountability mechanisms
Dual-Layer AI
Dual-layer AI interaction: a responsive general support mode and a deep, MI-consistent coaching mode that patients must explicitly elect to access
Clinical Screening
Real-time clinical screening using both AI-generated structured output and keyword-based detection across 25+ medical conditions
Progress Tracking
Completed questionnaire scoring with chronological progress tracking, enabling both patients and clinicians to visualize change over time
Clinical Governance
Full clinical governance with message integrity verification, audit trails, versioned rule management, and human-in-the-middle override capabilities
Seamless Integration
Seamless integration with the clinic's existing MySQL patient database, extending rather than duplicating records
2. How the Application Meets Its Objectives
Section 2.1
Comprehensive Patient Education: The MedWeight Academy
The educational foundation of MedWeight is the MedWeight Academy, a structured video-based curriculum imported from the clinic's learning management system. The Academy is organized into seven top-level modules, each containing multi-week courses and standalone special topics:
Weight Management Mastery
Foundational approaches to sustainable weight loss and metabolic health
Mental Health & Wellbeing
Courses on food addiction, building a healthy outlook, and special topics including depression, anxiety, sleep, emotional eating, addiction, and physical intimacy
Nutrition Mastery
Evidence-based nutritional education for metabolic patients
Skillpower Kitchen
Practical cooking courses and nutritional skills
Joy of Movement
Exercise programming including fall prevention, women's exercise, recovery, and fueling for movement
Making Health A Habit
Multi-week courses on gaining momentum, overcoming barriers to change, values, motivation, and self-sabotage
Weight, Wellness & Beyond
Broader wellness, disease management, diabetes, and bariatric topics
Each lesson is imported with its video transcript parsed from VTT subtitle files, chunked for retrieval, and indexed using MySQL FULLTEXT search. When a patient asks a question, the RAG (Retrieval-Augmented Generation) pipeline searches this content and injects relevant context into Claude's system prompt, along with breadcrumb navigation (e.g., "Mental Health & Wellbeing > Food Addiction (8 weeks) > Session 3: Spirituality and Meditation") and direct video links so the patient can watch the source material.
An automated content drip campaign, managed through n8n workflows, delivers stage-appropriate content to patients on a weekly schedule. Patients progress through a journey defined in a journey_definitions table, advancing from Week 1 through Maintenance, with content tailored to their current stage and excluding material they've already completed.
Section 2.2
Dual-Layer Interaction: Casual Support and Structured Coaching
Patient interactions operate across two distinct layers, each with its own behavioral expectations and clinical depth:
General Support Layer
Always Available
Provides responsive, SMS-friendly answers to patient questions about medications, side effects, nutrition, hydration, movement, and emotional wellbeing. The AI responds in a motivational interviewing style grounded in CBT/ACT frameworks, keeping messages concise and warm. This layer references academy content with video links but maintains brief, educational interactions. It is the default mode for all enrolled patients.
Coaching Layer
Opt-In, Scheduled
A fundamentally different experience. Patients must explicitly elect coaching by responding to a pathway invitation with a specific keyword (*GO FOR COACHING). They then provide their preferred schedule using natural language ("Mondays, Wednesdays, Fridays at 3pm"), which the system parses and converts into a recurring session calendar.
Coaching sessions are time-bounded (30 or 60 minutes), led by a specialized AI coach persona with a detailed professional bio, and use a deeper system prompt emphasizing reflective listening, change talk evocation, open-ended exploration, and homework assignment.
Section 2.2 (continued)
Coaching System: Guardrails & Coach Personas
The coaching system enforces strict behavioral guardrails:
Session Start Control
Sessions only begin when the patient sends START during a scheduled window. Conversations outside coaching hours route to the general support layer, not the coaching prompt.
SMS Reminders
SMS reminders are sent before scheduled sessions (1 hour and 5 minutes prior). After schedule confirmation, patients are asked whether they want to start their first session immediately or wait for their scheduled time.
No-Show Tracking
No-shows are tracked: if a patient fails to start a scheduled session within 10 minutes, it is recorded. Consecutive no-shows, cancellations, or reschedules trigger progressive consequences, up to and including automatic revocation of coaching privileges after a configurable threshold (default: 3 consecutive infractions).
Admin-Configurable Policy
The strike count and threshold are admin-configurable per clinic policy. Patients can cancel or reschedule individual sessions, but the system enforces accountability.
Each academy module has a dedicated coach persona with a crafted professional biography. When a patient accepts coaching, they receive their coach's bio including their expertise and credentials, framing the interaction as access to a world-class specialist. Ten coach personas are deployed, covering weight management, mental health, nutrition, cooking skills, movement, habit formation, disease management, diabetes, and bariatric surgery, plus a default general coach.
Section 2.3
Clinical Screening and Condition Detection
MedWeight performs clinical screening at two complementary layers:
AI-Powered Structured Screening
Every response generated by Claude includes a structured JSON output block identifying recommended questionnaires, detected conditions with confidence levels (high/medium/low), and rule flags (require_review, block, warn). This screening data is stored alongside every conversation and aggregated in a Screening Signals panel on the patient detail view, showing trends over a rolling window.
The system recognizes 9 validated screening instruments:
  • PHQ-9 (depression)
  • GAD-7 (anxiety)
  • STOP-BANG (sleep apnea)
  • ISI (insomnia)
  • BES (binge eating)
  • C-SSRS (suicide risk)
  • IIEF-5 (erectile dysfunction)
  • ADAM (low testosterone)
  • ADA Diabetes Risk
Section 2.3 (continued)
Keyword-Based Condition Detection
A PHP-side ClinicalFlagAnalyzer scans patient messages against a library of 25+ conditions spanning 10 clinical categories. Each condition definition includes severity classification, keyword sets that recognize both lay language and medication names, associated screening tools with scoring thresholds and links, and recommended clinical next steps.
Sleep
Sleep apnea, insomnia
Mental Health
Depression, anxiety, suicidal ideation, body image
Eating
Binge eating, emotional eating, night eating
Sexual Health
Erectile dysfunction
Endocrine
Low testosterone
Metabolic
Diabetes risk
GI
GERD
Pain
Chronic pain, osteoarthritis
Substance
Alcohol use
General
Chronic fatigue

Critical Safety Pathway: Suicidal ideation detection is treated as a critical safety pathway — any mention triggers an immediate require_review flag, C-SSRS recommendation, and crisis resource delivery (988 Suicide & Crisis Lifeline, Crisis Text Line) within the patient-facing response.
Section 2.4
Questionnaire System with Real-Time Scoring and Progress Tracking
The questionnaire system is fully operational as a closed-loop workflow. Administrators assign validated instruments (PHQ-9, GAD-7, STOP-BANG, PCL-5, AUDIT-C, Quick Wellness Check) to patients from the admin dashboard. The patient receives an SMS with a tokenized link to a mobile-responsive completion page. Questions are rendered one at a time with a progress bar. Upon completion, the system:
Critically, the system supports chronological progress tracking. When a patient completes the same questionnaire type multiple times, a progress viewer renders a line chart showing score trends over time, with smart improvement detection that accounts for whether lower or higher scores indicate improvement (e.g., lower PHQ-9 = improvement, but some instruments score in the opposite direction). The view includes first-vs-latest comparison, completion history table, and improvement percentage calculations. This gives both patients and clinicians a visual record of clinical trajectory, not just point-in-time snapshots.
Section 2.5
Clinical Governance and Administrative Oversight
The administrative portal provides nine functional areas accessible through a tabbed interface:
1
Dashboard
Aggregate statistics (total patients, flagged patients, messages today, patients by journey stage, top clinical flags) with one-click access to flagged patient review and batch analysis
2
Patient List & Detail
Searchable/filterable patient list with per-patient detail views showing conversation history, clinical flags with mention counts, screening signals, clinical overrides, clinical notes, and coaching status
3
Search
Full-text search across all patient conversations with flag-type filtering
4
Automation & Messaging
Database-driven workflow management (create, edit, toggle, run), message template library with 25+ templates across 9 categories, scheduled message queue with cancellation, and immediate quick-send capability
5
Rule Editor
Versioned condition map and clinical ruleset management with visual editing for symptom weights, condition exclusions, localization labels, and paired release activation with audit logging
6
Overrides
Human-in-the-middle governance allowing clinicians to force or block specific screening recommendations at global or per-patient scope, with priority ranking, time windows, and clinical rationale documentation
7
Governance & Audit
Message integrity verification using SHA-256 hash checks (prompt_hash, context_hash, response_hash, request_fingerprint) with per-message PASS/FAIL status and drill-down detail
8
Content Manager
Content ingestion for videos (YouTube, direct URL), PDFs, articles, and text, with chunk visualization and journey-stage assignment
9
Settings
SMS join keyword configuration and system parameters
Every significant administrative action is logged in an audit trail with admin user ID, action type, details, and IP address. The release system ensures that condition maps and clinical rulesets are versioned, clonable, and activated as paired releases, preventing configuration drift between detection logic and screening rules.
Section 3.1
Practical Value: For Patients
MedWeight provides something no traditional clinic model can: continuous, accessible, expert-level support that meets patients where they are — on their phones, in their own time, in plain language. For patients managing complex chronic conditions, this changes the fundamental dynamics of care:
GLP-1 Medication Support
Patients on GLP-1 medications face daily challenges (nausea, injection anxiety, food aversions, protein targets) that don't wait for quarterly appointments. Having an informed, empathetic resource available at any hour lowers the barrier to seeking help.
Unprecedented Coaching Access
The coaching layer offers something unprecedented: structured, recurring sessions with an AI specialist whose expertise is drawn from the clinic's own educational content. Patients who opt in receive the kind of sustained behavioral intervention that would typically require a dedicated therapist, nutritionist, or health coach.
Visible Progress Evidence
The questionnaire progress tracking gives patients visible evidence of their improvement. Seeing a PHQ-9 score drop from 15 to 8 over three months is concrete, motivating proof that their effort is working.
Expert Curriculum, Contextually Delivered
The academy content library means patients aren't just receiving generic advice — they're accessing the same expert-developed curriculum the clinic would present in person, delivered contextually when it's most relevant to their current question or concern.
Built-In Safety Nets
Patients who mention suicidal ideation, severe symptoms, or crisis situations are immediately flagged, given crisis resources, and directed to contact the clinic — whether it's 2pm or 2am.
Section 3.2
Practical Value: For Clinicians
The platform transforms clinical monitoring from reactive chart review to proactive, continuous surveillance:
Near Real-Time Flagging
Instead of learning about worsening depression at a follow-up visit, providers see flagged conversations with matched symptoms, confidence levels, and recommended screening instruments in near real-time.
Dual-Layer Redundancy
The dual-layer screening (AI-generated structured JSON + keyword-based detection) provides redundancy: clinical concerns are caught even if one layer misses them.
Longitudinal Trend Data
Questionnaire trend data enables clinicians to track treatment response longitudinally without additional clinical encounters.
Clinical Override System
The override system allows providers to exercise clinical judgment over the AI's screening recommendations — forcing specific questionnaires for patients who need closer monitoring, or blocking recommendations that aren't clinically appropriate for a particular individual.
Coaching Status Tracking
Shows which patients have been invited to coaching, who has accepted, who is actively engaged, and who has been revoked for non-compliance — all without manual tracking.
Population-Level Analytics
Top flags, patients by stage, activity trends surface insights that would be invisible from individual chart reviews. The message template library and scheduled messaging system allow high-touch engagement at scale.
Section 4
Extension Opportunities
The current system is a mature, working platform. The following extensions represent natural growth paths that would deepen its clinical impact and patient engagement:
4.1 Adaptive Coaching Pathways
The journey stage system currently advances on a time-based schedule. Adapting progression to actual patient behavior — engagement frequency, content completion, coaching attendance, screening scores, and self-reported outcomes — would make the experience feel personalized rather than calendar-driven. A patient struggling with side effects in Week 2 shouldn't advance to exercise goals in Week 3.
Section 4.2
Provider Takeover Mode
Currently, clinicians can send messages through the admin portal, but responses route back through the AI. A "provider takeover" mode — where a clinician can intervene directly in a flagged conversation with the AI stepping back — would address the most critical clinical moments.
This would allow seamless escalation from AI to human for situations requiring immediate clinical judgment, with the conversation thread remaining unbroken.
Section 4.3
Outcome Integration and Reporting
Integrating weight measurements, lab values (HbA1c, lipids, metabolic panels), medication adherence data, and questionnaire scores into a longitudinal patient dashboard would create a comprehensive clinical picture.
Weight Measurements
Track body weight trends over time integrated into the patient dashboard
Lab Values
HbA1c, lipids, metabolic panels integrated longitudinally
Medication Adherence
Track adherence data alongside clinical outcomes
Questionnaire Scores
Validated instrument scores aggregated into a comprehensive clinical picture
This data, aggregated across the patient population, would also enable the Institute to measure program effectiveness, demonstrate clinical outcomes to payers, and publish results.
Section 4.4
Improve Predictive Behavioral Nudge Engine
Using conversation patterns, engagement data, and screening signal trajectories to trigger proactive outreach — not just on inactivity, but on detected risk patterns.

A patient who mentions stress eating three times in a week could automatically receive a targeted resource; a patient whose PHQ-9 worsens could be flagged for an earlier follow-up before the situation escalates.
Sections 4.5 & 4.6
Multi-Channel Expansion & Insurance Documentation
4.5 Multi-Channel Expansion
The architecture already supports web sessions. Extending to a patient portal or mobile application with richer interaction — image-based meal logging for nutritional feedback, medication tracking, appointment scheduling, and coaching session video/audio — would increase engagement depth while maintaining SMS as the low-friction entry point that makes the platform universally accessible.
4.6 Insurance and Compliance Documentation
The governance and audit infrastructure positions MedWeight to generate the clinical documentation needed for insurance billing, regulatory compliance, and quality reporting. Automated session summaries, screening documentation, and outcome reports could reduce the administrative burden on providers while strengthening the evidentiary basis for reimbursement of digital health interventions.

MedWeight represents a working clinical system that has moved well beyond proof-of-concept. It is actively serving patients, generating screening data, delivering structured coaching, scoring validated instruments, and providing clinicians with the tools to monitor and intervene at a level of granularity and timeliness that was not previously achievable. The platform's architecture — built on existing clinic infrastructure, respecting existing patient records, and governed by versioned clinical rules with full audit capability — is designed for the operational realities of a clinical practice, not a technology demonstration.
25+
Conditions Detected
Across 10 clinical categories
9
Screening Instruments
Validated clinical tools
10
Coach Personas
Specialized AI coaches deployed
7
Academy Modules
Clinical education domains