← Back to Skills Marketplace
andrewagrahamhodges

Memory Lifecycle

by andrewagrahamhodges · GitHub ↗ · v1.1.0 · MIT-0
cross-platform ⚠ suspicious
105
Downloads
0
Stars
0
Active Installs
2
Versions
Install in OpenClaw
/install agent-memory-lifecycle
Description
Systematic memory management for long-running AI agents. Implements a five-tier lifecycle — heartbeat micro-attention, nightly consolidation, weekly reflecti...
README (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
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install agent-memory-lifecycle
  3. After installation, invoke the skill by name or use /agent-memory-lifecycle
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug agent-memory-lifecycle
Version 1.1.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 2
Frequently Asked Questions

What is Memory Lifecycle?

Systematic memory management for long-running AI agents. Implements a five-tier lifecycle — heartbeat micro-attention, nightly consolidation, weekly reflecti... It is an AI Agent Skill for Claude Code / OpenClaw, with 105 downloads so far.

How do I install Memory Lifecycle?

Run "/install agent-memory-lifecycle" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Memory Lifecycle free?

Yes, Memory Lifecycle is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Memory Lifecycle support?

Memory Lifecycle is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Memory Lifecycle?

It is built and maintained by andrewagrahamhodges (@andrewagrahamhodges); the current version is v1.1.0.

💬 Comments