Skip to content

Emo-gml/TheraMind

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 

Repository files navigation

💌 TheraMind : A Strategic and Adaptive Agent for Longitudinal Psychological Counseling (WWW 2026)

🌸 About

This repository contains the official evaluation code and data for the paper "TheraMind : A Strategic and Adaptive Agent for Longitudinal Psychological Counseling". See more details in our paper. If you find this project helpful, feel free to ⭐ it!

TheraMind represents a definitive shift in AI mental health, moving beyond static models to a dynamic, longitudinal agent that emulates human cognitive processes. It features a novel dual-loop framework that manages both immediate turn-by-turn interactions and long-term strategic goals across multiple sessions. Unlike traditional single-therapy tools, TheraMind utilizes an adaptive selection mechanism to adjust its clinical approach based on real-time efficacy. By integrating patient state perception with phase-aware dialogue management, it transforms standard response generation into a deliberative clinical intervention.

📰 News

📦 Dataset

Patient-Medical-Record dataset provides a comprehensive medical profile for Patient Agent to create a more realistic patient. It contains key information including patient pseudonym, age, mental health history, physical health history, current problems and symptoms, and its corresponding types of mental illness. We apply large language models to automatically extract and integrate key information from the original dataset to get the Patient-Medical-Record dataset. TheraMind-Patient-Guidance dataset provides a session-level guidance for Patient Agent to achieve better performance during the multi-session conversation. We use large language models to automatically summarize the treatment process from the origianl dataset and allocate reasonably to get sessinon-level abstracts. By adhering to a standardized structure, our synthesized datasets ensure a high degree of authenticity, privacy, and clinical reliability. Ultimately, it provides a robust basis for evaluating the long-term, nuanced capabilities of counseling agents within realistic contexts.

The original psychological dataset used in our synthesized datasets are derived from a publicly available research dataset CPsyCounR which consists of 3,134 anonymized and professionally rewritten Chinese psychological counseling reports. All datasets are used strictly for research purposes in accordance with their original licenses and usage guidelines.

🧠 What is TheraMind ?

TheraMind is an agent specialized in longitudinal psychological counseling and adaptive mental health dialogue generation. Addressing the critical limitations of standard LLMs, it unifies tactical dialogue management and long-term strategic planning through a novel dual-loop architecture.

Agent Pipline Overview

🧩 Key Features

  • A novel dual-loop agent framework (TheraMind) that models both turn-level dialogue dynamics and the strategic, multi-session structure of psychological counseling.
  • An adaptive therapy selection mechanism that evaluates therapeutic efficacy and adjusts treatment strategies across sessions, addressing the limitations of static single-therapy approaches.
  • A clinically grounded dialogue management system that integrates patient state perception, dynamic strategy selection, and treatment phase awareness to support deliberative therapeutic interventions.

📈 Superior Performance

Our TheraMind achieves better performance across all ten distinct categories of psychological issues in both single-session (left) and multi- session (right) contexts.

radar overview

🔥 Quick Start

Preparation

# Prepare your api configure first
{"api_config": {
    "openai": {
      "base_url": "",
      "api_key": "",
      "model": "",
      "enabled": true}}
}

# Produce patient medical records
python case_produce.py

# Generate session guidance
python data_produce.py

Automatic Conversation Simulation Between Doctor and Patient

from main import AutoDialogueRunner
runner = AutoDialogueRunner()
runner.run(num_sessions=6, max_rounds_per_session=8)

# or you can directly run
python agent/main.py

TherapistAgent Create

from main import TherapistAgent
therapist = TherapistAgent()

PatientAgent Create

from main import PatientAgent
patient_agent = PatientAgent() 

📜 Citation

@article{hu2025theramind,
  title={Theramind: A strategic and adaptive agent for longitudinal psychological counseling},
  author={Hu, He and Zhou, Yucheng and Ma, Chiyuan and Wang, Qianning and Zhang, Zheng and Ma, Fei and Cui, Laizhong and Tian, Qi},
  journal={arXiv preprint arXiv:2510.25758},
  year={2025}
}

🧩 License

For research and educational use only. Please ensure compliance with ethical and legal standards in mental health AI research.

🌱 Acknowledgements

We gratefully acknowledge the CPsyCounR dataset for providing counseling reports that support the simulation of realistic patient profiles in our dataset. We also sincerely thank the psychology experts who offered valuable guidance on psychotherapy processes and counseling dynamics during the development of TheraMind, helping ensure the clinical plausibility and realism of the simulated counseling scenarios.

🔥Please contact huhe@gml.ac.cn or chiyuanma@link.cuhk.edu.cn if you encounter any issues.

About

TheraMind : A Strategic and Adaptive Agent for Longitudinal Psychological Counseling (WWW 2026)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages