OpenCouch
A mental health support agent that remembers you across sessions, checks for safety before every response, and adapts its style to how you prefer to be supported.
How a turn flows
Every message passes through the same pipeline. Safety runs first, then memory, then one of six therapeutic response modes, then extraction for future sessions.
How memory works
Three memory layers give the agent context that survives across sessions — retrieved per turn, loaded into prompts on demand.
Semantic Memory
KNOWS SarahUSES fluoxetineWORRIES_ABOUT work
Episodic Memory
Session 1: panic attacks, did groundingSession 2: work stress and sleep
Procedural Memory
Don't suggest meditationPrefer shorter responses
Retrieved per turn via hybrid search and session catch-up.
Procedural rules loaded as style directives.
Inspired by CoALA (Cognitive Architectures for Language Agents, Princeton 2023). Most LLM agents only implement semantic memory; OpenCouch implements all three, which is what makes cross-session personalization possible. Learn more →
Three pillars
Hybrid regex + LLM crisis gate on every message. Three deterministic fast paths before the LLM fallback. 42-case eval dataset. Always-on audit log even in incognito.
Six therapeutic modes — supportive, reflective, clarifying, psychoeducation, guided exercise, closing — selected by a hybrid dispatcher per turn.
Semantic facts, episodic session arcs, and procedural style rules — all extracted automatically, stored in SQLite, retrieved via hybrid search with Reciprocal Rank Fusion.
Under the hood
Four SQLite files under .store/ — threads, memory, crisis log, session feedback. Each owns its schema independently.
Per-record deletion, namespace-wide wipe, retention purge, recall toggle. Users can inspect and delete anything the agent remembers.
Per-turn stage timings, raw state dump, transcript mode annotations. Every node writes diagnostics via merge reducers.
Pre-extractor small-talk gate, parallel extractor fan-out, deterministic-first dispatch. Most turns never need an LLM classification call.
Experimental speech preview via OpenAI Realtime. Current path is low-latency and memory-backed, but speech-only and non-agentic.
Important to know
OpenCouch is a research and development prototype — not a substitute for professional mental health care. It is not a licensed therapist, a diagnostic tool, or an emergency service.