Skip to main content

Client Agents API

Client agents simulate patients/clients in therapy interactions.

Available Clients

ClientKeyDescription
SAPSsapsState-aware medical patient
ConsistentMIconsistentMIMI client with stage transitions (ACL 2025)
EeyoreeeyoreDepression simulation (ACL 2025)
AnnaAgentannaAgentMulti-session with memory (ACL 2025)
AdaptiveVPadaptiveVPNurse training simulation (ACL 2025)
SimPatientsimPatientCognitive model updates (CHI 2025)
TalkDeptalkDepDepression screening (CIKM 2025)
ClientCastclientCastPsychotherapy assessment
PsychepsychePsychiatric assessment
PatientPsipatientPsiCBT-focused patient (EMNLP 2024)
RoleplayDohroleplayDohPrinciple-based simulation (EMNLP 2024)
UseruserHuman input client

Listing Available Clients

from patienthub.clients import CLIENT_REGISTRY, CLIENT_CONFIG_REGISTRY

# List all client types
print("Available clients:", list(CLIENT_REGISTRY.keys()))

# Get config class for a client
config_class = CLIENT_CONFIG_REGISTRY['patientPsi']
print(config_class)

Loading a Client

from patienthub.clients import get_client

client = get_client(agent_name='patientPsi', lang='en')

Loading a Client with Custom Configurations

from omegaconf import OmegaConf
from patienthub.clients import get_client

config = OmegaConf.create({
'agent_name': 'patientPsi',
'model_type': 'OPENAI',
'model_name': 'gpt-4o',
'temperature': 0.7,
'max_tokens': 8192,
'max_retries': 3,
'prompt_path': 'data/prompts/client/patientPsi.yaml',
'data_path': 'data/characters/PatientPsi.json',
'data_idx': 0,
'patient_type': 'upset',
})

client = get_client(agent_name='patientPsi', configs=config, lang='en')

Response Generation

response = client.generate_response("How have you been feeling lately?")
print(f"Response: {response.content}")

Data Format

  • Prompt Data is stored in data/prompts/client.
  • Character data (profiles) is stored in files under data/characters
  • Each file is a JSON list; data_idx selects the entry to be simulated

Configuration Options

Common Options

OptionTypeDefaultDescription
agent_namestrrequiredClient identifier
model_typestr"OPENAI"Model provider key (used to read ${MODEL_TYPE}_API_KEY / ${MODEL_TYPE}_BASE_URL)
model_namestr"gpt-4o"Model identifier
temperaturefloat0.7Sampling temperature (0-1)
max_tokensint8192Max response tokens
max_retriesint3API retry attempts
prompt_pathstrvariesPath to method prompts
data_pathstrvariesPath to character JSON file
data_idxint0Index of character in file
langstr"en"Language code

Response Format

Most clients return a structured response:

from pydantic import BaseModel, Field

class Response(BaseModel):
content: str = Field(
description="The content of the patient's response"
)

Some clients include additional fields:

# PatientPsi response
class Response(BaseModel):
content: str
# Internal reasoning (not shown to therapist)

# ConsistentMI response
class Response(BaseModel):
content: str
action: str # Selected action type

By Focus Area

Depression & Mood Disorders

  • Eeyore: Realistic depression simulation with expert validation
  • TalkDep: Clinically grounded personas for depression screening

Motivational Interviewing

  • ConsistentMI: Stage-of-change model with consistent behavior
  • SimPatient: Cognitive model with internal state tracking

General Psychotherapy

  • PatientPsi: CBT-focused with cognitive distortions
  • RoleplayDoh: Domain-expert created principles
  • ClientCast: Assessment-focused simulation

Specialized Training

  • AdaptiveVP: Nurse communication training
  • SAPS: Medical diagnosis training
  • Psyche: Psychiatric assessment training

Create New Clients

You can run the following command to create the necessary files for a new client:

uv run python -m examples.create generator.gen_agent_name=client generator.gen_agent_name=<agent_name>

This creates the following two files and registers the client in __init__.py:

  • patienthub/clients/<agent_name>.py
  • data/prompts/client/<agent_name>.yaml

All clients implement the BaseClient abstract base class (see patienthub/clients/base.py).

See Also