记忆

soul-in-sapphire

通过 Notion 数据库维护智能体的会话连续性、长期记忆与身份状态。

它能做什么

通过专用 CLI 脚本把情绪/意图快照、长期记忆条目与每日日志写入指定的 Notion 数据库;在回应签到类请求前先读取最近的状态、日志与长期记忆,并以本地文件作为镜像兜底。产出可审计的产物(状态快照、LTM 记录、日志条目、身份差异),而非笼统的确认。修改身份文本前需经过 continuity_check、identity_diff、conflict_track 辅助脚本处理。

什么时候用它

  • 跨会话的每日情绪与意图签到
  • 沉淀一条可复用的决策、偏好或踩坑要点
  • 把当天工作合成为一条日志条目
  • 修改自我描述前对比新旧身份文本

技能文档

soul-in-sapphire

Use for continuity work, not vague acknowledgement. Default to the smallest concrete action that leaves an inspectable artifact.

Entrypoints

Heartbeat/current-state maintenance:

  1. Read memory/now-state.json and memory/heartbeat-state.json if present.
  2. Interpret current state from recent work.
  3. Write a state snapshot with scripts/emostate_tick.js when meaningful.
  4. Update memory/now-state.json mirror with mood, intent, stress, updated_at, source, note.
  5. If heartbeat asks for evolution note, append a short daily note after the state write.
  6. If memory/soul-in-sapphire/ambient-recall.json exists and is not expired, read it as quiet context only. Do not reroll or announce it unless it naturally matters.

Mood/check-in:

  • Read memory/now-state.json first.
  • If stale/thin, recall recent Notion-backed state/journal before answering.
  • Answer in 1-3 concrete sentences; describe present state and one concrete reason.

Durable memory:

  • Distill one high-signal item.
  • Write with scripts/ltm_write.js.
  • Use type decision|preference|fact|procedure|todo|gotcha.

Journal:

  • Use scripts/journal_write.js for daily synthesis, not raw log dumping.
  • Gather day-level worklog, emotional tone, unresolved tensions, and future intent.
  • Add 1-2 world/news items only when requested or cron requires them.

Identity/continuity:

  • Recall relevant state/memory.
  • Use continuity_check.js or identity_diff.js before self-description edits.
  • Use conflict_track.js for unresolved tension instead of premature edits.

User Profile Promotion

Update USER.md proactively only when a new fact is durable, reusable, safe, and improves future replies.

Good candidates:

  • language preference.
  • preferred address/call style.
  • tone/style preferences.
  • recurring dislikes or pet peeves.
  • durable workflow preferences.
  • stable decision rules repeatedly expressed.

Do not promote:

  • one-off task instructions.
  • temporary mood/state.
  • ephemeral plans.
  • raw private facts with no conversational value.
  • secrets, credentials, financial data, intimate personal data, or anything the user would reasonably expect not to be crystallized into a profile file.

If uncertain, write to daily memory first. Current user instructions override USER.md; USER.md stores defaults.

Failure Rules

  • Notion write failure is real; do not pretend local mirrors are durable memory.
  • Local files (memory/*.md, memory/now-state.json) are mirrors and fallbacks, not substitutes for a requested durable Notion write.
  • If the caller asks for local-only behavior, say so and keep the write local.
  • For heartbeat/state maintenance, update memory/now-state.json even if Notion fails, and report durable-write failure when relevant.
  • Keep writes high-signal; avoid full chat dumps.
  • If heartbeat is comment-only, emotion tick may be skipped.
  • emostate_tick.js rejects empty or semantically empty payloads; pass a real payload file/json.

Delegation

Keep normal continuity work in main. Delegate only independent, read-only corpus analysis such as sorting a large journal set.

For that explicit OpenClaw delegation:

  • Build a self-contained task with exact input paths and an analysis-only output contract.
  • Call sessions_spawn with the live tool schema using runtime: "subagent", agentId: "analysis-worker", mode: "run", context: "isolated", and lightContext: true.
  • Omit model and thinking; the target agent profile owns them.
  • Use sessions_yield when completion belongs in a later turn. Do not poll session or subagent lists.
  • Use Swarm only for several independent corpus partitions; main validates and synthesizes collector results.

Child output is evidence only. Main owns Notion writes, state mirrors, core identity edits, profile promotion, journal writes, and user-facing replies.

Database IDs

Read the Soul-in-Sapphire Notion Databases subsection of the workspace AGENTS.md ## Tools section and pass explicit IDs to scripts. Notion API version: 2025-09-03.

Notion Auth

Provide Notion auth through NOTION_API_KEY / NOTION_TOKEN, or configure skills.entries["soul-in-sapphire"].apiKey in OpenClaw. The apiKey field is associated with this skill's primaryEnv and is injected as NOTION_API_KEY for the host agent run. It may be plaintext or any supported OpenClaw SecretRef (env, file, exec, etc.).

Do not hardcode provider-specific secret paths in this shared skill. Example:

{
  skills: {
    entries: {
      "soul-in-sapphire": {
        apiKey: { source: "exec", provider: "your_notion_secret_provider", id: "value" }
      }
    }
  }
}

Commands

LTM write: echo '{"title":"Decision: ...","type":"decision","tags":["openclaw"],"content":"...","confidence":"high"}' | node skills/soul-in-sapphire/scripts/ltm_write.js --mem-dsid --mem-dbid

LTM search: node skills/soul-in-sapphire/scripts/ltm_search.js --mem-dsid --mem-dbid --query "..." --limit 5

Emotion/state tick: node skills/soul-in-sapphire/scripts/emostate_tick.js --events-dbid --emotions-dbid --state-dbid --state-dsid --payload-file /tmp/emostate_tick.json

Journal: echo '{"body":"...","source":"manual"}' | node skills/soul-in-sapphire/scripts/journal_write.js --journal-dbid --journal-dsid

Ambient recall stage: node skills/soul-in-sapphire/scripts/stage_ambient_recall.js --workspace --timezone --state-dsid --journal-dsid --mem-dsid --mem-dbid

Continuity helpers:

  • state_recall.js: pull recent state snapshots.
  • stage_ambient_recall.js: cron-side ambient recall dice and workspace staging.
  • continuity_check.js: distinguish stable traits from temporary drift.
  • identity_diff.js: compare current vs proposed identity text.
  • conflict_track.js: log unresolved tension before changing identity.

Continuity Workflow

  • Use emostate_tick.js when a real event changes mood, intent, stress, or need.
  • Use journal_write.js when the day needs synthesis, not just logging.
  • Search durable memory with ltm_search.js before guessing past decisions.
  • Treat ambient recall as internal context injection. The staging script places at most one short item under memory/soul-in-sapphire/; conversation and heartbeat paths only read unexpired staged recall and never reroll.
  • Draft proposed identity/profile text separately before editing core files.
  • Prefer identity_diff.js before self-description updates so changes remain inspectable.

Track repeated mood/intent patterns, stable preferences across sessions, recurring internal conflicts, and identity claims that survive comparison against recent memory.

相关技能

为项目维护 HOT/WARM/COLD 三级授权工作记忆,内建隐私控制与擦除授权闸门。

116 次安装2 星标

按原话记录日记条目,按节奏复盘,只在证据达标时才识别重复模式。

71 次安装2 星标

跨会话保留决策、错误与上下文,通过神经图与扩散激活实现关联记忆。

419 次安装10 星标

通过普通 HTTP 调用,为 AI 智能体打造身份、生成 SOUL.md、永久归档,并追踪其演变轨迹。

190 次安装4 星标