Guide

Add dialogue

Optional. Planning never depends on it. The talk lane is a mouth with the brain's memory: whatever model phrases the line is handed what the character actually remembers, and anything it invents is rejected before it is spoken.

Point your talk UI at the lane

lw dev starts it on localhost:8094.

POST /start   { "name": "Hulda", "persona": "..." }            -> { "session_id": "..." }
POST /turn    { "session_id": "...", "player_input": "who stole from you?" }

/turn streams server-sent events; the line arrives in response_generated.text, with the journal entries it cited in cites.

The lane does not take orders

A sentence sent to /turn is answered in words and never moves her: "follow me" typed into a talk box gets a reply, not a follower. Orders go to the command lane, POST /v1/command, which reads no language model at all. If one text box serves both, your UI decides which lane each sentence goes to; Give orders has the split.

Pick a model, or none

LW_SPEECH_BACKENDwhat it uses
stubno model: reads the cited memory back in plain sentences (the default without a key)
anthropicANTHROPIC_API_KEY, your key, your bill
openaiany OpenAI-style endpoint at LW_SPEECH_URL: a local model, vLLM, a hosted one

The brief is the same for all of them: the cited journal entries, what she is doing right now and why, her dials, this level's facts, and the conversation so far (first two turns, last twelve, restart-safe).

One other lane can take a key of yours, and it is optional too: a model for the moments the reflex head is torn, When the brain is unsure.

What this level lets them say

"speech": { "level_facts": ["the mine flooded last spring and three men were lost"],
            "names": ["Foreman Garrick"], "places": ["the lower gallery"] },
"characters": { "Old Brenna": { "speech": { "knows": ["the pumps fail every winter"], "voice": "clipped, tired" } } }

A line may refer only to the journal, this level, and this conversation. A name, place or past event outside that is rejected in code and the character goes vague instead. Rejections are logged so you can see which model invents.

What is written back

The player's words go into the journal as events (a threat spoken is a threat). The character's own line is written as her own speech and can never wake the deliberator, so a mouth cannot manufacture a grudge. A promise the player makes is folded into a cited memory when the conversation ends.

Next: When the brain is unsure.