Why This Exists
Global mental healthcare has a fundamental access problem. Therapists are expensive, scarce, and concentrated in urban areas. Waitlists are months long. In most of the world, structured therapy is simply not available to most people who need it.
CBT (Cognitive Behavioral Therapy) is different from other therapy modalities in one critical way: it is structured, protocol-driven, and evidence-backed. That structure makes it uniquely suited for AI augmentation — the exercises, worksheets, and frameworks can be digitized and delivered consistently.
"You don't replace therapists — you extend their reach. AI handles structured CBT exercises; human therapists focus on complex cases, crisis intervention, and relationship-based work that genuinely requires a human."
The Partnership
Knight Medicare is built on a clean division of expertise between two co-founders. Neither side steps into the other's domain.
Clinical Side — Harvard PhD
Clinical protocol design. Disorder mapping across 27 conditions. Modality selection and validation. Safety thresholds and crisis detection criteria. Final say on all clinical content.
Technical Side — Abid (CTO)
Full-stack architecture. AI integration and CBT engine. Supabase data layer, authentication, session management. Safety system implementation. Infrastructure and deployment.
Technical Architecture
Next.js 15 + React 19
App Router for streaming therapy sessions. Server components for session history. React 19 concurrent features for real-time interaction without layout jank.
TypeScript Throughout
Strict mode. Clinical data structures typed at the boundary layer. The CBT engine's disorder-modality combinations are compile-time safe.
Supabase Data Layer
Session logging, user profiles, progress tracking, clinical notes. Row Level Security enforces that users can only access their own session data.
Abstraction Layers
AI provider is abstracted behind an interface. Following the Supabase India block, the data layer was also abstracted — one migration, not a rewrite.
Safety Architecture
Healthcare AI has unique safety requirements that go beyond standard software engineering. Every session has safety layers operating in parallel with the therapeutic content.
Crisis Detection
Real-time monitoring of session content for crisis indicators. Triggers immediate escalation pathway with emergency resources and human therapist contact.
Clear Boundaries
The AI is explicitly scoped to CBT exercises. It does not diagnose, prescribe, or handle crises. Scope violations are hard constraints, not soft suggestions.
Session Logging
Full audit trail of every session, mood tracking, and progress metrics. Clinical co-founder reviews flagged sessions. Data encrypted at rest and in transit.
Referral Triggers
Automatic suggestions to seek professional help when session patterns indicate severity beyond CBT scope. Human-in-the-loop, not AI-as-final-word.
Claude Code's Role
Codebase Architecture
The full Next.js + Supabase stack was architected through Claude Code sessions — data models, API routes, component structure, auth flows. Iterated rapidly without sacrificing structure.
Infrastructure Hardening
When the Supabase India block hit, the abstraction layer strategy was designed through Claude Code — decoupling business logic from the data provider to survive future disruptions.
Clinical Data Modeling
Translating the Harvard PhD's clinical frameworks into database schemas and TypeScript types. 27 disorders x 10 modalities requires precise data architecture to avoid therapeutic category errors.
The CTO Experience at 19
Claude Code as force multiplier: Building what would normally require a 3-4 person engineering team. The key insight is knowing which problems require judgment (architecture, clinical data modeling, safety design) versus which can be accelerated (boilerplate, migrations, test writing).
Ruthless prioritization: Healthcare AI has stakes that consumer apps don't. Safety architecture isn't a feature — it's a prerequisite. Every sprint, the question isn't "what's exciting" but "what's necessary before this can be trusted by a user in distress."
Async collaboration: The Harvard PhD is in a different timezone. Everything runs async. Crystal-clear documentation, typed interfaces at the clinical-technical boundary, and weekly syncs that are always agenda-first. The constraint makes the work cleaner.
What's Next
- Complete Yotta migration following Supabase India block
- Clinical validation study with Harvard PhD oversight — sample sessions with supervised users
- Therapist dashboard for professionals who want to assign AI-assisted CBT homework
- Expand modality coverage to DBT and ACT — two more evidence-based frameworks
- HIPAA compliance audit in preparation for US market entry
- Partnerships with mental health NGOs for subsidized access programs
Key Lesson
Healthcare AI is about scaling access to evidence-based care. 27 x 10 = 270 therapeutic paths. No single therapist delivers all of them. AI can, 24/7. The constraint isn't the technology — it's the clinical rigor required to do it safely. That's why the Harvard PhD co-founder isn't optional. Domain expertise is the moat.