Install
openclaw skills install claude-memoryStructured memory system for OpenClaw agents. Provides a 4-type classification (user/feedback/project/reference), layered architecture (MEMORY.md + topics/ + feedback/ + daily notes), write rules, and heartbeat maintenance. Use when setting up a new agent's memory, improving an existing agent's memory system, or answering questions about memory management best practices. Triggers on phrases like "memory system", "memory setup", "记忆系统", "记忆管理", "setup memory", "improve memory", "memory architecture".
openclaw skills install claude-memoryA structured, layered memory architecture for OpenClaw agents. Uses a 4-type classification (user/feedback/project/reference) for organized memory, combined with semantic search and progressive disclosure for token-efficient retrieval.
MEMORY.md (≤10KB, injected every turn via system prompt)
├── High-frequency info directly readable (inline)
├── Pointers to details in topics/
└── 4 sections: user | feedback → feedback.md | project | reference
memory/
├── feedback.md # Corrections AND confirmations from human (MOST IMPORTANT)
├── YYYY-MM-DD.md # Daily raw notes
└── topics/ # Low-frequency large content
├── agent-ids.md
├── known-issues.md
└── ... (domain-specific)
| Type | Purpose | Examples |
|---|---|---|
| user | Human's personal info, preferences, relationships | IDs, timezone, family, privacy rules |
| feedback | Corrections AND confirmations from human | "Check docs first", "That approach was right" |
| project | Work items, tasks, known issues | Active bugs, cron jobs, cleanup history |
| reference | Technical resources, environment | Runtime config, connected services, security events |
Run the init script to create the directory structure and template files:
python scripts/init_memory.py <workspace-path>
This creates:
MEMORY.md with empty section templatesmemory/feedback.md with format guidememory/topics/ directoryAfter running, edit MEMORY.md sections with actual content and update AGENTS.md to include the memory rules from references/agents-rules.md.
memory/feedback.md NOW. Not later, not "I'll remember", NOW.topics/ for depth. If it exceeds 10KB, move lower-frequency content to topics/ — the content is preserved, just relocated.git log is authoritativeMemories are long-term assets, not consumables. They don't expire. But some memories need verification before use:
Each feedback entry follows this structure. Two types: correction (don't do X) and confirmation (keep doing X).
### F###: Rule description (date)
- **Why**: Root cause or context
- **How to apply**: Concrete scenarios
### F###: Confirmed approach description (确认 date)
- **Context**: What was being worked on
- **Why**: What made this approach noteworthy or validated
Memory is an asset, not a consumable. Memories should not be deleted because they're old.
⚠️ Setup requirement: This 4-phase routine MUST be written into
HEARTBEAT.md, NOTAGENTS.md.HEARTBEAT.mdis injected only during heartbeat polls (token-efficient), whileAGENTS.mdis loaded every session (wastes token on every message). Write memory write rules inAGENTS.md, write this maintenance routine inHEARTBEAT.md.
During heartbeat polls, follow this 4-phase care routine:
memory/feedback.md?MEMORY.md or topics/.MEMORY.md and spot-check if they're still accurate.MEMORY.md exceeds 10KB, relocate lower-frequency content to topics/. The content is preserved, just moved to a more appropriate home.> Created: YYYY-MM-DD | Updated: YYYY-MM-DDtopics/. Not a pure index — an agent's memory should feel like a person's, not a database.topics/ to keep MEMORY.md lean.For detailed AGENTS.md rules, see references/agents-rules.md.
For troubleshooting, see references/encoding-notes.md.