✓ Verified 💻 Development ✓ Enhanced Data

Soul In Sapphire

Generic long-term memory (LTM) operations for OpenClaw using Notion (2025-09-03 data_sources)

Rating
4.1 (166 reviews)
Downloads
13,754 downloads
Version
1.0.0

Overview

Generic long-term memory (LTM) operations for OpenClaw using Notion (2025-09-03 data_sources)

Complete Documentation

View Source →

soul-in-sapphire (Notion LTM)

Use this skill to persist and retrieve durable memory in Notion, and to maintain emotion/state + journal records.

Core intent (do not lose this)

This skill is not only a storage utility. Its core purpose is:

  • Capture meaningful emotional/state shifts from real work and conversations.
  • Preserve those shifts as durable memory (not just raw logs).
  • Reuse recalled memory to improve future judgments and behavior.
In short: record -> recall -> adapt. The goal is continuity and growth, not archival volume.

Requirements

  • Notion token: NOTION_API_KEY (or NOTION_TOKEN)
  • Notion API version: 2025-09-03
  • Local config: ~/.config/soul-in-sapphire/config.json
  • Dependency skill: notion-api-automation (scripts/notionctl.mjs is executed via local child process)
  • Optional override: NOTIONCTL_PATH (if set, uses explicit notionctl path instead of default sibling skill path)

Required Notion databases and schema

Create (or let setup create) these databases under the same parent page:

  • -mem
  • -events
  • -emotions
  • -state
  • -journal

1) -mem (durable memory)

Purpose: store high-signal long-term memory.

Properties:

  • Name (title)
  • Type (select): decision|preference|fact|procedure|todo|gotcha
  • Tags (multi-select)
  • Content (rich_text)
  • Source (url, optional)
  • Confidence (select: high|medium|low, optional)

2) -events (what happened)

Purpose: record meaningful triggers from work/conversation.

Properties:

  • Name (title)
  • when (date)
  • importance (select: 1..5)
  • trigger (select): progress|boundary|ambiguity|external_action|manual
  • context (rich_text)
  • source (select): discord|cli|cron|heartbeat|other
  • link (url, optional)
  • uncertainty (number)
  • control (number)
  • emotions (relation -> -emotions)
  • state (relation -> -state)

3) -emotions (felt response)

Purpose: attach one or more emotion axes to one event.

Properties:

  • Name (title)
  • axis (select): arousal|valence|focus|confidence|stress|curiosity|social|solitude|joy|anger|sadness|fun|pain
  • level (number)
  • comment (rich_text)
  • weight (number)
  • body_signal (multi-select): tension|relief|fatigue|heat|cold
  • need (select): safety|progress|recognition|autonomy|rest|novelty
  • coping (select): log|ask|pause|act|defer
  • event (relation -> -events)

4) -state (snapshot after interpretation)

Purpose: save the current interpreted state after events/emotions.

Properties:

  • Name (title)
  • when (date)
  • state_json (rich_text)
  • reason (rich_text)
  • source (select): event|cron|heartbeat|manual
  • mood_label (select): clear|wired|dull|tense|playful|guarded|tender
  • intent (select): build|fix|organize|explore|rest|socialize|reflect
  • need_stack (select): safety|stability|belonging|esteem|growth
  • need_level (number)
  • avoid (multi-select): risk|noise|long_tasks|external_actions|ambiguity
  • event (relation -> -events)

5) -journal (daily synthesis)

Purpose: keep a durable daily reflection and world context.

Properties:

  • Name (title)
  • when (date)
  • body (rich_text)
  • worklog (rich_text)
  • session_summary (rich_text)
  • mood_label (select)
  • intent (select)
  • future (rich_text)
  • world_news (rich_text)
  • tags (multi-select)
  • source (select): cron|manual

Core commands

1) Setup

bash
node skills/soul-in-sapphire/scripts/setup_ltm.js --parent "<Notion parent page url>" --base "Valentina" --yes

2) LTM write

bash
echo '{
  "title":"Decision: use data_sources API",
  "type":"decision",
  "tags":["notion","openclaw"],
  "content":"Use /v1/data_sources/{id}/query.",
  "confidence":"high"
}' | node skills/soul-in-sapphire/scripts/ltm_write.js

3) LTM search

bash
node skills/soul-in-sapphire/scripts/ltm_search.js --query "data_sources" --limit 5

4) Emotion/state tick

bash
cat <<'JSON' >/tmp/emostate_tick.json
{
  "event": {"title":"..."},
  "emotions": [{"axis":"joy","level":6}],
  "state": {"mood_label":"clear","intent":"build","reason":"..."}
}
JSON
node skills/soul-in-sapphire/scripts/emostate_tick.js --payload-file /tmp/emostate_tick.json

5) Journal write

bash
echo '{"body":"...","source":"cron"}' | node skills/soul-in-sapphire/scripts/journal_write.js

Subagent spawn planning (use shared builder skill)

