self-evolving-memory
Orchestrate the OpenClaw memory system so it actually runs reliably in practice. Use when the task involves capturing user preferences, current task state, c...
HAL-9909
@hal-9909
Install
$ openclaw skills install @hal-9909/self-evolving-memoryMemory Orchestrator
This skill is the workflow layer for the memory system. It does not replace memory storage. It decides what to capture, where to route it, when to promote it, and when to harden it.
Source of truth
Use this order:
MEMORY.md+memory/= formal memory ledgerSESSION-STATE.md= current task state only.learnings/= auxiliary scratch/noise layer only- vector recall = derived index, never source of truth
Never create a second formal ledger.
Memory layers
1) Hot state
Use SESSION-STATE.md for:
- current task
- current blocker
- next actions
- recent decision needed for immediate continuity
- handoff / anti-compaction notes
Do not store durable history here.
2) Daily working memory
Use memory/YYYY-MM-DD.md for:
- user corrections
- task outcomes
- debugging notes
- temporary conclusions
- short self-reflection after non-trivial work
- observations that are not yet stable enough for long-term memory
3) Structured long-term memory
Route stable items to:
memory/preferences.md— user preferences / communication style / stable likes-dislikesmemory/system.md— stable environment facts / endpoints / toolchain constraints / pathsmemory/projects.md— long-running project context / decisions / statusmemory/MEMORY.md— cross-cutting long-term stable conclusions
4) Root summary
Use root MEMORY.md only for the few high-value facts worth automatic injection every session.
Keep it short.
5) Enforcement layer
If a recurring problem should change future behavior, also update one or more of:
SOUL.mdAGENTS.mdTOOLS.md- relevant
SKILL.md - relevant script/hook
Embedding / vector recall setup
This skill supports semantic memory search via memory_search. Multiple embedding
backends are supported. See references/embedding-setup.md for full configuration:
- Ollama (local, recommended for privacy):
nomic-embed-text,mxbai-embed-large, etc. - OpenAI Embeddings:
text-embedding-3-small/text-embedding-3-large - OpenAI-compatible APIs: LocalAI, LM Studio, third-party providers
- No embedding: Rule-based routing still works without vector recall
Quick config example (Ollama, local):
{
"memorySearch": {
"enabled": true,
"provider": "ollama",
"model": "nomic-embed-text"
}
}
Quick config example (OpenAI):
{
"memorySearch": {
"enabled": true,
"provider": "openai",
"model": "text-embedding-3-small",
"remote": {
"baseUrl": "https://api.openai.com/v1",
"apiKey": "YOUR_OPENAI_API_KEY"
}
}
}
First-run setup check
When this skill is triggered for the first time, or when the user asks to "set up" / "initialize" / "check" the memory system, run this setup check:
Auto-detect missing files
Check the current workspace for these files. If any are missing, create them from templates OR tell the user exactly which command to run:
Required files:
SESSION-STATE.md → templates/SESSION-STATE.md
MEMORY.md → templates/MEMORY.md
HEARTBEAT.md → templates/HEARTBEAT.md
memory/preferences.md → templates/memory/preferences.md
memory/system.md → templates/memory/system.md
memory/projects.md → templates/memory/projects.md
memory/MEMORY.md → templates/memory/MEMORY.md
Recommended agent files (prompt user to create if missing):
SOUL.md — add memory discipline section (see references/setup-checklist.md Step 3)
AGENTS.md — add memory closeout protocol
TOOLS.md — add memory-related tool discipline
Action:
- If files are missing: create them automatically, then confirm to the user what was created.
- If agent files (SOUL.md etc.) are missing: warn the user and point to
references/setup-checklist.md. - If embedding is not configured: remind user to check
references/embedding-setup.md.
One-command setup
Tell the user they can also run the setup script:
bash scripts/setup.sh [optional-workspace-path]
This will copy all templates and report what's missing.
Runtime protocol
For the concrete operating protocol, read:
references/runtime-protocol.md
Use that reference when the memory system needs to operate reliably over time, not just route one memory item.
For setup and initialization:
references/setup-checklist.md— step-by-step first-time setupscripts/setup.sh— automated setup script
For embedding setup options, read:
references/embedding-setup.md
Routing rules
A. User says "remember this" / gives a durable preference
- Write to
memory/YYYY-MM-DD.md - If clearly stable, also write to
memory/preferences.mdor other structured file - If it must shape every session, also reflect it in root
MEMORY.mdor enforcement files
B. Current task state changes
Before or during longer work, update SESSION-STATE.md with:
- current task
- key context
- pending actions
- blockers
Use hot state for continuity, not archiving.
C. Error / correction / better approach discovered
- Log to
memory/YYYY-MM-DD.md - If it is noisy or needs raw staging, optionally also log to
.learnings/ - If recurring or broadly applicable, promote to structured memory and/or enforcement layer
D. Stable system fact discovered
- Daily first
- Then
memory/system.md - Only put in root
MEMORY.mdif it is worth automatic injection every session
E. Project decision / project context
- Daily first
- Then
memory/projects.md - If very stable and cross-project, also
memory/MEMORY.md
Promotion / hardening state machine
Use this mental model:
observed→ captured inSESSION-STATE.mdor dailycurated→ moved into structured long-term memoryhardened→ promoted into SOUL / AGENTS / TOOLS / skill / scriptstable→ repeatedly validated, remains in long-term memory until marked stale
Rule:
- If the same issue appears 2+ times, or the user is clearly annoyed, do not stop at memory. Harden it.
Hygiene workflow
When asked to clean memory, adapt old memory, or audit the system:
- Check whether old daily files contain content that already lives in structured memory
- Add "converged/migrated/stale" style notes when appropriate
- Ensure root
MEMORY.mdremains summary-only - Check
SESSION-STATE.mdis not stale or pretending to be long-term memory - Check
.learnings/is not drifting into primary-ledger status - Check recall/reference docs still point to the new architecture
When NOT to over-store
Do not promote every temporary detail. Good memory systems are selective. If uncertain, prefer:
SESSION-STATE.mdfor immediate continuitymemory/YYYY-MM-DD.mdfor tentative notes- structured long-term only after stability is clear
Trigger phrases / situations
Use this skill when the user asks or implies any of:
- remember / save memory / note this down
- adapt old memory / migrate memory / converge old memory
- memory cleanup / memory hygiene / memory system optimization
- current task state / handoff / anti-compaction continuity
- recurring issue / repeated annoyance / make it stick
- where should this memory go?
- should this be promoted to SOUL / AGENTS / TOOLS?
Expected output style
Keep replies short. Actually perform the routing/editing work. Do not just say memory was saved — save it. Do not ask for permission again when the memory action is already clear.
Reliability requirements
For non-trivial memory operations, do not stop at classification. Make sure the system actually advances:
- update
SESSION-STATE.mdwhen current continuity matters - update
memory/YYYY-MM-DD.mdfor daily capture - promote stable items to structured long-term memory
- harden recurring issues into the enforcement layer
- use the closeout protocol from
references/runtime-protocol.mdwhen a task or phase ends
If any of these are skipped, the memory system is only partially operating.
Top skills in this category
Self-Improving + Proactive Agent
@ivangdavilaSelf-reflection + Self-criticism + Self-learning + Self-organizing memory. Agent evaluates its own work, catches mistakes, and improves permanently. Use when...
ontology
@oswalpalashTyped knowledge graph for structured agent memory and composable skills. Use when creating/querying entities (Person, Project, Task, Event, Document), linkin...
Humanizer
@biostartechnologyRemove signs of AI-generated writing from text. Use when editing or reviewing text to make it sound more natural and human-written. Based on Wikipedia's comprehensive "Signs of AI writing" guide. Detects and fixes patterns including: inflated symbolism, promotional language, superficial -ing analyses, vague attributions, em dash overuse, rule of three, AI vocabulary words, negative parallelisms, and excessive conjunctive phrases.
Obsidian
@steipeteWork with Obsidian vaults (plain Markdown notes) and automate via obsidian-cli.
YouTube Watcher
@michaelgatharaFetch and read transcripts from YouTube videos. Use when you need to summarize a video, answer questions about its content, or extract information from it.