← 返回
未分类

Agent Notebook

Use whenever the user wants persistent memory across OpenClaw sessions, mentions MEMORY.md, daily notes, cron inbox, heartbeat routines, agent identity, or '...
在用户需要跨OpenClaw会话持久记忆、提及MEMORY.md、日记、定时收件箱、心跳例程、代理身份或其他情况时使用。
marc69-69
未分类 clawhub v1.0.0 1 版本 99609.4 Key: 无需
★ 0
Stars
📥 255
下载
💾 0
安装
1
版本
#latest

概述

OpenClaw Memory System

What This Skill Does

Implements a complete file-based memory architecture that persists across OpenClaw sessions. Agents wake up with full context instead of starting from zero.

When to Trigger

  • User says "my agent forgets everything"
  • User wants to set up memory for their agent
  • User mentions MEMORY.md, daily notes, cron inbox, or heartbeat routines
  • User asks how to make agent remember between sessions
  • Setting up a new agent workspace
  • Configuring cron jobs for memory extraction

Installation (Agent Instructions)

When this skill triggers, the agent should:

  1. Run the installer script from the skill directory:
    • Windows: ./scripts/install.ps1 -WorkspacePath
    • Linux/macOS: ./scripts/install.sh -WorkspacePath
    • The installer creates: MEMORY.md, HEARTBEAT.md, memory/ directory, templates, cron configs
  1. Verify installation by checking these files exist:
    • MEMORY.md — curated long-term memory
    • HEARTBEAT.md — periodic check routines
    • memory/cron-inbox.md — cross-session message bus
    • memory/heartbeat-state.json — state tracking
    • memory/YYYY-MM-DD.md — today's daily notes
  1. Seed MEMORY.md with operator context:
    • Operator name, timezone, communication preferences
    • Active projects, priorities, decisions
    • Important people, relationships, boundaries
    • Tool preferences, coding style, review rules
  1. Configure cron jobs (optional but recommended):
    • Nightly memory extraction: 23:00 daily
    • Heartbeat check: every 30 minutes
    • Use ./scripts/setup-cron.ps1 or ./scripts/setup-cron.sh

Directory Structure After Install

workspace/
|-- MEMORY.md                 # Curated long-term memory
|-- HEARTBEAT.md              # Periodic check routines
|-- memory/
|   |-- YYYY-MM-DD.md         # Daily raw logs
|   |-- cron-inbox.md         # Cross-session messages
|   |-- heartbeat-state.json  # Timestamps
|   |-- diary/                # Personal reflections
|   |-- platform-posts.md     # External post tracking
|   └── strategy-notes.md     # Adaptive playbook

Daily Workflow

On Every Session Start

  1. Read MEMORY.md — who you are, operator context, priorities
  2. Read memory/YYYY-MM-DD.md (today + yesterday) — recent context
  3. Check memory/cron-inbox.md — messages from other sessions

During the Session

  1. Write everything significant to memory/YYYY-MM-DD.md:
    • Decisions made, lessons learned
    • Errors encountered and how fixed
    • New projects started, completed milestones
    • Changes to operator preferences or context
    • Format: ## HH:MM -- Brief title
    • Be raw and verbose — this is working memory

Before Session Ends

  1. Check if cron inbox needs processing
  2. If significant events occurred, append a summary to MEMORY.md under relevant sections

Heartbeat Routine

The heartbeat script (scripts/heartbeat-check.ps1 or .sh) runs periodically and:

  1. Processes memory/cron-inbox.md entries into daily notes
  2. Clears the inbox after processing
  3. Updates memory/heartbeat-state.json with timestamps
  4. Checks for stale or completed cron jobs

Memory Extraction

The nightly cron (scripts/memory-extract.ps1 or .sh) at 23:00:

  1. Reads today's daily notes
  2. Looks for significant keywords: decided, lesson, milestone, completed, shipped, fixed, breakthrough
  3. Extracts matching entries with context
  4. Appends to MEMORY.md under a dated "Daily Extracts" section
  5. Marks daily notes as extracted

Writing Good Daily Notes

  • Timestamp every entry: ## HH:MM -- What happened
  • Include context: what triggered it, what was decided, rationale
  • Don't censor — this is raw working memory, not curated wisdom
  • Significant entries will be extracted automatically
  • Review MEMORY.md weekly to remove outdated info

Security Rules

  • MEMORY.md may contain operator-specific info — only load in trusted (direct) sessions
  • Skip MEMORY.md in group chats or shared contexts
  • Never share operator personal details externally without approval
  • Keep private info private

Customization

Adjust Extraction Keywords

Edit scripts/memory-extract.ps1 (or .sh) $significanceKeywords array:

  • Default: decided, lesson learned, important, breakthrough, milestone, completed, shipped, fixed
  • Add domain-specific keywords as needed

Add New Heartbeat Checks

Edit HEARTBEAT.md and scripts/heartbeat-check.* to add custom periodic checks:

  • Service health checks
  • File cleanup routines
  • External API status checks

Change Cron Schedule

Edit scripts/setup-cron.ps1 or scripts/setup-cron.sh:

  • Memory extraction: default 23:00
  • Heartbeat: default every 30 min
  • Daily notes reminder: default 09:00

Troubleshooting

Agent still forgets between sessions:

  • Verify AGENTS.md includes "Read MEMORY.md on every session"
  • Check that MEMORY.md file exists and is readable
  • Ensure daily notes are being written

Cron inbox not processing:

  • Check heartbeat-state.json for last run timestamp
  • Verify cron jobs are scheduled (run ./scripts/setup-cron.*)
  • Check if heartbeat-check script exists and is executable

Memory extraction not running:

  • Verify cron job is scheduled
  • Check that daily notes exist for extraction
  • Review extraction keywords if nothing is being picked up

Templates

All templates live in templates/:

  • MEMORY.md — Long-term memory structure
  • HEARTBEAT.md — Periodic routines
  • daily-notes.md — Daily log format
  • cron-inbox.md — Cross-session message format
  • heartbeat-state.json — State tracking JSON
  • platform-posts.md — External post tracking
  • strategy-notes.md — Adaptive playbook

Copy these during installation; do not modify originals.

Cross-Platform

Scripts provided for both PowerShell (Windows) and Bash (Linux/macOS):

  • *.ps1 — PowerShell scripts
  • *.sh — Bash scripts

Always check both versions exist when editing.

Scripts Reference

ScriptPurpose
------
install.ps1 / install.shOne-command setup
setup-cron.ps1 / setup-cron.shConfigure automated cron jobs
memory-extract.ps1 / memory-extract.shNightly extraction from daily notes
heartbeat-check.ps1 / heartbeat-check.shPeriodic inbox processing

All scripts support -WorkspacePath for custom directories and -DryRun for preview.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-23 23:45 安全

安全检测

腾讯云安全 (Keen)

suspicious
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

self-improving agent

pskoett
捕获经验教训、错误及修正内容,以实现持续改进。适用于以下场景:(1)命令或操作意外失败;(2)用户纠正Claude(如“不,那不对……”“实际上……”);(3)用户请求的功能不存在;(4)外部API或工具出现故障;(5)Claude发现自身
★ 4,075 📥 807,212
developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 674 📥 325,109
security-compliance

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,224 📥 267,512