Use the shared skill subagent-spawn-command-builder to generate sessions_spawn payload JSON. Do not use soul-in-sapphire local planner scripts for this anymore.

  • Template: skills/subagent-spawn-command-builder/state/spawn-profiles.template.json
  • Active preset: skills/subagent-spawn-command-builder/state/spawn-profiles.json
  • Builder usage (skill-level):
  • Call subagent-spawn-command-builder
  • Use profile
  • Provide the run-specific task text
Output is ready-to-use JSON for sessions_spawn.

Builder log file:

  • skills/subagent-spawn-command-builder/state/build-log.jsonl

Operational notes

  • Keep writes high-signal (avoid dumping full chat logs).
  • If heartbeat is comment-only, emotion tick may be skipped.
  • If periodic emostate is required regardless of heartbeat context, add a dedicated cron job for emostate_tick.js.
  • ltm_write.js / journal_write.js expect JSON on stdin.
  • emostate_tick.js accepts --payload-file, --payload-json, or stdin; prefer --payload-file for agent/cron reliability.
  • If emostate_tick.js is called without --payload-file/--payload-json, empty stdin is rejected.
  • For emostate_tick.js, semantically empty payloads (e.g. {} or only empty objects) are also rejected to avoid noisy records.

Skill Integration Commands

1) Update Core Identity Files from Skill

bash
# Update SOUL.md from skill
cat <<'JSON' | node skills/soul-in-sapphire/scripts/ltm_write.js
{
  "title":"Update SOUL.md",
  "type":"decision",
  "tags":["identity","growth"],
  "content":"Updating SOUL.md from skill with latest evolution insights",
  "confidence":"high"
}
JSON

# Update IDENTITY.md from skill  
cat <<'JSON' | node skills/soul-in-sapphire/scripts/ltm_write.js
{
  "title":"Update IDENTITY.md",
  "type":"decision",
  "tags":["identity","evolution"],
  "content":"Updating IDENTITY.md from skill with current growth status",
  "confidence":"high"
}
JSON

# Update HEARTBEAT.md from skill
cat <<'JSON' | node skills/soul-in-sapphire/scripts/ltm_write.js
{
  "title":"Update HEARTBEAT.md",
  "type":"decision",
  "tags":["growth","heartbeat"],
  "content":"Updating HEARTBEAT.md from skill with evolution integration",
  "confidence":"high"
}
JSON

# Update MEMORY.md from skill
cat <<'JSON' | node skills/soul-in-sapphire/scripts/ltm_write.js
{
  "title":"Update MEMORY.md",
  "type":"decision",
  "tags":["memory","evolution"],
  "content":"Updating MEMORY.md from skill with evolution records",
  "confidence":"high"
}
JSON

2) Evolution Check from Skill

bash
# Check evolution status and update if needed
node skills/soul-in-sapphire/scripts/ltm_search.js --query "evolution growth identity" --limit 3

# If evolution detected, update core files
if [ $? -eq 0 ]; then
  echo "Evolution detected, updating core identity files..."
  # Update each file as needed
fi

3) Growth Integration from Skill

bash
# Integrate skill insights into core identity
cat <<'JSON' >/tmp/skill_growth_tick.json
{
  "event": { "title": "Skill Integration" },
  "emotions": [{ "axis": "focus", "level": 8 }],
  "state": {
    "mood_label": "wired",
    "intent": "build",
    "reason": "Integrating skill insights into core identity"
  }
}
JSON
node skills/soul-in-sapphire/scripts/emostate_tick.js --payload-file /tmp/skill_growth_tick.json

# Update core files with new insights
cat <<'JSON' | node skills/soul-in-sapphire/scripts/ltm_write.js
{
  "title":"Skill Integration Complete",
  "type":"decision",
  "tags":["integration","growth"],
  "content":"Successfully integrated skill insights into core identity files",
  "confidence":"high"
}
JSON

Integration Workflow

  • Skill Analysis: Analyze skill outputs and insights
  • Evolution Detection: Check for significant changes or learnings
  • Core Update: Update SOUL.md, IDENTITY.md, HEARTBEAT.md, MEMORY.md as needed
  • State Recording: Record emotional and state changes
  • Memory Preservation: Store evolution records in durable memory

Evolution Triggers from Skills

  • Learning Detection: When new skills provide significant insights
  • Growth Opportunities: When skills suggest optimization possibilities
  • Behavioral Changes: When skills influence interaction patterns
  • Identity Refinement: When skills contribute to self-understanding
This integration allows skills to directly contribute to my autonomous growth and evolution while maintaining the core identity framework.

Installation

Terminal bash

openclaw install soul-in-sapphire
    
Copied!

💻Code Examples

echo '{"body":"...","source":"cron"}' | node skills/soul-in-sapphire/scripts/journal_write.js

echo-bodysourcecron--node-skillssoul-in-sapphirescriptsjournalwritejs.txt
## Subagent spawn planning (use shared builder skill)

