← 返回
未分类 中文

Anti-Amnesia Agent

Complete anti-amnesia system for OpenClaw agents. Prevents context loss across sessions with structured state files, automatic session saving, health monitor...
完整的防遗忘系统,为 OpenClaw 代理设计。通过结构化状态文件、自动会话保存和健康监控,防止跨会话上下文丢失。
peti0402
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 285
下载
💾 0
安装
1
版本
#latest

概述

Anti-Amnesia Agent System 🧠🛡️

Your OpenClaw agent forgets everything between sessions. This skill fixes that.

What It Does

  1. STATE.md — Single source of truth. Active projects, iron decisions, open issues. Read first on every wake-up.
  2. Session Memory Hook — Automatically saves full conversation when you /new or /reset. Zero manual work.
  3. Daily Journalsmemory/YYYY-MM-DD.md files capture everything that happens each day.
  4. MEMORY.md — Long-term curated memory. The distilled wisdom, not raw logs.
  5. Heartbeat Health Checks — Every wake-up: verify crons, check processes, validate state consistency.
  6. Decision Capture — Decisions made in conversation get written to files immediately. No "mental notes."

Setup

Step 1: Enable Session Memory Hook

Add to your ~/.openclaw/openclaw.json under hooks:

{
  "hooks": {
    "session-memory": {
      "enabled": true,
      "messages": 9999,
      "path": "memory/"
    }
  }
}

Step 2: Create Core Files

Copy the templates from this skill's templates/ folder to your workspace:

templates/STATE.md      → workspace/STATE.md
templates/HEARTBEAT.md  → workspace/HEARTBEAT.md

Edit STATE.md with your actual projects and decisions.

Step 3: Update AGENTS.md

Add to your AGENTS.md session start protocol:

## Every Session — Mandatory
1. Read `STATE.md` — current world state
2. Read `memory/YYYY-MM-DD.md` (today) — if missing, create it
3. Read `MEMORY.md` — long-term memory

Step 4: Create memory directory

mkdir -p workspace/memory

The Anti-Amnesia Protocol

On Every Session Start:

STATE.md → What's happening now
memory/today.md → What happened today
MEMORY.md → What happened before

On Every Heartbeat:

1. Read STATE.md
2. Check cron health (consecutiveErrors > 0 → alert)
3. Check critical processes (are they running?)
4. Read income-tracker.md (if night shift)
5. Write everything to memory/today.md

On Every Decision:

Decision made in chat → Write to file IMMEDIATELY
No "I'll remember that" — files only

Key Principle

> If it's not in a file, it didn't happen.

Mental notes don't survive session restarts. Files do. Every decision, every status change, every important conversation — write it down in the same response.

Files Reference

FilePurposeWhen to Read
----------------------------
STATE.mdCurrent world stateEvery session + heartbeat
MEMORY.mdLong-term curated memoryEvery session
memory/YYYY-MM-DD.mdDaily journalEvery session + heartbeat
HEARTBEAT.mdWake-up protocolEvery heartbeat
AGENTS.mdAgent behavior rulesOn first load

Why This Works

Most OpenClaw agents lose context because they rely on conversation history alone. When context resets, everything is gone.

This system creates external persistent memory — files that survive any reset. Your agent reads them on startup and knows everything within 30 seconds.

Tested in production: 24/7 autonomous trading system, 20+ cron jobs, multi-agent coordination — zero context loss over weeks of operation.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-12 05:56 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

OKX Competition Manager

peti0402
5个AI交易代理在OKX Demo(实时价格)竞争。每日淘汰失败者的进化赛制,交易所级止损保护资金。
★ 0 📥 258
ai-intelligence

Trading Tournament

peti0402
在OKX上运行自主多智能体交易竞赛。5个AI智能体使用实时市场数据竞争,通过进化选择每日替换表现不佳者,交易所集成...
★ 1 📥 969
ai-intelligence

Hype Scanner

peti0402
利用Reddit、CoinGecko、DEXScreener和StockTwits进行加密货币与股票实时热度检测。通过本地Ollama模型进行AI信号验证。
★ 0 📥 911