Skip to main content

AnnaAgent

Dynamic Evolution Agent System with Multi-Session Memory for Realistic Seeker Simulation

Venue: ACL 2025 (Findings)
Paper: ACL Anthology

Overview​

AnnaAgent aims to simulate the dynamic evolution of the AI seeker's emotions and multi-session memory. It features a sophisticated emotion system based on the GoEmotions taxonomy (28 emotion categories) and models the progression of psychological complaints through multi-stage chains.

Key Features​

  • Multi-Session Memory: Maintains context across multiple therapy sessions
  • Dynamic Evolution: Complaint progression through cognitive change chains
  • 28-Emotion System: Based on GoEmotions taxonomy (Positive, Neutral, Ambiguous, Negative)
  • Profile-Based: Detailed patient profiles with depression/suicide risk levels
  • Previous Session Integration: References historical conversations when relevant

How It Works​

  1. Profile Loading: Loads detailed patient profile with risk levels and symptoms
  2. Emotion Inference: Determines emotional state based on therapist input
  3. Context Check: Evaluates if historical information is needed for the response
  4. Complaint Progression: Tracks progress through the cognitive change chain
  5. Response Generation: Produces contextually appropriate responses with emotional consistency

Emotion Categories​

AnnaAgent uses the GoEmotions taxonomy with weighted emotion transitions:

CategoryEmotions
Positiveadmiration, amusement, approval, caring, curiosity, excitement, gratitude, joy, love, optimism, pride, relief
Neutralneutral
Ambiguousconfusion, disappointment, nervousness
Negativeanger, annoyance, disapproval, disgust, embarrassment, fear, sadness, remorse, grief

Usage​

CLI​

patienthub simulate client=annaAgent

Python​

from patienthub.clients import get_client

client = get_client(agent_name="annaAgent", lang='en')

response = client.generate_response("How have you been since our last session?")
print(response)

The original implementation described in this paper are based on Qwen2.5-7B-Instruct.

Configuration​

OptionDescriptionDefault
prompt_pathPath to prompt filedata/prompts/client/annaAgent.yaml
data_pathPath to character filedata/characters/annaAgent.json
data_idxCharacter index0

Character Data Format​

{
"profile": {
"age": "42",
"gender": "Female",
"marital_status": "Divorced",
"occupation": "Teacher",
"symptoms": "Lack of self-confidence, low self-worth, feelings of guilt..."
},
"situation": "Description of the current situation triggering distress...",
"statement": ["Initial statements the patient might make..."],
"style": ["Self-critical", "Emotionally restrained", "Direct and concise"],
"complaint_chain": [
{ "stage": 1, "content": "Initial complaint..." },
{ "stage": 2, "content": "Deeper realization..." },
{ "stage": 3, "content": "Core belief surfaces..." }
],
"status": "Summary of patient's current mental health status...",
"report": {
"case_title": "...",
"case_categories": ["Anxiety Disorder", "Low Self-Worth"],
"techniques_used": ["Cognitive Behavioral Therapy", "Emotional Support"],
"case_summary": ["..."],
"counseling_process": ["..."],
"insights_and_reflections": ["..."]
},
"previous_conversations": [
{ "role": "Client", "content": "..." },
{ "role": "Therapist", "content": "..." }
]
}

Resources​

data/resources/annaAgent_events.json: Psychological distress triggering events, keyed by language (en/zh). Each has adult (age-tagged {age, event} records, used for ±5-year age matching) and teen (a list of event strings).

GHQ, SASS, and BDI scales are shared constants in patienthub.resources (ANNAAGENT_SCALES).