File size: 2,253 Bytes
bcbb8c5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Live Brain + Conversation Notes

This phase keeps the controller training-free and model-agnostic. The real model
lives behind `modal_app/brain_modal.py`; local code only asks for `BrainSignals`
and generated replies.

## Flow

1. The text stream feeds incremental word groups plus an optional silence flag.
2. `Conversation` sends the current dialogue prefix and newest user chunk to
   `LiveBrainPanel.step_all()`.
3. Modal computes per-agent surprise, hidden vector, readiness, and `p_end`.
4. `WhenToSpeakController` arbitrates `SILENT`, `BACKCHANNEL`, `TAKE_FLOOR`, or
   `INTERRUPT`.
5. On `TAKE_FLOOR` or `INTERRUPT`, `Conversation` calls Modal `generate()` and
   splices the short investor reply into the dialogue.

The sample pitch deliberately includes a weak claim: "ten thousand stores and
zero churn after launching last week." The expected demo behavior is an investor
interrupt or floor-take near that claim, with the generated line recorded in
`eval/conversation_log.json`.

Run the real text-streamed demo with:

```text
uv run modal run modal_app/brain_modal.py
```

## Modal

The live brain tries `nvidia/Llama-3.1-Nemotron-Nano-4B-v1.1` first and falls
back to `Qwen/Qwen2.5-3B-Instruct`. We keep `HF_HOME=/cache` on a Modal Volume so
weights persist across runs.

## Recorded Demo

The committed `eval/conversation_log.json` was produced by:

```text
uv run modal run modal_app/brain_modal.py
```

Latest measured run: `nvidia/Llama-3.1-Nemotron-Nano-4B-v1.1` on `NVIDIA A10`.
Total wall time was 49.1 s because the run included Modal container/model startup.

At step 3 the controller interrupted the planted weak claim. The winning agent
was `ruthless_skeptic` with urge 1.47 and readiness 0.67. At step 7 the panel now
takes the floor at turn end.

```text
Ruthless Skeptic: Zero churn after one week is not churn data.
Vision Optimist: Show cohorts, paid conversion, and retention.
```

Generation caveat: Nemotron-Nano produced malformed text for these two `generate()`
calls, so `eval/conversation_log.json` records `reply_source: "fallback"` for both.
The timing signals and controller decisions are still real Modal/Nemotron outputs;
the fallback only guards the spoken text until the generator prompt/model is improved.