Max Hutchinson

Memory Maintenance

AI 智能体v1.0.0
作者:Max Hutchinson更新于 2026-05-11memory-maintenance@clawhub_maxlauriehutchinson/memory-maintenance
记忆增强工具调用#Maintenance#Agent Improvement#Health

据 AlphaMoat 统计,截至 2026-09,Memory Maintenance 累计下载 4,028 次、获 6 个星标,在全部 5,078 个 AI 技能中排名第 2,531 位,在「AI 智能体」分类(969 个)中排名第 493 位。

累计安装
329
累计下载
4,028
星标
6
全站排名
#2,531
全站前 50% · 「AI 智能体」前 51%
平台累计安装累计下载星标评论
ClawHub ↗1003,1316-
SkillHub ↗3294,0286—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

生成结构化建议和报告,内容变更须人工批准,归档或清理可先预览。依赖 Gemini CLI、jq、凭据和兼容 OpenClaw 配置。笔记可能发往 Gemini,维护可能移动或删除文件;启用前须审查定时、保留策略、模型生成路径及环境变量加载范围。

资料发布于 2026-10-27

可以用来做什么

  • 审阅记忆更新建议与归档方案

什么时候用

  • 记忆文件需要在约定外发和保留范围内维护时

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

准备 dry-run 维护方案,说明远程数据使用和拟文件变更,先供审查。

月度数据趋势

累计下载4,028
2,3563,2544,1522026-03 · 累计下载 2,4802026-05 · 累计下载 3,1672026-07 · 累计下载 3,5592026-08 · 累计下载 3,6712026-09 · 累计下载 4,02826-0326-09
星标6
5662026-03 · 星标 52026-05 · 星标 62026-07 · 星标 62026-08 · 星标 62026-09 · 星标 626-0326-09

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。

月份累计下载环比星标
2026-094,028—6
2026-083,671+3.1%6
2026-073,559—6
2026-053,167—6
2026-032,480—5

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

5.9 KB · ClawHub v1.0.0
---
name: memory-maintenance
version: 1.0.0
description: "Intelligent memory management for OpenClaw agents. Reviews daily notes, suggests MEMORY.md updates, maintains directory health, and auto-cleans old files. Recommended for agents with growing memory footprints."
homepage: https://github.com/MaxLaurieHutchinson/memory-maintenance
author: 
  name: "Max Hutchinson"
  email: "[email protected]"
  url: "https://github.com/MaxLaurieHutchinson"
tags: ["memory", "maintenance", "automation", "agent-improvement", "workflow"]
展开全部(共 226 行)
metadata:
  openclaw:
    emoji: 🧹
    requires: 
      bins: ["gemini", "jq"]
      env: ["GEMINI_API_KEY"]
    install:
      - id: setup
        kind: script
        script: ./scripts/install.sh
        label: "Install memory maintenance"
---

# Memory Maintenance Skill

Intelligent memory management for OpenClaw agents. Reviews daily notes, suggests MEMORY.md updates, maintains directory health, and auto-cleans old files.

## Why This Exists

Agents wake up fresh every session. Without maintenance:
- Daily notes pile up and become unsearchable
- Important decisions get buried in old sessions
- Context windows fill with irrelevant history
- You repeat the same context-setting every day

This skill automates the tedious work of keeping your agent's memory organized and actionable.

## Features

- **Content Review**: Analyzes daily notes and suggests MEMORY.md updates
- **Directory Health**: Monitors memory/ directory for naming issues, fragmentation, bloat
- **Auto-Cleanup**: Archives old reviews (7+ days) and enforces retention policy (30 days)
- **Safe by Default**: Content changes require approval; only safe maintenance auto-applies

## Recommended Model

This skill works well with lightweight models. We recommend:
- **Primary**: `gemini-2.5-flash` (fast, cost-effective)
- **Fallback**: `gemini-2.5-flash-lite` (if rate limits hit)

Both handle the structured output and analysis tasks efficiently.

## Quick Start

```bash
# Install the skill
clawhub install memory-maintenance

# Configure (optional)
# Edit config/settings.json to customize schedule, retention, etc.

# Run manually
openclaw skill memory-maintenance run

# Or let it run automatically via cron (configured during install)
```

## Architecture

