Skip to main content
Back

Shenzhen University's TheraMind Gives AI Therapists a Long-Term Memory

A dual-loop agent architecture separates turn-by-turn dialogue tactics from cross-session strategy, letting an LLM run coherent, adaptive counseling arcs.

Pro

  • TheraMind introduces a dual-loop LLM agent that separates in-session dialogue tactics from cross-session therapy strategy.
  • Cross-Session Loop evaluates each session's efficacy and can switch therapeutic method for the next session.
  • Intra-Session Loop uses a Reaction Classifier producing emotion, intensity, and attitude to condition responses.
  • Beats DeepSeek-V3 backbone by 18.2% on multi-session average across Coherence, Flexibility, Empathy, and Attunement.
  • Human raters preferred it over PsyDTLLM 75%, DeepSeek-V3 70%, and Interactive Agents 65% of the time.
  • Code released on GitHub; paper accepted to WWW 2026.

Most LLM-based counseling chatbots have a memory problem. They can produce a warm, empathetic reply in a single turn, then forget everything the next time you open the app. A team from Shenzhen University, University of Macau, and Guangdong Laboratory of Artificial Intelligence and Digital Economy has published TheraMind, an agent framework that tries to fix this by splitting the therapy problem into two nested control loops: one for what to say in the current turn, and one for how to adapt the treatment plan across sessions.

The paper, accepted to The Web Conference 2026, reports that TheraMind beats specialized counseling models, general-purpose LLMs like DeepSeek-V3, and prior agent frameworks on both single-session and longitudinal metrics. Code is available on GitHub.

Why current counseling bots fall apart over time

The authors argue existing systems suffer from two structural flaws. Systems like ChatCounselor and PsyLLM are predominantly architected for single-session contexts, exhibiting a form of "clinical amnesia" that prevents them from building upon past interactions. The second is strategic rigidity: most are hard-coded with a single therapeutic modality such as Cognitive Behavioral Therapy and cannot flexibly adjust methods across sessions in response to a patient's evolving needs.

Real therapists do the opposite. They remember the metaphor you used three weeks ago, notice when CBT isn't landing, and switch to a client-centered approach. Reducing that to a stateless empathetic-response generator misses most of what makes therapy work.

Framework diagram comparing existing counseling agents with TheraMind's dual-loop design

The dual-loop trick

TheraMind decomposes counseling into two interconnected control flows:

  • Intra-Session Loop handles the tactics inside one session, deciding what to say turn by turn.
  • Cross-Session Loop handles the strategy between sessions, deciding what therapy to use next.