Voice to system prompt
What "voice" means, how it compiles into the exact prompt the agent receives, and how to preview it.
This page describes an earlier design of ListeningKit, built on an in-browser demo, so parts of it do not match the app that runs today. For what works now, read the Guide.
Voice to system prompt
"Voice" is not a vibe string. It is structured language instruction with exactly one consumer: buildBrandSystemPrompt(), whose output becomes the agent's instructions (and, in the mock, the rules draftReply() follows).
The model
voice: {
tone: 'Friendly, plain-spoken local pro' // one line, human-readable
formality: 'casual' | 'professional' | 'formal'
dos: ['Lead with the fix, not the apology']
donts: ['Never quote a price in a reply']
examples: [{ situation: 'question', reply: '…' }] // 2–3 gold replies
}toneis the headline a human reads on the Brand tab.formalityis the machine-readable dial: greeting style, contraction use, sign-off length.dos/dontsare hard rules — short imperative lines, each independently enforceable.examplesare few-shot gold replies keyed by post type (question,complaint,praise). The agent mimics these before it improvises.
The compiler
buildBrandSystemPrompt(brand) is deterministic and versioned (PROMPT_VERSION = 1):
- Identity line — who the agent speaks as.
- Tone + formality rules.
- Offerings list with one-line details.
- Dos / don'ts, verbatim.
- Gold examples, in full.
Every draft records the prompt version that produced it, so a voice edit never silently rewrites history — drafts stamped v1 stay v1.
Preview
The Brand tab previews the compiled prompt per channel through the Test it simulator: type an inbound message, get the exact raw reply. What you see there is what the agent will send. If the preview reads wrong, the channel snippets are wrong — fix the snippets, not the drafts.
Channels and memory
Global voice is only half the story. Each channel (facebook, x, reddit) carries its own ChannelProfile — casual vs standard style, raw texting snippets, and (on Facebook) the triage flow the agent pushes for first. The memory bank (memory.rules) compiles into the prompt as working facts the agent must never contradict.
In the mock, draftReply() follows the same rules by hand (sign-off, service-bit, area). When the agent lands, the mock hands over: same prompt in, same voice out.