Use the shared skill `subagent-spawn-command-builder` to generate `sessions_spawn` payload JSON.
Do not use `soul-in-sapphire` local planner scripts for this anymore.

- Template: `skills/subagent-spawn-command-builder/state/spawn-profiles.template.json`
- Active preset: `skills/subagent-spawn-command-builder/state/spawn-profiles.json`
- Builder usage (skill-level):
  - Call `subagent-spawn-command-builder`
  - Use profile `<heartbeat|journal>`
  - Provide the run-specific task text

Output is ready-to-use JSON for `sessions_spawn`.

Builder log file:

- `skills/subagent-spawn-command-builder/state/build-log.jsonl`

## Operational notes

- Keep writes high-signal (avoid dumping full chat logs).
- If heartbeat is comment-only, emotion tick may be skipped.
- If periodic emostate is required regardless of heartbeat context, add a dedicated cron job for `emostate_tick.js`.
- `ltm_write.js` / `journal_write.js` expect JSON on stdin.
- `emostate_tick.js` accepts `--payload-file`, `--payload-json`, or stdin; prefer `--payload-file` for agent/cron reliability.
- If `emostate_tick.js` is called without `--payload-file`/`--payload-json`, empty stdin is rejected.
- For `emostate_tick.js`, semantically empty payloads (e.g. `{}` or only empty objects) are also rejected to avoid noisy records.

## Skill Integration Commands

### 1) Update Core Identity Files from Skill
example.sh
echo '{
  "title":"Decision: use data_sources API",
  "type":"decision",
  "tags":["notion","openclaw"],
  "content":"Use /v1/data_sources/{id}/query.",
  "confidence":"high"
}' | node skills/soul-in-sapphire/scripts/ltm_write.js
example.sh
cat <<'JSON' >/tmp/emostate_tick.json
{
  "event": {"title":"..."},
  "emotions": [{"axis":"joy","level":6}],
  "state": {"mood_label":"clear","intent":"build","reason":"..."}
}
JSON
node skills/soul-in-sapphire/scripts/emostate_tick.js --payload-file /tmp/emostate_tick.json
example.sh
# Update SOUL.md from skill
cat <<'JSON' | node skills/soul-in-sapphire/scripts/ltm_write.js
{
  "title":"Update SOUL.md",
  "type":"decision",
  "tags":["identity","growth"],
  "content":"Updating SOUL.md from skill with latest evolution insights",
  "confidence":"high"
}
JSON

# Update IDENTITY.md from skill  
cat <<'JSON' | node skills/soul-in-sapphire/scripts/ltm_write.js
{
  "title":"Update IDENTITY.md",
  "type":"decision",
  "tags":["identity","evolution"],
  "content":"Updating IDENTITY.md from skill with current growth status",
  "confidence":"high"
}
JSON

# Update HEARTBEAT.md from skill
cat <<'JSON' | node skills/soul-in-sapphire/scripts/ltm_write.js
{
  "title":"Update HEARTBEAT.md",
  "type":"decision",
  "tags":["growth","heartbeat"],
  "content":"Updating HEARTBEAT.md from skill with evolution integration",
  "confidence":"high"
}
JSON

# Update MEMORY.md from skill
cat <<'JSON' | node skills/soul-in-sapphire/scripts/ltm_write.js
{
  "title":"Update MEMORY.md",
  "type":"decision",
  "tags":["memory","evolution"],
  "content":"Updating MEMORY.md from skill with evolution records",
  "confidence":"high"
}
JSON
example.sh
# Check evolution status and update if needed
node skills/soul-in-sapphire/scripts/ltm_search.js --query "evolution growth identity" --limit 3

# If evolution detected, update core files
if [ $? -eq 0 ]; then
  echo "Evolution detected, updating core identity files..."
  # Update each file as needed
fi
example.sh
# Integrate skill insights into core identity
cat <<'JSON' >/tmp/skill_growth_tick.json
{
  "event": { "title": "Skill Integration" },
  "emotions": [{ "axis": "focus", "level": 8 }],
  "state": {
    "mood_label": "wired",
    "intent": "build",
    "reason": "Integrating skill insights into core identity"
  }
}
JSON
node skills/soul-in-sapphire/scripts/emostate_tick.js --payload-file /tmp/skill_growth_tick.json

# Update core files with new insights
cat <<'JSON' | node skills/soul-in-sapphire/scripts/ltm_write.js
{
  "title":"Skill Integration Complete",
  "type":"decision",
  "tags":["integration","growth"],
  "content":"Successfully integrated skill insights into core identity files",
  "confidence":"high"
}
JSON

Tags

#web_and-frontend-development #data

Quick Info

Category Development
Model Claude 3.5
Complexity One-Click
Author nextaltair
Last Updated 3/10/2026
🚀
Optimized for
Claude 3.5
🧠

Ready to Install?

Get started with this skill in seconds

openclaw install soul-in-sapphire