← 返回 Skills 市场
andrewagrahamhodges

Memory Lifecycle

作者 andrewagrahamhodges · GitHub ↗ · v1.1.0 · MIT-0
cross-platform ⚠ suspicious
105
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install agent-memory-lifecycle
功能描述
Systematic memory management for long-running AI agents. Implements a five-tier lifecycle — heartbeat micro-attention, nightly consolidation, weekly reflecti...
使用说明 (SKILL.md)

Memory Lifecycle

Structured memory management that makes agents smarter over time — not through code, but through disciplined capture, consolidation, and distillation of context.

Philosophy

Memory management is not about saving tokens. It's about crafting high-signal context that makes a powerful LLM more effective.

Core principles:

  1. Distill, don't summarise. Output should be better than raw input — structured, actionable, reasoning preserved
  2. Preserve decisions and reasoning. "We chose X because Y" > "We did X"
  3. Never compress away specifics. Phone numbers, dates, prices are facts, not fluff
  4. Daily files are immutable. They're the audit trail — add headers, never edit content
  5. Each tier builds upward. Raw → structured → refined → wisdom
  6. Archives are a library, not a bin. Full narratives, not one-liners

Setup

Run the setup script to scaffold memory files and create cron jobs:

python3 scripts/setup.py

The script will:

  1. Create structured memory files (people.md, decisions.md, lessons.md, commitments.md)
  2. Add a ## Recent working memory buffer to MEMORY.md
  3. Create four cron jobs (nightly, weekly, monthly, yearly)
  4. Add memory micro-attention tasks to HEARTBEAT.md

Run with --dry-run to preview changes without applying them. Run with --agent \x3Cid> to target a specific agent (default: main).

The Five Tiers

Tier 1: Heartbeat Micro-Attention (every ~30 min)

Added to the agent's HEARTBEAT.md. Quick focused pass — capture, promote, tag:

  1. Capture: Ensure notable events are in today's memory/YYYY-MM-DD.md
  2. Promote: Session-critical items (new appointment, key decision) → MEMORY.md → ## Recent
  3. Tag: Mark daily file entries with [decision], [lesson], [person] for the nightly cycle
  4. Monitor: Check nightly cycle health — if it errored, fix and re-run. Don't just report.

Tier 2: Nightly "Sleep Cycle" (cron, ~2:00 AM local)

Read references/nightly-prompt.md for the full cron prompt.

  • Read today's daily file end-to-end
  • Write a 2-3 line "day essence" header
  • Promote items to structured files (people → people.md, decisions → decisions.md, etc.)
  • Update MEMORY.md if active project state changed
  • Clear processed items from ## Recent

Rules: Never edit daily file content. Never remove from MEMORY.md unless completed AND archived.

Tier 3: Weekly Reflection (cron, Sunday ~3:00 AM local)

Read references/weekly-prompt.md for the full cron prompt.

  • Read all 7 daily files from the past week
  • Spot patterns: repeated topics, unresolved threads
  • Refine MEMORY.md — improve structure and language (not strip content)
  • Review commitments, contacts, decisions for staleness
  • Write a "week in review" in Sunday's daily file

Tier 4: Monthly Deep Clean (cron, 1st of month ~4:00 AM local)

Read references/monthly-prompt.md for the full cron prompt.

  • Create memory/archive/YYYY-MM.md with full narratives of completed work
  • Move completed items from MEMORY.md to archive
  • Keep MEMORY.md under ~4000 words
  • Consolidate related lessons into principles
  • Personality check on SOUL.md

Rules: Archive entries must be self-contained. Active items never move to archive.

Tier 5: Yearly Wisdom Distillation (cron, January 1)

Read references/yearly-prompt.md for the full cron prompt.

  • Create memory/wisdom/YYYY.md
  • Extract wisdom that transcends specific events
  • Evolve SOUL.md based on a year's experience
  • Flag SOUL.md changes to the human

The "Recent" Buffer

A ## Recent section at the top of MEMORY.md acts as working memory:

## Recent
> Working memory — heartbeat promotes critical items here, nightly cycle processes them.
- **2026-03-23:** Viewing booked Thu 26 Mar 9am with estate agent
- **2026-03-23:** Server upgraded v2.3.13 → v2.3.22
  • Heartbeats promote critical items here immediately
  • Every new session sees it (MEMORY.md is loaded automatically)
  • Nightly cycle processes items and clears them

This bridges the gap between raw daily capture and curated long-term memory.

File Structure

After setup, the memory directory contains:

MEMORY.md                  ← Active long-term memory (loaded every session)
memory/
  YYYY-MM-DD.md            ← Daily raw notes (immutable)
  people.md                ← Contacts, relationships, dynamics
  decisions.md             ← Key choices with rationale
  lessons.md               ← Mistakes and learnings (grows, never shrinks)
  commitments.md           ← Deadlines and obligations
  archive/
    YYYY-MM.md             ← Monthly archives (full narratives)
  wisdom/
    YYYY.md                ← Yearly distilled wisdom

Health Check

Run the health check to verify the memory system is working:

python3 scripts/health_check.py

Checks: nightly cron status, MEMORY.md size, Recent buffer staleness, structured file freshness.

What Gets Archived vs What Stays

  • Archive: Completed projects, resolved leads, past deadlines, finished work
  • Keep active: Ongoing relationships, active projects, preferences, lessons learned
  • Never compress: Phone numbers, addresses, credentials, family details, business structure
