File size: 4,800 Bytes
2b91629
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c1ae752
2b91629
 
 
 
 
 
 
 
 
 
 
 
 
b690278
 
2b91629
 
 
 
 
e25d722
2b91629
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e25d722
2b91629
 
 
 
 
 
 
735f8ed
2b91629
 
2ffbf6b
 
 
 
 
 
 
 
 
 
b690278
2b91629
b690278
 
d7e3980
2568a5f
b690278
 
2b91629
 
 
b690278
2b91629
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# Capabilities (Current “What the App Does”)

This document describes what ConverTA does today, independent of any past roadmap.

## Modes

- **AI-to-AI**
  - Runs a simulated healthcare survey interview between:
    - an automated **Surveyor** agent and
    - a synthetic **Patient** agent.
  - When the run completes normally, the app performs post-run analysis and seals the run.

- **Human-to-AI**
  - Lets a human play one side of the conversation while the other side is generated by the LLM.
  - Ending the session triggers the same post-run analysis and seals the run.

- **Upload Text**
  - Paste a transcript or upload a text/PDF file (best-effort PDF extraction).
  - Runs the same analysis pipeline and seals the run.

- **History**
  - Lists sealed runs (shared/global) and allows read-only replay:
    - transcript
    - analysis output
  - Exports from History use server-canonical run data.

- **Configuration**
  - Review/edit system prompts and agent configuration.
  - Create/duplicate/edit/delete **user personas**.
  - Create/duplicate/edit/delete **analysis frameworks** (bottom-up + rubric + top-down); default framework is read-only and can be duplicated.

## Persistence (Server-Canonical)

ConverTA uses SQLite for persistence.

- `DB_PATH` controls the SQLite path.
  - Local Docker default: `.localdata/...`
  - Hugging Face Spaces default: under `/data/...`

Persisted artifacts:

- **Sealed runs** (transcript + analysis + evidence catalog + config snapshots)
- **Personas** (defaults + user-created) with versioning
- **Shared settings** (system prompts + active analysis framework id)
- **Analysis frameworks** (bottom-up + rubric + top-down) with versioning

Notes:

- Sealed runs are immutable.
- “Stop/abort” during a live run does not produce a sealed run.
- If the resource agent fails (e.g., OpenRouter errors), the UI surfaces retry attempts and a failure notice.

## Personas

There are two persona kinds:

- **Surveyor personas**
  - Editable fields (user personas):
    - attribute list (bullet-style strings)
    - question bank (list of target questions)
  - Selection of which Surveyor is used for a run happens in the run panels (not in Configuration).

- **Patient personas**
  - Editable fields (user personas):
    - attribute list (bullet-style strings)
  - Selection of which Patient is used for a run happens in the run panels (not in Configuration).

Default personas:

- A small seeded set exists for each kind.
- Defaults are view-only in the UI (to prevent breaking the app by deleting/over-editing baseline personas).

## System Prompts (Universal per agent type)

These are shared, DB-backed “universal” system prompts:

- Surveyor system prompt (applies to all surveyor personas)
- Patient system prompt (applies to all patient personas)
- Analysis agent system prompt (applies to all analyses)

The Configuration UI provides:

- “Apply defaults”
- A warning/acknowledgement gate before editing the system prompt text.
- Default analysis frameworks are read-only and must be duplicated to edit.

## Analysis

Analysis runs post-conversation (or on uploaded text) and produces evidence-backed outputs:

- **Bottom-up findings** (emergent themes)
- **Care experience rubric** (fixed buckets: positive / mixed / negative / neutral)
  - Includes a model-rated split across positive/mixed/negative (for a pie chart summary)
- **Top-down codebook categories** (template-driven)

### Analysis execution (3-pass)

For reliability and smaller-model compatibility, the analysis pipeline runs as three sequential LLM calls:

1. Bottom-up findings
2. Care experience rubric
3. Top-down codebook categories

In the UI, each column populates as its pass completes, while later passes show as pending/running.

### Analysis frameworks

- An **analysis framework** defines:
  - bottom-up instructions + attributes
  - rubric instructions + attributes
  - top-down instructions + attributes + codebook categories (optional per-category descriptions)
- Frameworks are managed in **Configuration** (create/duplicate/delete + edit the framework).
- The **active framework is selected per run** using the dropdown next to the **📊 Analysis** header in:
  - AI-to-AI
  - Human-to-AI
  - Upload Text
- Runs snapshot the selected framework so History replay and exports remain stable.

## Exports

- Excel (`.xlsx`) multi-sheet export and lossless JSON export are available after analysis completes.
- When a run is sealed, exports are generated from server-canonical persisted data.
  - There is a client-side fallback export for non-sealed sessions.

## Access Control (Prototype)

If `APP_PASSWORD` is set:

- UI is gated behind a login overlay.
- API access requires the session cookie, or the internal header used by the UI WebSocket bridge.