memory-management by jzocb/openclaw-memory-management
npx skills add https://github.com/jzocb/openclaw-memory-management --skill memory-management使用三层架构与自动归档功能,高效管理智能体记忆。
```markdown
- [P0] 核心身份条目(永不过期)
- [P1][2026-02-10] 活跃项目(90 天生存时间)
- [P2][2026-02-10] 临时条目(30 天生存时间)
```
2. 设置自动归档定时任务:
```bash
0 4 * * * python3 ~/.openclaw/workspace/scripts/memory-janitor.py
```
3. 将经验教训存储在 memory/lessons/*.jsonl 中:
```json
{"id": "lesson-001", "date": "2026-02-10", "category": "infra", "title": "问题标题", "problem": "发生了什么", "solution": "如何修复", "tags": ["tag1"]}
```
第一层:热记忆(MEMORY.md)
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
第二层:冷记忆(可搜索)
memory/lessons/*.jsonl — 结构化的经验教训memory/archive/ — 已过期的内容memory_search 进行回忆第三层:原始日志
memory/YYYY-MM-DD.md — 每日日志| 优先级 | 用途 | 生存时间 |
|---|---|---|
| P0 | 用户身份、偏好、安全规则 | 永不 |
| P1 | 活跃项目、当前策略 | 90 天 |
| P2 | 调试笔记、一次性事件 | 30 天 |
在 AGENTS.md 中仅保留基本规则。其他经验教训请移至 lessons/*.jsonl。
示例 5 条规则:
运行清理程序并查看统计信息:
python3 scripts/memory-janitor.py --stats
如果超过 200 行:
lessons/*.jsonl--dry-run 模式,然后进行归档每周安装量
94
代码仓库
GitHub 星标数
35
首次出现
2026 年 2 月 25 日
安全审计
安装于
gemini-cli94
cursor94
opencode94
codex94
kimi-cli94
github-copilot94
Manage agent memory efficiently using a three-layer architecture with automatic archival.
- [P0] Core identity item (never expires)
- [P1][2026-02-10] Active project (90-day TTL)
- [P2][2026-02-10] Temporary item (30-day TTL)
2. Set up auto-archive cron:
0 4 * * * python3 ~/.openclaw/workspace/scripts/memory-janitor.py
3. Store lessons in memory/lessons/*.jsonl:
{"id": "lesson-001", "date": "2026-02-10", "category": "infra", "title": "Problem title", "problem": "What happened", "solution": "How to fix", "tags": ["tag1"]}
Layer 1: Hot Memory (MEMORY.md)
Layer 2: Cold Memory (searchable)
memory/lessons/*.jsonl — structured lessonsmemory/archive/ — expired contentmemory_search to recallLayer 3: Raw Logs
memory/YYYY-MM-DD.md — daily logs| Priority | Use For | TTL |
|---|---|---|
| P0 | User identity, preferences, safety rules | Never |
| P1 | Active projects, current strategies | 90 days |
| P2 | Debug notes, one-time events | 30 days |
Keep only essential rules in AGENTS.md. Other lessons go to lessons/*.jsonl.
Example 5 rules:
Run janitor with stats:
python3 scripts/memory-janitor.py --stats
If >200 lines:
lessons/*.jsonl--dry-run then archiveWeekly Installs
94
Repository
GitHub Stars
35
First Seen
Feb 25, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
gemini-cli94
cursor94
opencode94
codex94
kimi-cli94
github-copilot94
AI Elements:基于shadcn/ui的AI原生应用组件库,快速构建对话界面
66,200 周安装