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
累計下載
4028
星標
6
全站排名
#2,531
全站前 50% · 「AI 智慧體」前 51%
平台累計安裝累計下載星標評論
ClawHub ↗10031316-
SkillHub ↗32940286—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

生成結構化建議和報告,內容變更須人工批准,歸檔或清理可先預覽。依賴 Gemini CLI、jq、憑據和相容 OpenClaw 配置。筆記可能發往 Gemini,維護可能移動或刪除檔案;啟用前須審查定時、保留策略、模型生成路徑及環境變數載入範圍。

資料釋出於 2026-10-27

可以用來做什麼

  • 審閱記憶更新建議與歸檔方案

什麼時候用

  • 記憶檔案需要在約定外發和保留範圍內維護時

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

準備 dry-run 維護方案,說明遠端資料使用和擬檔案變更,先供審查。

月度資料趨勢

累計下載4028
2356325441522026-03 · 累計下載 24802026-05 · 累計下載 31672026-07 · 累計下載 35592026-08 · 累計下載 36712026-09 · 累計下載 402826-0326-09
星標6
5662026-03 · 星標 52026-05 · 星標 62026-07 · 星標 62026-08 · 星標 62026-09 · 星標 626-0326-09

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-094028—6
2026-083671+3.1%6
2026-073559—6
2026-053167—6
2026-032480—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),按月更新。口徑說明見資料方法。