Skip to main content

Quick Start

This guide will get you running your first patient simulation in under 5 minutes.

Run a Simulation

The simplest way to start is with the CLI:

uv run python -m examples.simulate

This runs a therapy session with default settings (talkDep client, user therapist).

Customize the Simulation

Change the Patient Type

uv run python -m examples.simulate client=patientPsi

Use an AI Therapist

uv run python -m examples.simulate client=patientPsi therapist=CBT

Full Example

uv run python -m examples.simulate \
client=consistentMI \
therapist=CBT \
event.max_turns=20

Available Clients

ClientDescription
patientPsiCBT-focused patient simulation
consistentMIMotivational Interviewing with stage transitions
eeyoreDepression simulation
annaAgentMulti-session with memory
adaptiveVPNurse communication training
simPatientCognitive model updates
talkDepDepression screening
sapsState-aware medical patient
clientCastPsychotherapy assessment
psychePsychiatric assessment
roleplayDohPrinciple-based simulation

Available Therapists

TherapistDescription
userHuman input (default)
CBTAI CBT therapist
elizaClassic Eliza chatbot
badPoor therapist (for testing)

Python API

For more control, use the Python API directly:

from omegaconf import OmegaConf
from patienthub.clients import get_client

# Configure the client
config = OmegaConf.create({
'agent_type': 'patientPsi',
'model_type': 'OPENAI',
'model_name': 'gpt-4o',
'temperature': 0.7,
'max_tokens': 1024,
'max_retries': 3,
'data_path': 'data/characters/PatientPsi.json',
'data_idx': 0,
})

# Load the client
client = get_client(configs=config, lang='en')
client.set_therapist({'name': 'Dr. Smith'})

# Generate responses
response = client.generate_response("Hello, how are you feeling today?")
print(response)

response = client.generate_response("Can you tell me more about that?")
print(response)

Interactive Web Demo

Launch the Chainlit web interface:

chainlit run app.py

Then open http://localhost:8000 in your browser.

Output Files

Session data is saved to data/sessions/ by default. You can customize this:

uv run python -m examples.simulate event.output_dir=outputs/my_session.json

What's Next?