Clinician-Authored Treatment Protocol Workspace
Translation pending
HealthTypeScript · PLpgSQLGitHub @hyeranhwang01OnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
No updates detected yet. GitHub releases will appear here.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
TBCT V2
Translation pending
Taken from the repository README
Loading the full README.
Read the full README ↗An LLM-based platform for delivering Trial-Based Cognitive Therapy (TBCT) in a multicenter randomized controlled trial. Participants go through the eight TBCT sessions in a chat interface with an AI counselor, and clinicians follow their progress, review safety events and manage the trial from a separate dashboard.
Demo: https://tbct-v2.vercel.app
Note on the protocol content. TBCT and its session materials were developed by Irismar Reis de Oliveira. The manuals and session prompts are not included in this repository.
src/shared/protocol/*.generated.tsare empty stubs, so the code type-checks but the sessions have no therapy content until the generated files are rebuilt from a licensed copy.
In a clinical trial the intervention has to be delivered the same way to every participant, and it has to follow the manual. A free-form LLM conversation is the opposite of that. Most of this codebase exists to keep the model inside the protocol while still letting it talk naturally.
The approach we took is to separate what happens next from how it is said. Each session is defined as a graph of steps, and a deterministic runtime decides which step comes next, what information has to be collected from the participant, and when a step is finished. The LLM only writes the wording of each turn and helps interpret free-text answers. Its output is checked before it reaches the participant, and if it fails validation the runtime falls back to a fixed message instead of letting the conversation drift.
flowchart LR
P[Participant app] --> R[Session runtime]
C[Clinician dashboard] --> DB[(Supabase / Postgres)]
R -->|next step, required fields| A[Dialogue agent]
A -->|wording, interpretation| V[Output validator]
V --> R
R --> S[Safety orchestrator]
R --> M[Participant memory]
R --> DB
M --> DB
S --> DB
Participant side. The eight sessions (src/patient/sessions/s01 to s08), worksheets that fill in as the conversation goes, homework, mood check-ins, standardized questionnaires (DASS-21 as the primary outcome, plus PHQ-9 and GAD-7), appointments, messages from the clinician, and the ability to export or request deletion of one's own data. The UI is available in Korean and English.
Clinician side. A protocol studio for editing and validating session definitions, participant monitoring with per-session reports, a safety dashboard for flagged events, escalations and follow-ups, and trial management (randomization, visits, assessments, adverse event reporting and data lock).
Runtime (src/shared/runtime). The state machine and orchestrator, prompt compilation, input assessment, output validation, fallback and repair, language-switch detection, and a separate safety orchestrator that can interrupt a session at any point.
Memory (src/shared/memory). Participants can consent to having earlier sessions remembered. Remembered chunks keep a record of where they came from and when they stop being valid, and every retrieval is logged.
Data and access control (sql/). 44 migrations. Every table that holds participant or trial data is behind row-level security, and consent changes and data access are logged as events.
We ran all eight sessions end to end against scripted patients. With the deterministic provider, all eight completed and passed with no fallbacks or repairs. We then ran the same sessions with a live model, and also ran simulated patients that deliberately try to derail the session partway through to see whether the runtime brings the conversation back. Results are in artifacts/session-fidelity and artifacts/realistic-patient-sessions.
For Session 8 we also ported the protocol to an explicit LangGraph graph (langgraph/) to see how many clinical rules could actually be verified from the recorded turns. Across 47 checks on 45 rules, 21 were traced, 4 are guaranteed by the structure of the graph itself, 1 could not be checked against the reference implementation, and 21 could not be traced from the current records. That last group is mostly about counting and ranges (for example, too many pieces of evidence or ratings outside 0 to 100), which tells us what the runtime should be logging next. The full table is in artifacts/langgraph-verify/report.md.
The test suite has 117 test files (Vitest). Some tests assert on the protocol text itself and will fail without the licensed content.
npm install
npm run type-check
npm test
npm run dev
You will need a Supabase project with the migrations in sql/ applied, and at least NEXT_PUBLIC_SUPABASE_URL, NEXT_PUBLIC_SUPABASE_ANON_KEY, AI_PROVIDER and ANTHROPIC_API_KEY set.
Next.js and TypeScript, Supabase (Postgres, auth, realtime), Vercel, Sentry, Vitest, LangGraph for the verification port, Claude (Anthropic API) as the main dialogue model.
Hyeran Hwang, Ari Kim, Donghoo Kim, Hyunjung Nam. Developed between July and October 2026 at Sungkyunkwan University, in collaboration with Irismar Reis de Oliveira.