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.
- [2026-01-14] Our paper TheraMind has been accepted by WWW2026 !
- [2025-11-02] Paper submitted to arXiv:https://arxiv.org/abs/2510.25758.
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.
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.
- 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.
Our TheraMind achieves better performance across all ten distinct categories of psychological issues in both single-session (left) and multi- session (right) contexts.
# 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.pyfrom main import AutoDialogueRunner
runner = AutoDialogueRunner()
runner.run(num_sessions=6, max_rounds_per_session=8)
# or you can directly run
python agent/main.pyfrom main import TherapistAgent
therapist = TherapistAgent()from main import PatientAgent
patient_agent = PatientAgent() @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}
}For research and educational use only. Please ensure compliance with ethical and legal standards in mental health AI research.
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.

