Guided Exercises
OpenCouch includes 12 structured exercises spanning 6 therapeutic subtypes. Each exercise is a multi-turn state machine: the node owns the step transitions, the LLM generates response prose, and deterministic fallbacks keep exercises running even without an LLM.
How it works
- Dispatcher routes to
guided_exercisewhen the user explicitly asks for a structured technique - Keyword selector picks the exercise based on the user's message (e.g., "breathing" → box breathing, "stuck" → tiny action). Defaults to 5-4-3-2-1 grounding when no keyword matches
- Step-state classifier (regex, not LLM) evaluates each user response as
complete/hold/stuck/exit - Node advances or holds based on the classifier — the LLM never decides state transitions
- Exercise clears on natural completion or user-initiated exit
Completion modes
Steps use one of two modes for detecting completion:
| Mode | How it works | Used for |
|---|---|---|
| Item count | Counts listed items (commas, "and"). Advances when count ≥ min_count_for_completion | Sensory listing, naming thoughts, identifying actions |
| User confirmation | Matches bare confirmations ("ok", "done", "yes", "I did it") | Breathing actions, visualization, body exercises |
Priority ordering
The classifier checks patterns in this order — safety first:
- EXIT — "stop", "quit", "can we just talk" → exit immediately
- STUCK — "I can't", "this is stupid" → offer a simpler version
- COMPLETE — item count or confirmation met → advance or finish
- HOLD — everything else → encourage, don't advance
Exercise catalog
Click any exercise to see its steps and trigger keywords. Use the filter tabs to browse by subtype. To see exercises in context as multi-turn conversations, see Scenarios.
5-4-3-2-1 Grounding
Sensory anchoring exercise. The user identifies items across five senses to return to the present moment. Steps are independent — order matters less than engagement.
Box Breathing
Structured 4-phase breathing cycle targeting somatic regulation. Each step is a single breathing action confirmed by the user. Complements 5-4-3-2-1 (sensory) with a respiratory channel.
STOP Technique
DBT-informed distress tolerance skill. Each letter is a discrete step. S-T steps use confirmation mode (somatic); O-P steps use item count (cognitive).
Progressive Muscle Relaxation
Body-focused relaxation: tense and release 5 muscle groups. Each step is a simple "tense, hold, release, notice." Complements breathing (respiratory) and 5-4-3-2-1 (sensory) with a muscular channel.
Simple Thought Record
Simplified 4-step CBT thought record. Sequential — each step depends on the prior. Exit is the only valid off-ramp. The user discovers the reframe rather than being told what the "correct" thought is.
Behavioral Experiment
Tests beliefs in the real world. The thought record examines evidence in the mind; this tests it in reality. Step 3→4 may span hours (the user does something IRL between turns).
Tiny Action Experiment
One small action framed as an experiment, not a commitment. Targets avoidance and low activation. The ask is intentionally tiny — "just to see what happens."
Leaves on a Stream
ACT defusion exercise. The user names a sticky thought, places it on an imagined leaf, watches it float, notices what remains, then identifies a values-aligned step. The exercise is about acting alongside the thought, not removing it.
Values Compass
ACT values clarification. Counterpart to defusion — Leaves on a Stream helps with letting go; Values Compass helps with moving toward. Together they cover the full ACT arc.
Self-Compassion Break
Kristin Neff's 3-component model. Very short by design — self-compassion exercises lose power when long. The user chooses their own kind words rather than following a script.
IMPROVE the Moment
Core DBT distress tolerance skill. Uses 4 of the 7 IMPROVE letters: Imagery, Meaning, One thing, Encouragement. For users in acute overwhelm who need help tolerating the current moment.
Gratitude Inventory
Short positive-psychology exercise for building positive affect. Best for neutral-to-low-mood states or session closers. Not appropriate during acute distress.
Define steps in guided_exercise.py, register in _EXERCISE_REGISTRY, add trigger keywords to _EXERCISE_SELECTORS, and add LLM guidance to knowledge/response_modes/guided_exercise.md. No dispatcher or graph changes needed. See Agent Graph for the full architecture.