MikelWL commited on
Commit
28613fa
·
1 Parent(s): 3959d62

Docs: define core persona knobs

Browse files
Files changed (2) hide show
  1. docs/README.md +1 -0
  2. docs/persona-knobs.md +136 -0
docs/README.md CHANGED
@@ -5,6 +5,7 @@ These short guides are all you need to extend the AI Survey Simulator:
5
  - `overview.md` — architecture summary, major components, and repository map.
6
  - `development.md` — setup, runtime instructions, and implementation guidelines.
7
  - `persistence.md` — persistent run history + persona CRUD design (HF `/data` now, Railway later).
 
8
  - `roadmap.md` — current status and prioritized future work.
9
 
10
  Keep documentation lean: update the relevant file when behavior changes or priorities shift.
 
5
  - `overview.md` — architecture summary, major components, and repository map.
6
  - `development.md` — setup, runtime instructions, and implementation guidelines.
7
  - `persistence.md` — persistent run history + persona CRUD design (HF `/data` now, Railway later).
8
+ - `persona-knobs.md` — persona configuration knobs (core v1 vs deferred) for Surveyor + Patient.
9
  - `roadmap.md` — current status and prioritized future work.
10
 
11
  Keep documentation lean: update the relevant file when behavior changes or priorities shift.
docs/persona-knobs.md ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Persona “Knobs” (v1 Core) — Surveyor + Patient
2
+
3
+ This document defines the **core, behavior-changing configuration knobs** we will support first for personas.
4
+
5
+ Goal alignment:
6
+
7
+ - **A) Surveyor quality**: reliably covers target questions with empathy, good flow, and appropriate probing.
8
+ - **B) Validation harness**: synthetic patients exist to *stress test* the surveyor under realistic situations.
9
+ - **C) Analysis**: handled separately (resource agent knobs are out of scope here).
10
+
11
+ The guiding principle is: **every UI field must have a guaranteed effect** on generation (no “decorative” persona metadata).
12
+
13
+ ---
14
+
15
+ ## Key design decision: compile structured knobs into prompts
16
+
17
+ Today, the LLM behavior is primarily driven by the persona’s `system_prompt`. Many existing YAML fields do not materially affect generation unless they are manually duplicated into that prompt.
18
+
19
+ For v1, we will:
20
+
21
+ 1. Define a small structured schema of core knobs (below).
22
+ 2. **Compile** those knobs into a deterministic “persona overlay” section that is included in the model’s system prompt.
23
+ 3. Keep a **system prompt preview** in the UI showing the exact final system prompt text that will be sent.
24
+
25
+ This preserves flexibility (freeform prompt editing) while ensuring the structured knobs always matter.
26
+
27
+ Non-goal: making every current YAML field first-class.
28
+
29
+ ---
30
+
31
+ ## What is “baked in” (global, not persona-specific)
32
+
33
+ These are global constraints / scaffolding that apply to all personas and are not edited in the persona editor:
34
+
35
+ - Turn-format constraints (e.g., “ask at most one question”, “1–2 sentences”) and token/temperature defaults.
36
+ - Conversation scaffolding templates (greeting/follow-up framing; use of the last message).
37
+ - Conversation-history inclusion and formatting (e.g., max history window).
38
+ - Safety/compliance rules we want consistently enforced across personas.
39
+
40
+ Personas can express style *within* these constraints, but do not change the constraints themselves in v1.
41
+
42
+ ---
43
+
44
+ ## Surveyor persona knobs (Core v1)
45
+
46
+ These should be exposed as first-class fields and compiled into the surveyor system prompt.
47
+
48
+ ### Identity
49
+ - `name` (required): display name.
50
+ - `description` (optional): short one-liner shown in selectors.
51
+
52
+ ### Survey behavior
53
+ - `stance` (dropdown): `empathetic_researcher | neutral_clinical | time_efficient`.
54
+ - `question_strategy` (dropdown): `sequential | adaptive_followups | conversational_cover_all`.
55
+ - `probing_policy` (multi-select):
56
+ - `clarify_timeline`
57
+ - `ask_examples`
58
+ - `quantify_frequency_severity`
59
+ - `reflect_emotion`
60
+ - `summarize_and_confirm`
61
+ - `empathy_style` (dropdown): `validating | neutral | supportive_brief`.
62
+ - `off_track_handling` (dropdown): `gentle_redirect | one_vent_then_redirect | hard_redirect`.
63
+ - `sensitivity_handling` (multi-select):
64
+ - `acknowledge`
65
+ - `offer_skip`
66
+ - `normalize`
67
+ - `avoid_advice`
68
+
69
+ ### Freeform prompt
70
+ - `system_prompt` (required): human-editable base prompt (still important).
71
+ - `system_prompt_addition` (optional, per-run): already supported in the configuration UI; stays as run-level override.
72
+
73
+ ---
74
+
75
+ ## Patient persona knobs (Core v1)
76
+
77
+ These should be exposed as first-class fields and compiled into the patient system prompt.
78
+
79
+ ### Identity
80
+ - `name` (required): display name.
81
+ - `description` (optional): short one-liner shown in selectors.
82
+
83
+ ### Scenario / health situation
84
+ - `conditions` (list): e.g., `Type 2 diabetes`, `asthma`.
85
+ - `medications` (list): e.g., `metformin`, `albuterol`.
86
+ - `care_context` (short text): e.g., “primary care follow-up”, “recent ER visit”.
87
+ - `recent_events` (short bullets): key timeline anchors used to answer questions realistically.
88
+
89
+ ### Barriers / constraints
90
+ - `barriers` (multi-select):
91
+ - `cost`
92
+ - `transport`
93
+ - `time`
94
+ - `insurance`
95
+ - `digital_access`
96
+ - `language`
97
+ - `stigma`
98
+
99
+ ### Conversational behavior
100
+ - `cooperativeness` (ordinal): `forthcoming | mixed | guarded`.
101
+ - `emotional_stance` (dropdown): `anxious | frustrated | neutral | optimistic`.
102
+ - `verbosity` (dropdown): `brief | normal | detailed`.
103
+ - `health_literacy` (dropdown): `low | medium | high`.
104
+ - `recall_certainty` (dropdown): `confident | mixed | uncertain`.
105
+ - `digression_tendency` (dropdown): `on_track | occasional_anecdotes | tangential`.
106
+
107
+ ### Freeform prompt
108
+ - `system_prompt` (required): human-editable base prompt.
109
+ - `system_prompt_addition` (optional, per-run): already supported in the configuration UI; stays as run-level override.
110
+
111
+ ---
112
+
113
+ ## Secondary knobs (documented, not implemented in v1)
114
+
115
+ These may be useful later but are intentionally deferred to avoid UI complexity without clear validation value.
116
+
117
+ Surveyor:
118
+ - terminology level (plain/mixed/clinical-with-explanations)
119
+ - pacing (brief/normal/thorough) beyond global constraints
120
+ - explicit consent/confidentiality micro-scripts as toggles
121
+
122
+ Patient:
123
+ - privacy skepticism toggle (“Why do you need this?”)
124
+ - quirks (interrupts, under-reports symptoms, minimizes pain)
125
+ - richer biography fields (occupation, family structure) unless used for study design
126
+
127
+ ---
128
+
129
+ ## Implementation notes (how these knobs become real)
130
+
131
+ To prevent dead fields, the implementation should ensure:
132
+
133
+ - All core knobs are included in the final system prompt text (compiled overlay).
134
+ - The UI shows a prompt preview so users understand the effective configuration.
135
+ - Persisted runs capture the persona snapshot and the prompt overlay used (already supported by run snapshots).
136
+