Self-Improvement Memory (SIM)
Latest: v1.2.3
Documentation only: Add direct README links to memory templates and release history. Update citation release metadata. Agent instructions, code, operational references, tests, templates, dependencies and configuration are unchanged.
Self-Improvement Memory (SIM)
The harness is everything around the model: config, instruction files such as AGENTS.md or CLAUDE.md, prompts, skills, schedules, plugins, tool servers and the scripts an agent runs. When it breaks, the fix usually lands in the harness, and the reasoning behind it is forgotten by the next session. This memory keeps, for each recurring problem, every change tried, why, what it was expected to fix and what actually happened. Keep the evidence, not only the diagnosis.
Typical triggers: a bot or agent goes silent again, a cron, CI, release or deploy run fails again, an error that was seen before, a question about what was already tried, or a plan to remove or revert a rule, setting or instruction.
Research basis
Based on Self-Improvement Memory Enables Continual Recursive Self-Improvement (Yu et al., 2026); an independent adaptation, not affiliated with or endorsed by the authors or their employers.
Where the memory lives
Use the folder the user or the agent's instructions name. Otherwise use .sim/ at the root of the project or workspace being maintained. When several agents on one machine maintain the same setup, they share one folder in that setup's home, for example ~/.openclaw/sim/ on OpenClaw. Create the folder and its index.md on first use, from references/templates.md.
index.md: one line per note with its status, what it covers, its open predictions and the date of its last attempt.P-NNN-<slug>.md: one note per recurring problem.
Before a change
- Read
index.md, then search the notes for the symptom, component and error text, for examplegrep -ril "<term>" <memory folder>. - If a note explains the current failure, read its attempts. Treat them as evidence, not orders: you may choose a different change.
- Weigh each attempt by how close its setting is to yours. An attempt on the same agent, model and version counts most. After an upgrade, a model change or a move to another machine, re-check an old fix before reusing it.
- Retry a direction that already failed only when new evidence justifies it, and say what the new evidence is.
- Before removing or reverting a rule, setting or instruction, search for it and read the Why of the attempt that added it. Keep what still serves that reason, even if the way it is done has to change.
- If no note fits, create the next
P-NNN-<slug>.mdfrom the note template inreferences/templates.md. - Append the new attempt with What, Why and Predicted filled in, and Observed set to
pending. In Why, write how the component actually behaves, not only what you change: the next problem may show a different symptom. Write the prediction before testing, as checks that can pass or fail.
After validation
Fill Observed with the evidence: the test, run id or log line, and passed/total when a test ran. Sort each predicted check into Fixed, Missed or Open (not yet seen). Evidence must come from a check outside the change itself: a test, a real run, a log or a person's confirmation. An agent saying that its own change works is not evidence.
Set status to resolved only when the evidence shows it and nothing is left open. If the change is later replaced, add a new attempt. In earlier attempts you may only update Kept (for example replaced by the new attempt) and move checks out of Open when the proof arrives; never rewrite or delete anything else.
Every time you create a note or add or complete an attempt, update that note's line in index.md in the same change. A note missing from the index is an incomplete change. When you work on a component, look at the index for open predictions about it: closing them is part of the work.
To check the folder, run python3 scripts/check_sim.py <memory folder> from this skill's folder. It lists notes missing from the index, index lines that disagree with their note, and attempts still pending or open. It only reads.
Rules
- Append only. To merge two problems, add the old id to
aliasesof the surviving note and keep both histories. - When notes move to another machine or project, keep them whole; new attempts name where they ran in Who.
- Link evidence (backups, reports, commits); do not copy logs or other files' contents.
- Never write secrets, tokens or personal data.
- Read on demand with search; do not load the whole memory into context.
- Scope: this skill reads the memory folder and appends to the Markdown notes and the index in it, and its script only reads that folder. The harness change it records is made by your normal workflow, under your normal permissions; beyond search and that script, the skill itself runs no commands, edits no code or config and uses no network.