安全使用建议
This skill appears to implement the memory lifecycle it describes, but review and take these precautions before installing or running the setup script: - Verify you have the OpenClaw CLI available: the scripts call 'openclaw status' and 'openclaw cron' but the skill metadata does not declare this dependency. If 'openclaw' is not present the scripts will fail; if present they will act against whatever OpenClaw server your environment is configured for. - Run with --dry-run first and inspect the printed commands to see what files would be created/changed and what cron jobs would be added. The README and scripts provide a dry-run option for this reason. - Backup MEMORY.md, HEARTBEAT.md and any existing memory/ files before running. The setup script will write files and insert a ## Recent buffer; the nightly/weekly/monthly cron jobs will later modify files. - Limit scope with --agent <id> (don’t let the script discover and modify all agents) unless you intend to configure multiple agents. discover_agents() uses workspace paths returned by OpenClaw — if you run as an admin you could inadvertently create jobs across other agents. - Inspect the scripts yourself: they call subprocess.run(shell=True) for OpenClaw commands and inline prompt text into cron job payloads. This pattern works but can be brittle if agent names/workspaces contain unusual characters; check quoting and the created cron definitions. - Understand persistence: creating scheduled jobs means recurring autonomous runs. If you later want to stop them, remove the cron jobs via 'openclaw cron list'/'openclaw cron delete' or equivalent. What would change my assessment to 'benign': the registry metadata explicitly listing 'openclaw' as a required binary, and the setup script using safer CLI invocation patterns (no shell quoting with untrusted inputs) and clear defaults that restrict actions to a single agent unless elevated consent is provided. If you are uncomfortable, run the scripts in a test workspace or inspect and manually apply the file changes instead of letting the script create cron jobs for you.
功能分析
Type: OpenClaw Skill Name: agent-memory-lifecycle Version: 1.1.0 The skill bundle implements an automated memory management system that uses shell commands (subprocess.run with shell=True) to interact with the OpenClaw CLI and manage cron jobs (setup.py, health_check.py). While the behavior is consistent with the stated purpose, it contains instructions in SKILL.md and monthly-prompt.md explicitly directing the agent to preserve sensitive data, including 'credentials' and 'phone numbers', in plain-text markdown files. The combination of automated cron-based execution and the intentional storage of secrets in the workspace creates a high-risk environment for data exposure and potential shell injection vulnerabilities.
能力评估
Purpose & Capability
SKILL.md, templates, and scripts align with a memory-management purpose: scaffolding memory files, adding a Recent buffer, and creating scheduled consolidation jobs. However, the code repeatedly calls an external CLI 'openclaw' (openclaw status, openclaw cron list/create) but the registry metadata lists no required binaries. That is an incoherence — the scripts require the OpenClaw CLI to function and may act across multiple agents/workspaces.
Instruction Scope
Runtime instructions explicitly tell the user to run scripts/setup.py which will create files (MEMORY.md additions, people.md, decisions.md, etc.), update HEARTBEAT.md, and create cron jobs that run nightly/weekly/monthly/yearly. All of that is in-scope for a memory lifecycle skill, but these instructions grant the skill permission to modify workspace files and to create persistent scheduled jobs that run without manual approval once created. The SKILL.md properly documents --dry-run and --agent options, which is good.
Install Mechanism
This is instruction-only (no external downloads). There is no install spec — the only on-disk artifacts come from running the included setup script, which is expected for this type of skill.
Credentials
The skill does not request environment variables or secrets. The scripts operate on local workspace files and use the OpenClaw CLI; no credentials are requested or read. The scripts do instruct to preserve phone numbers, addresses, and other personal data in memory files — that is a privacy consideration but not an unexplained secret request.
Persistence & Privilege
Running the setup script will create cron jobs (persistent scheduled tasks) that cause the agent to run autonomously on a schedule. Although always:false and model invocation not disabled (normal defaults), the cron jobs themselves are persistent and could run repeatedly without further human action. The setup script also discovers other agents via 'openclaw status' and may create jobs for agents/workspaces beyond the one you intended — exercise caution and use --agent or dry-run first.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install agent-memory-lifecycle
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /agent-memory-lifecycle 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.1.0
Fix setup.py crash, inline cron prompts, add timezone support, flesh out weekly/monthly/yearly prompts
v1.0.0
Initial release: five-tier memory lifecycle (heartbeat, nightly, weekly, monthly, yearly). Includes Python setup script (idempotent, multi-agent --all flag), health check script, and reference-based cron prompts for upgradeability.
元数据
Slug agent-memory-lifecycle
版本 1.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

Memory Lifecycle 是什么?

Systematic memory management for long-running AI agents. Implements a five-tier lifecycle — heartbeat micro-attention, nightly consolidation, weekly reflecti... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 105 次。

如何安装 Memory Lifecycle?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install agent-memory-lifecycle」即可一键安装,无需额外配置。

Memory Lifecycle 是免费的吗?

是的,Memory Lifecycle 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Memory Lifecycle 支持哪些平台?

Memory Lifecycle 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Memory Lifecycle?

由 andrewagrahamhodges(@andrewagrahamhodges)开发并维护,当前版本 v1.1.0。

💬 留言讨论