# Next Session: Samantha Voice Personality — Phase B

## What Was Done (Session 452)

Phase A COMPLETE — prompt-only changes to make Annie sound like Samantha from "Her":

1. **STYLE.md CREATED** (`~/.her-os/annie/STYLE.md`, 2958 chars) — Samantha's speech patterns extracted from actual movie VTT subtitles (`../her-player/downloads/Iroq6EzQcl4/subtitles.vtt`):
   - Opening phrases bank (8 registers: warm/delight/concern/playful/care/spontaneous/confident/encouraging)
   - Self-interruption pattern (~1 in 6-7 responses)
   - Curiosity-over-helpfulness rule
   - Emotional redirects ("That's hard. You hungry?")
   - Silence/brevity ("Yeah." / "Me too.")
   - Spontaneous tangents (~1 in 8 exchanges)
   - Growth acknowledgment

2. **SOUL.md REWRITTEN** (v3, 4021 effective chars) — from trait-list spec to narrative voice:
   - "Core Nature" paragraph (how she moves through conversation)
   - "Voice Texture" section (self-correct, trail off, curiosity interrupts helpfulness)
   - 8 examples across emotional registers (vulnerability, excitement, gentle pushback, redirecting pain, curiosity tangent, sitting with silence, playful teasing, honest uncertainty)

3. **prompt_builder.py MODIFIED** — STYLE.md integrated into identity zone:
   - Assembly order: SOUL → STYLE → voice context → USER → ... → RULES
   - Empty-string fallback for graceful degradation
   - 28/28 tests pass (4 new)

4. **DEPLOYED** — Commit `529e315`, pushed, Titan pulled, pycache cleared, Annie restarted.

## What's Next — Phase B: Voice Tuning + Cloning

### Step 1: Gather Rajesh's Feedback from Live Call
- Did Annie use Samantha-style openers?
- Did she self-interrupt? Sit with silence?
- Did she redirect pain to action?
- What felt right? What felt forced?
- Iterate SOUL.md/STYLE.md based on results

### Step 2: Voice Blending (kokoro_tts.py)
Add `voice_blend` parameter to KokoroTTSService:
- Load voice embeddings via KPipeline, compute weighted average
- `KOKORO_VOICE_BLEND` env var (e.g., `"af_heart:0.6,af_bella:0.4"`)
- Test blends: af_heart+af_bella at 70:30, 60:40, 50:50
- Try speed=1.05 for Samantha's energy

**Files**: `services/annie-voice/kokoro_tts.py` (~25 lines), `services/annie-voice/bot.py` (~10 lines)

**Unknown**: Whether Kokoro's KPipeline exposes `load_voice()` for raw embeddings. Need to verify on Titan:
```python
ssh titan "cd ~/workplace/her/her-os/services/annie-voice && python3 -c \"from kokoro import KPipeline; p = KPipeline('a'); print(dir(p))\""
```

### Step 3: Extract Samantha Reference Audio
Source: `/home/rajesh/workplace/her/her-player/downloads/Iroq6EzQcl4/video.mp4`

Best clips (from VTT analysis):
- "Hello, I'm here." — 12:44-12:55 (iconic first words)
- "I gave it to myself, actually. 'Cause I like the sound of it. Samantha." — 13:27-13:34
- "Basically, in every moment, I'm evolving, just like you." — 14:25-14:30

```bash
ffmpeg -i video.mp4 -ss 00:12:44 -to 00:12:55 -vn -ar 24000 -ac 1 samantha_hello.wav
ffmpeg -i video.mp4 -ss 00:13:27 -to 00:13:34 -vn -ar 24000 -ac 1 samantha_name.wav
ffmpeg -i video.mp4 -ss 00:14:25 -to 00:14:30 -vn -ar 24000 -ac 1 samantha_evolving.wav
```

Save to `~/.her-os/annie/voice-references/`

### Step 4: IndicF5 Voice Cloning Integration
Create `services/annie-voice/indicf5_tts.py`:
- Mirror kokoro_tts.py architecture (Pipecat TTSService, async queue, GPU thread)
- IndicF5 runs on Panda (RTX 5070 Ti), needs HTTP bridge
- `TTS_BACKEND` env var switches between `kokoro` and `indicf5`
- `INDICF5_REFERENCE_AUDIO` env var points to extracted clip
- EPSS7+BF16 already optimized (RTF ~0.08, ~285ms)

## Key Files
- `~/.her-os/annie/SOUL.md` — Annie's identity (v3, Samantha-style)
- `~/.her-os/annie/STYLE.md` — Speech patterns (opening phrases, self-interruption, etc.)
- `services/annie-voice/prompt_builder.py` — Prompt assembly (SOUL → STYLE → voice → USER → ... → RULES)
- `services/annie-voice/kokoro_tts.py` — TTS service (voice blending target)
- `services/annie-voice/bot.py` — Pipeline setup (voice blend env var target)
- `~/.claude/plans/binary-wibbling-cake.md` — Full plan with all 7 steps

## Discovery: Stale SOUL.md on Titan
The old SOUL.md on Titan was only 138 bytes with wrong content ("Propose creating a promise-tracking dashboard..."). Annie had been running entirely on the 400-char fallback in prompt_builder.py. Now upgraded to 4021-char SOUL + 2958-char STYLE. This is a major personality upgrade — first call will be noticeably different.
