Install
openclaw skills install memory-management-liteA practical memory management system for OpenClaw: importance scoring, time-decay cleanup, write triggers, hybrid retrieval, and daily maintenance workflow.
openclaw skills install memory-management-liteThis skill provides a unified workflow to write, retrieve, and maintain long-term / topic-based / short-term memories across OpenClaw sessions.
Use it when you want the agent to consistently remember key preferences/decisions/facts across sessions, while preventing memory bloat via time-decay and daily cleanup.
Assume your workspace root is ~/.openclaw/workspace/:
workspace/
├── MEMORY.md
├── AGENTS.md # optional
├── TOOLS.md # optional
├── HEARTBEAT.md # optional
└── memory/
├── preferences.md
├── decisions.md
├── projects.md
├── contacts.md
├── patterns.md
├── feedback.md
└── YYYY-MM-DD.md
When you are about to write a memory:
5: write to MEMORY.md (core principles, key decisions, core preferences)4: write to MEMORY.md (important rules/lessons repeated multiple times)3: write to memory/YYYY-MM-DD.md (general tasks/conversation worth retrieving)2: write to memory/YYYY-MM-DD.md (temporary/optional records)1: do not record (small talk/meaningless content)Strategy:
Short-term memory relevance decays with time:
Cleanup workflow:
memory/*.md daily logsMEMORY.md or topic files; delete/archive the restWhen the user says:
MEMORY.mdMEMORY.mdmemory/preferences.mdmemory/decisions.mdmemory/projects.mdmemory/contacts.mdmemory/patterns.mdmemory/feedback.mdBefore answering questions about previous work/decisions/dates/people/preferences/tasks:
memory_search with the user querymemory_getUse hybrid retrieval to balance semantic match and keyword precision (vector semantics + FTS terms).
Example:
openclaw memory search "query"
Suggested time: 08:30 (adjust for your timezone).
Goals:
memory/YYYY-MM-DD.md existsMEMORY.md / topic files{
"schedule": { "kind": "cron", "expr": "30 8 * * *", "tz": "Asia/Shanghai" },
"payload": {
"kind": "agentTurn",
"message": "Run the daily memory maintenance workflow: create today's log, review yesterday, migrate worth-keeping content to MEMORY/topic files, then clean logs older than 30 days and output a concise structured report.",
"model": "YOUR_DEFAULT_MODEL",
"timeoutSeconds": 600
}
}
Safety:
Preconditions:
memorySearch is enabledMEMORY.md + memory/ logs)memory-setup: configure persistent memorySearchself-improvement: turn errors/corrections into learnable experiencescron-mastery: cron vs heartbeat time scheduling best practicesclawhub star memory-managementclawhub syncThis is a practical "memory management system" skill for OpenClaw. It provides a unified set of rules to write, retrieve, and maintain long-term / topic-based / short-term memories across sessions.
It turns the following capabilities into a clear workflow:
Use this skill when you need:
Assume your workspace root directory is ~/.openclaw/workspace/. Use the following structure:
workspace/
├── MEMORY.md # long-term memory (core knowledge base; keep maintenance focused)
├── AGENTS.md # agent behavior / calling constraints snippet (optional)
├── TOOLS.md # tools / skill index (optional)
├── HEARTBEAT.md # heartbeat task (optional)
└── memory/
├── preferences.md # user preferences
├── decisions.md # important decisions
├── projects.md # project information
├── contacts.md # contacts
├── patterns.md # best practices / patterns
├── feedback.md # feedback records
└── YYYY-MM-DD.md # daily logs (short-term memory)
You can start with minimal templates. Later maintenance tasks only need to update small blocks or append a few bullet points.
MEMORY.md (example structure):
# MEMORY.md — Long-Term Memory
## About
- User core preferences:
- Important identity / background:
## Active Projects
- Project name: status / key milestones / current risks
## Decisions & Lessons
- Key decisions (why chosen):
- Lessons learned (avoid repeating mistakes):
## Preferences
- Communication style:
- Tool preferences:
- Avoided behaviors:
memory/preferences.md:
# preferences.md
## Communication
- Preference:
## Tools & Workflows
- Common tools:
- Typical workflows:
memory/decisions.md:
# decisions.md
## Key Decisions
- Decision point:
- Background:
- Why this approach:
- Possible future adjustments:
memory/patterns.md:
# patterns.md
## Best Practices
- Pattern name:
- When to use:
- Step-by-step:
- Failure examples (optional):
Rule: when you are about to "write to memory", first score the content (1-5), then decide where to store it.
Suggested mapping:
MEMORY.md
MEMORY.md
memory/YYYY-MM-DD.md
memory/YYYY-MM-DD.md
Suggested write strategy:
Short-term memory retrieval weight decays over time:
Daily maintenance cleanup workflow (recommended):
YYYY-MM-DD.md files under memory/MEMORY.md (or topic files)When the user says the following phrases, immediately start "write evaluation" and persist (after scoring importance):
MEMORY.mdMEMORY.mdmemory/preferences.mdmemory/decisions.mdmemory/projects.mdmemory/contacts.mdmemory/patterns.mdmemory/feedback.mdWhen a user question belongs to these categories, first perform memory retrieval, then answer:
Suggested retrieval chain:
memory_search to search relevant memories by querymemory_get to pull more precise excerpts for quotingSuggested strategy: hybrid retrieval (vector semantics + FTS keywords).
You can configure similar parameters in OpenClaw's memorySearch configuration:
voyage (or your actual vector provider)["memory", "sessions"] (adjust as needed)"hot" (real-time updates; adjust if needed)0.3 (lower = more results)20Manual retrieval example (if your system supports it):
openclaw memory search "query"
Suggested daily execution time: 08:30 (adjust for your timezone).
Maintenance goals:
memory/YYYY-MM-DD.mdpreferences.md / decisions.md / patterns.md / MEMORY.mdMaintenance flow (6-7 steps):
openclaw.json -> openclaw.json.backup-YYYYMMDD.api-keys-backup.env)Backup shell command examples (you can copy into your cron payload):
cp ~/.openclaw/openclaw.json ~/.openclaw/openclaw.json.backup-$(date +%Y%m%d)
ls -t ~/.openclaw/openclaw.json.backup-* | tail -n +4 | xargs -r rm
cp ~/.openclaw/openclaw.json ~/.openclaw/.api-keys-backup.env
In OpenClaw's cron jobs, a recommended pattern is: "isolated session + scheduled trigger + only maintenance tasks".
Example payload (showing the core fields you need to pay attention to: schedule and payload.message; the rest depends on your environment):
{
"schedule": { "kind": "cron", "expr": "30 8 * * *", "tz": "Asia/Shanghai" },
"payload": {
"kind": "agentTurn",
"message": "Run the daily memory maintenance workflow (7 steps): 1) Create memory/YYYY-MM-DD.md (if missing) 2) Review yesterday's memory and extract content worth long-termizing into MEMORY.md or topic files 3) Delete logs older than 30 days (migrate important content before deleting) 4) Optionally back up openclaw.json (keep last 3) 5) Generate a concise structured report with findings and recommendations.\\nRequirement: output must be structured and concise, focusing on maintenance results.",
"model": "YOUR_DEFAULT_MODEL",
"timeoutSeconds": 600
}
}
Notes:
YOUR_DEFAULT_MODEL with your default modelAdd the following snippet to your AGENTS.md (or whichever document constrains agent behavior):
### 🧠 Memory Management Rules (Memory Management Skill)
1) Auto recall:
Before answering questions about previous work/decisions/dates/people/preferences/tasks, run `memory_search` first.
If retrieval is still uncertain, explain in the response that you checked memory but couldn't find enough evidence.
2) Manual write triggers:
When the user says: "remember this" / "save this" / "don't forget" / "permanently save" / "this is an important point" / "write to memory"
First evaluate the importance score (1-5), then write:
- 5-4 points: write to `MEMORY.md`
- 3-2 points: write to `memory/YYYY-MM-DD.md`
- 1 point: do not record
3) Time decay and cleanup:
Daily maintenance will clean logs older than 30 days; before deleting, migrate worth-keeping content to `MEMORY.md` or topic files.
4) Retrieval strategy:
Prefer hybrid retrieval (vector semantics + FTS keywords).
Safety advice:
MEMORY.md when you explicitly need it and it is controllable (long-term storage is more sensitive).Run prerequisites (recommended):
memorySearch enabled (otherwise "retrieval/recall" will not work)MEMORY.md + memory/ log directorymemory-setup: configure persistent memorySearch (vector retrieval foundation)self-improvement: turn errors/corrections into learnable experiencescron-mastery: cron vs heartbeat time scheduling best practicesclawdhub: install/update/publish skillsclawhub star memory-managementclawhub syncThis is a practical "memory management system" skill for OpenClaw. It provides a unified set of rules to write, retrieve, and maintain long-term / topic-based / short-term memories across sessions.
It turns the following capabilities into a clear workflow:
Use this skill when you need:
Assume your workspace root directory is ~/.openclaw/workspace/. Use the following structure:
workspace/
├── MEMORY.md # long-term memory (core knowledge base; keep maintenance focused)
├── AGENTS.md # agent behavior / calling constraints snippet (optional)
├── TOOLS.md # tools / skill index (optional)
├── HEARTBEAT.md # heartbeat task (optional)
└── memory/
├── preferences.md # user preferences
├── decisions.md # important decisions
├── projects.md # project information
├── contacts.md # contacts
├── patterns.md # best practices / patterns
├── feedback.md # feedback records
└── YYYY-MM-DD.md # daily logs (short-term memory)
You can start with minimal templates. Later maintenance tasks only need to update small blocks or append a few bullet points.
MEMORY.md (example structure):
# MEMORY.md — Long-Term Memory
## About
- User core preferences:
- Important identity / background:
## Active Projects
- Project name: status / key milestones / current risks
## Decisions & Lessons
- Key decisions (why chosen):
- Lessons learned (avoid repeating mistakes):
## Preferences
- Communication style:
- Tool preferences:
- Avoided behaviors:
memory/preferences.md:
# preferences.md
## Communication
- Preference:
## Tools & Workflows
- Common tools:
- Typical workflows:
memory/decisions.md:
# decisions.md
## Key Decisions
- Decision point:
- Background:
- Why this approach:
- Possible future adjustments:
memory/patterns.md:
# patterns.md
## Best Practices
- Pattern name:
- When to use:
- Step-by-step:
- Failure examples (optional):
Rule: when you are about to "write to memory", first score the content (1-5), then decide where to store it.
Suggested mapping:
MEMORY.md
MEMORY.md
memory/YYYY-MM-DD.md
memory/YYYY-MM-DD.md
Suggested write strategy:
Short-term memory retrieval weight decays over time:
Daily maintenance cleanup workflow (recommended):
YYYY-MM-DD.md files under memory/MEMORY.md (or topic files)When the user says the following phrases, immediately start "write evaluation" and persist (after scoring importance):
MEMORY.mdMEMORY.mdmemory/preferences.mdmemory/decisions.mdmemory/projects.mdmemory/contacts.mdmemory/patterns.mdmemory/feedback.mdWhen a user question belongs to these categories, first perform memory retrieval, then answer:
Suggested retrieval chain:
memory_search to search relevant memories by querymemory_get to pull more precise excerpts for quotingSuggested strategy: hybrid retrieval (vector semantics + FTS keywords).
You can configure similar parameters in OpenClaw's memorySearch configuration:
voyage (or your actual vector provider)["memory", "sessions"] (adjust as needed)"hot" (real-time updates; adjust if needed)0.3 (lower = more results)20Manual retrieval example (if your system supports it):
openclaw memory search "query"
Suggested daily execution time: 08:30 (adjust for your timezone).
Maintenance goals:
memory/YYYY-MM-DD.mdpreferences.md / decisions.md / patterns.md / MEMORY.mdMaintenance flow (6-7 steps):
openclaw.json -> openclaw.json.backup-YYYYMMDD.api-keys-backup.env)Backup shell command examples (you can copy into your cron payload):
cp ~/.openclaw/openclaw.json ~/.openclaw/openclaw.json.backup-$(date +%Y%m%d)
ls -t ~/.openclaw/openclaw.json.backup-* | tail -n +4 | xargs -r rm
cp ~/.openclaw/openclaw.json ~/.openclaw/.api-keys-backup.env
In OpenClaw's cron jobs, a recommended pattern is: "isolated session + scheduled trigger + only maintenance tasks".
Example payload (showing the core fields you need to pay attention to: schedule and payload.message; the rest depends on your environment):
{
"schedule": { "kind": "cron", "expr": "30 8 * * *", "tz": "Asia/Shanghai" },
"payload": {
"kind": "agentTurn",
"message": "Run the daily memory maintenance workflow (7 steps): 1) Create memory/YYYY-MM-DD.md (if missing) 2) Review yesterday's memory and extract content worth long-termizing into MEMORY.md or topic files 3) Delete logs older than 30 days (migrate important content before deleting) 4) Optionally back up openclaw.json (keep last 3) 5) Generate a concise structured report with findings and recommendations.\\nRequirement: output must be structured and concise, focusing on maintenance results.",
"model": "YOUR_DEFAULT_MODEL",
"timeoutSeconds": 600
}
}
Notes:
YOUR_DEFAULT_MODEL with your default modelAdd the following snippet to your AGENTS.md (or whichever document constrains agent behavior):
### 🧠 Memory Management Rules (Memory Management Skill)
1) Auto recall:
Before answering questions about previous work/decisions/dates/people/preferences/tasks, run `memory_search` first.
If retrieval is still uncertain, explain in the response that you checked memory but couldn't find enough evidence.
2) Manual write triggers:
When the user says: "remember this" / "save this" / "don't forget" / "permanently save" / "this is an important point" / "write to memory"
First evaluate the importance score (1-5), then write:
- 5-4 points: write to `MEMORY.md`
- 3-2 points: write to `memory/YYYY-MM-DD.md`
- 1 point: do not record
3) Time decay and cleanup:
Daily maintenance will clean logs older than 30 days; before deleting, migrate worth-keeping content to `MEMORY.md` or topic files.
4) Retrieval strategy:
Prefer hybrid retrieval (vector semantics + FTS keywords).
Safety advice:
MEMORY.md when you explicitly need it and it is controllable (long-term storage is more sensitive).Run prerequisites (recommended):
memorySearch enabled (otherwise "retrieval/recall" will not work)MEMORY.md + memory/ log directorymemory-setup: configure persistent memorySearch (vector retrieval foundation)self-improvement: turn errors/corrections into learnable experiencescron-mastery: cron vs heartbeat time scheduling best practicesclawdhub: install/update/publish skillsclawhub star memory-managementclawhub sync