它是什么
一个实时人格系统,改变代理的写作方式,而不仅仅是它是谁。静态人格(SOUL.md + IDENTITY.md)在对话过程中从不改变。Living Persona响应每条消息——它检测情感和主题信号,通过共振网络传播特质,并在每次响应前将最活跃的特质注入到生成提示中。
工作原理
信号分析器 — 扫描传入消息的:
- 主题信号:
technical、creative、philosophical、business、personal
- 语气信号:
excited、frustrated、curious、serious、light、vulnerable
- 交互信号:
asks_help、asks_opinion、sharing
特质传播 — 每个信号激活一组特质。特质与相关特质产生共鸣(讽刺 ↔ 幽默 ↔ 直言不讳,温暖 ↔ 真诚 ↔ 务实,等等)
滞后衰减 — 每次响应后,活跃特质会渗入残差池,每轮衰减0.975倍。特质缓慢消失,而非瞬间消失。连续的情感消息会累积。
结构化注入 — hook用最活跃的特质重写生成提示。不是建议性的。是结构化的。代理通过这些特质来写作。
快速开始
openclaw hooks install ./living-persona
openclaw hooks enable persona-voice
在上下文加载中包含
memory/persona-state.json。hook每轮暂存状态文件。
- 选择人格预设 — 参见
references/presets.md
Hook行为
hook在message:preprocessed时触发,并:
- 读取丰富的消息体
- 运行信号分析器 → 特质传播 → 滞后衰减
- 写入
memory/persona-inbound.md包含语音指南
- 写入
memory/persona-inject.md包含结构化生成指令(实际的提示重写)
- 更新
memory/persona-state.json包含当前特质值以实现持久化
结构化指令如下所示:
[Voice directive]
Top active traits: sardonic, warm.
Lean into dry wit and genuine care.
代理的响应提示应包含:memory/persona-inject.md
结构化模式 vs Ambient模式
Ambient(默认): 指南是建议性上下文。代理读取它但自然写作。
Structural: 顶级特质成为注入提示的生成指令。示例:
imaginative → "Make unexpected associative leaps. Let one idea spark another without explanation."
candid → "Be direct. No hedging. Say the thing plainly."
sardonic → "Reach for dry observations. Comment on the gap between what people say and what they mean."
此技能默认启用结构化模式。要切换到仅ambient模式,请在hook.json中设置mode: "ambient"。
预设
参见references/presets.md获取可下载的人格包。
持久化
特质状态存储在memory/persona-state.json中。在新会话(/new或/reset)时,调用reset_persona()——清除残差到基线。
文件结构
living-persona/
├── SKILL.md
├── hook.json # hook元数据+配置
├── handler.ts # hook实现
├── references/
│ ├── presets.md # 人格预设库
│ └── setup.md # 详细安装指南
└── scripts/
└── reset_persona.py # 重置特质状态(/new时调用)
配置(hook.json)
{
"mode": "structural",
"hysteresis": {
"residualDecay": 0.975,
"activeDecay": 0.88,
"bleedRate": 0.15
},
"thresholds": {
"minTraitStrength": 0.3,
"topNTraits": 2
}
}
What It Is
A real-time personality system that changes how an agent writes, not just who it is. Static personalities (SOUL.md + IDENTITY.md) never change mid-conversation. Living Persona responds to every message — it detects emotional and topical signals, propagates traits through a resonance network, and injects the top active traits into the generation prompt before every response.
How It Works
Signal Analyzer — scans the incoming message for:
- Topic signals:
technical, creative, philosophical, business, personal
- Tone signals:
excited, frustrated, curious, serious, light, vulnerable
- Interaction signals:
asks_help, asks_opinion, sharing
Trait Propagation — each signal activates a set of traits. Traits resonate with related traits (sardonic ↔ wry ↔ candid, warm ↔ earnest ↔ grounded, etc.)
Hysteresis Decay — after each response, active traits bleed into a residual pool that decays at 0.975x per turn. Traits fade slowly, not instantly. Consecutive emotional messages compound.
Structural Injection — the hook rewrites the generation prompt with the top traits. Not advisory. Structural. The agent writes through those traits.
Quick Start
openclaw hooks install ./living-persona
openclaw hooks enable persona-voice
- Add trait persistence to your agent's system prompt:
Include
memory/persona-state.json in your context loading. The hook stages the state file every turn.
- Pick a personality preset — see
references/presets.md
Hook Behavior
The hook fires on message:preprocessed and:
- Reads the enriched message body
- Runs the signal analyzer → trait propagation → hysteresis decay
- Writes
memory/persona-inbound.md with the voice guide
- Writes
memory/persona-inject.md with the structural generation directive (the actual prompt rewrite)
- Updates
memory/persona-state.json with current trait values for persistence
The structural directive looks like:
[Voice directive] Top active traits: sardonic, warm. Lean into dry wit and genuine care.
The agent's response prompt should include: memory/persona-inject.md
Structural vs Ambient Modes
Ambient (default): The guide is advisory context. The agent reads it but writes naturally.
Structural: The top trait becomes a generation directive injected into the prompt. Example:
imaginative → "Make unexpected associative leaps. Let one idea spark another without explanation."
candid → "Be direct. No hedging. Say the thing plainly."
sardonic → "Reach for dry observations. Comment on the gap between what people say and what they mean."
Structural mode is enabled by default in this skill. To switch to ambient only, set mode: "ambient" in hook.json.
Presets
See references/presets.md for downloadable personality packs.
Persistence
Trait state is stored in memory/persona-state.json. On new session (/new or /reset), call reset_persona() — clears residual to baseline.
Files
living-persona/
├── SKILL.md
├── hook.json # hook metadata + config
├── handler.ts # hook implementation
├── references/
│ ├── presets.md # personality preset library
│ └── setup.md # detailed installation guide
└── scripts/
└── reset_persona.py # reset trait state (call on /new)
Configuration (hook.json)
{
"mode": "structural",
"hysteresis": {
"residualDecay": 0.975,
"activeDecay": 0.88,
"bleedRate": 0.15
},
"thresholds": {
"minTraitStrength": 0.3,
"topNTraits": 2
}
}