Skip to main content

Cami

A Counselor Agent for Motivational Interviewing through State Inference and Topic Exploration

Overview

PropertyValue
Keycami
TypeLLM-based
FocusMotivational Interviewing (MI) + topics

Key Features

  • Stage inference: Infers the client's readiness stage (Precontemplation, Contemplation, Preparation) each turn
  • MI strategies: Selects up to 2 MI-aligned strategies per response
  • Topic graph navigation: Explores counseling topics using a configurable topic graph and topic stack
  • Multi-candidate generation: Generates several candidate responses and selects the best one

How It Works

  1. Init: Loads prompts from data/prompts/therapist/cami.yaml and a topic graph from JSON.
  2. Greeting: The first generate_response() call returns a greeting (from the greeting prompt key).
  3. Each turn:
    • Infers client stage from conversation history
    • Selects MI strategies
    • Picks the next topic using the topic stack and graph
    • Generates candidate responses, selects and optionally refines one

Usage

CLI

uv run python -m examples.simulate therapist=cami

Python

from patienthub.therapists import get_therapist

therapist = get_therapist(agent_name="cami", lang='en')

response = therapist.generate_response("I don't really want to talk about this.")
print(response.content)

Configuration

ParameterTypeDefaultDescription
agent_namestring"cami"Therapist identifier
prompt_pathstringdata/prompts/therapist/cami.yamlPath to prompt file
topic_graphstringdata/resources/CAMI/topic_graph.jsonTopic graph JSON path
goalstring"reducing drug use"Target goal used in prompts
behaviorstring"drug use"Target behavior used in prompts
model_typestring"OPENAI"Model provider key
model_namestring"gpt-4o"Model identifier
temperaturefloat0.7Sampling temperature
max_tokensint8192Max response tokens
max_retriesint3API retry attempts
langstring"en"Language key for prompt loading

Notes

  • Cami relies on prompt templates and a topic graph; it does not load character/persona JSON files.
  • The topic graph defines the counseling topics and their relationships.

Use Cases

  • MI-style counseling simulations with topic guidance
  • Training/evaluation where topic coverage and MI strategy adherence matter