```
Daily Session Notes (memory/YYYY-MM-DD.md)
    ↓
Review Agent (scheduled daily)
    ↓
Structured Suggestions (JSON)
    ↓
Human Review (markdown report)
    ↓
Approved Updates → MEMORY.md
    ↓
Auto-Cleanup (archive old files)
```

## Workflow

1. **Daily Review** (23:00 by default)
   - Scans configurable lookback period (default: 7 days)
   - Checks memory/ directory health
   - Generates suggestions via LLM
   - Outputs structured JSON + human-readable markdown

2. **Human Review**
   - Read `agents/memory/review-v2-YYYY-MM-DD.md`
   - Approve/reject suggestions

3. **Apply Changes**
   ```bash
   # Dry run (preview)
   openclaw skill memory-maintenance apply --dry-run 2026-02-05
   
   # Apply safe changes (archiving, cleanup)
   openclaw skill memory-maintenance apply --safe 2026-02-05
   
   # Apply all (requires confirmation)
   openclaw skill memory-maintenance apply --all 2026-02-05
   ```

4. **Auto-Cleanup** (runs after successful review)
   - Archives reviews older than configured threshold
   - Deletes archive files older than retention period
   - Cleans up error logs

## Configuration

Edit `config/settings.json`:

```json
{
  "schedule": {
    "enabled": true,
    "time": "23:00",
    "timezone": "Europe/London"
  },
  "review": {
    "lookback_days": 7,
    "model": "gemini-2.5-flash",
    "max_suggestions": 10
  },
  "maintenance": {
    "archive_after_days": 7,
    "retention_days": 30,
    "consolidate_fragments": true,
    "auto_archive_safe": true
  },
  "safety": {
    "require_approval_for_content": true,
    "require_approval_for_delete": true,
    "trash_instead_of_delete": true
  }
}
```

## Safety

- **Content suggestions**: Never auto-applied (human review mandatory)
- **Safe maintenance** (archiving): Auto-applied with `--safe`
- **Risky operations** (delete, rename): Require `--all` + confirmation
- **Trash recovery**: Deleted files go to `agents/memory/.trash/` (recoverable for retention period)

## Commands

```bash
# Run review manually
openclaw skill memory-maintenance review

# Apply changes
openclaw skill memory-maintenance apply [--dry-run|--safe|--all] DATE

# Run cleanup
openclaw skill memory-maintenance cleanup

# Check status
openclaw skill memory-maintenance status

# View stats
openclaw skill memory-maintenance stats
```

## Integration with MEMORY.md

The skill suggests updates to standard MEMORY.md sections:
- Agent Identity and Core Preferences
- Infrastructure/Setup
- Memory Management
- Backup & Migration
- Contacts
- Scheduled Operations
- Content Creation & Projects
- Active Projects

## Files

### Output
- `agents/memory/review-v2-YYYY-MM-DD.json` — Structured suggestions
- `agents/memory/review-v2-YYYY-MM-DD.md` — Human-readable report
- `agents/memory/stats.json` — Aggregate statistics

### Archive
- `agents/memory/archive/YYYY-MM/` — Monthly buckets
- `agents/memory/.trash/` — Recoverable deletions

## Requirements

- OpenClaw >= 2026.2.0
- Gemini CLI (`brew install gemini-cli`)
- jq (`brew install jq`)
- Gemini API key (from Google AI Studio)

## Troubleshooting

**"Gemini failed"**
→ Check `GEMINI_API_KEY` is set in `.env` or environment

**"No suggestions generated"**
→ Check daily notes exist in `memory/YYYY-MM-DD.md`
→ Review error logs in `agents/memory/error-*.txt`

**"Too many maintenance tasks"**
→ Run `openclaw skill memory-maintenance apply --safe` to archive old files
→ Adjust `archive_after_days` in config

## Author

Built by **Max Hutchinson** as part of an AI agent infrastructure exploration.

- GitHub: [@MaxLaurieHutchinson](https://github.com/MaxLaurieHutchinson)
- Agent: Ash (OpenClaw)

## License

MIT — Free to use, modify, distribute.

---

*Part of the Hybrid Agent Architecture. Built for agents that improve over time.*

「AI 智能体」分类下的热门技能

数据月份:2026-09 · 下载/星标/安装数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。