← 返回 Skills 市场
bugmaker2

Fractal Memory

作者 Baiyuan Chiu · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
741
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install fractal-memory
功能描述
Automated hierarchical memory compression system that prevents context overflow through daily→weekly→monthly→core compression. Use when you need (1) long-ter...
使用说明 (SKILL.md)

Fractal Memory System

Automated hierarchical memory compression that prevents context overflow. Like human sleep, compress raw experience into patterns, patterns into principles—keeping essence while managing scale.

Philosophy

Memory is not accumulation — it is compression with intention.

Each layer compresses the one below without losing essence:

Conversation → Daily → Weekly → Monthly → Core Memory
                ↓
         Timeless Facts (sticky-notes)

Quick Start

1. Set Up Directory Structure

mkdir -p memory/diary/{2026/{daily,weekly,monthly},sticky-notes/{workflows,apis,commands,facts}}

2. Initialize State Files

Copy templates from assets/:

cp assets/rollup-state.json memory/
cp assets/heartbeat-state.json memory/

3. Install Scripts

Copy all scripts from scripts/ to your workspace scripts/ directory:

cp scripts/*.py ~/.openclaw/workspace/scripts/
chmod +x ~/.openclaw/workspace/scripts/*.py

4. Set Up Cron Jobs

See references/cron-setup.md for detailed cron configuration.

Quick version:

  • Daily rollup: 23:59 every day
  • Weekly rollup: 23:59 every Sunday
  • Monthly rollup: 23:59 last day of month

5. Update Session Startup

Add to your AGENTS.md:

## Every Session

1. Read `SOUL.md`
2. Read `USER.md`
3. Read `memory/diary/YYYY/daily/YYYY-MM-DD.md` (today + yesterday)
4. **If in MAIN SESSION**: Also read `MEMORY.md`

**Context loading order:** TODAY → THIS WEEK → THIS MONTH → MEMORY.md

Core Scripts

ensure_daily_log.py

Creates today's daily log if it doesn't exist. Run this in heartbeats or at session start.

python3 scripts/ensure_daily_log.py

append_to_daily.py

Append events to today's daily log programmatically.

python3 scripts/append_to_daily.py "Event description"

rollup-daily.py

Compress today's diary into this week's summary. Runs automatically at 23:59 daily.

python3 scripts/rollup-daily.py

rollup-weekly.py

Compress this week's summary into this month's summary. Runs automatically at 23:59 every Sunday.

python3 scripts/rollup-weekly.py

rollup-monthly.py

Distill this month's summary into MEMORY.md. Runs automatically at 23:59 on the last day of each month.

python3 scripts/rollup-monthly.py

verify_memory_integrity.py

Check memory system integrity and detect anomalies.

python3 scripts/verify_memory_integrity.py

Information Flow

1. During Conversation (Real-time)

Write to memory/diary/YYYY/daily/YYYY-MM-DD.md immediately. Don't rely on memory—write it down.

2. Daily Rollup (23:59 every day)

Extract patterns, decisions, key events → append to memory/diary/YYYY/weekly/YYYY-Wnn.md

3. Weekly Rollup (23:59 every Sunday)

Compress to themes, trajectory, milestones → append to memory/diary/YYYY/monthly/YYYY-MM.md

4. Monthly Rollup (Last day of month)

Distill major themes, lessons learned → update MEMORY.md

5. Timeless Facts (Anytime)

Extract facts that recur 3+ times → store in memory/diary/sticky-notes/{category}/

Key Principles

1. Write Everything Immediately

"Mental notes" don't survive session restarts. Files do.

2. Compress, Don't Accumulate

Files that grow forever become unreadable. Extract patterns, discard noise.

3. Curate Ruthlessly

Not everything deserves to persist. Keep what defines you, release what doesn't.

4. Automate Discipline

Scripts handle rollups so you don't have to remember.

Context Loading Strategy

Load memory in this order for attention optimization:

  1. TODAY - memory/diary/YYYY/daily/YYYY-MM-DD.md
  2. THIS WEEK - memory/diary/YYYY/weekly/YYYY-Wnn.md
  3. THIS MONTH - memory/diary/YYYY/monthly/YYYY-MM.md
  4. MEMORY.md - Core index (main session only)
  5. Relevant sticky-notes - As needed

Why this order? Primacy + recency optimization. Most recent first, highest level early.

Security Considerations

Memory systems create attack surface. The system includes:

  1. Provenance tracking - Timestamps and metadata
  2. Integrity verification - verify_memory_integrity.py detects tampering
  3. Anomaly detection - Flags unusual patterns

Run integrity checks periodically:

python3 scripts/verify_memory_integrity.py

Migration

Migrating from existing memory systems? See references/migration-guide.md for:

  • Flat daily files → Fractal structure
  • Manual MEMORY.md only → Automated system
  • Other hierarchical systems → Fractal memory

Troubleshooting

Daily log not created

Run ensure_daily_log.py manually or add to heartbeat checks.

Rollup failed

Check cron job runs: cron(action="runs", jobId="\x3Cjob-id>")

Context still overflowing

  • Verify rollups are running (check memory/rollup-state.json)
  • Manually run rollup scripts to catch up
  • Check MEMORY.md isn't growing too large (should be curated, not accumulated)

Scripts not executable

chmod +x scripts/*.py

Advanced Usage

Custom Rollup Schedule

Modify cron expressions in references/cron-setup.md

Sticky Notes Categories

Add custom categories in memory/diary/sticky-notes/:

mkdir memory/diary/sticky-notes/my-category

Manual Rollup

Run rollup scripts manually anytime:

python3 scripts/rollup-daily.py
python3 scripts/rollup-weekly.py
python3 scripts/rollup-monthly.py

Architecture Details

For deep dive into system design, philosophy, and implementation details, see references/architecture.md.

References

  • Deva's Fractal Memory v1.0.0 - Original inspiration
  • Arcturus's Memory is Resurrection - Philosophical foundation
  • Logi's Memory Architecture as Agency - Agency perspective

"What grows from chaos is structure. What emerges from structure is memory. What persists through memory is self." — Deva

安全使用建议
This skill is coherent with its stated goal (automated rollups) but has several things to check before you install: 1) Privacy: rollup-daily.py sends your full daily diary text to an external LLM via the 'openclaw ask' CLI — if that LLM is remote, your private notes will leave your machine. Confirm you are comfortable with that and that your agent/CLI credentials are intended to be used for this. 2) Path inconsistencies: two scripts hardcode /Users/brianq/.openclaw/workspace while others use Path.home(); update those paths to your own workspace before running to avoid writes to unexpected locations. 3) Undeclared dependencies: the SKILL.md and registry do not declare that 'openclaw' and Python3 are required; ensure those binaries exist and that 'openclaw ask' behavior is acceptable. 4) Missing artifact: cron examples reference update_now.py which is not included — verify cron payloads before adding jobs. 5) Test first in an isolated or backed-up workspace: run the scripts manually, inspect what files they create/modify (memory/, integrity.json, rollup-state.json, MEMORY.md), and run verify_memory_integrity.py to see detected changes. If you need stronger privacy, set USE_LLM = False in rollup-daily.py (falls back to heuristic extraction) or remove the openclaw ask call entirely.
功能分析
Type: OpenClaw Skill Name: fractal-memory Version: 1.0.0 The skill bundle contains multiple prompt injection vulnerabilities. User-controlled input from daily log entries is directly incorporated into LLM prompts via `scripts/rollup-daily.py` without sanitization, allowing potential manipulation of the LLM's behavior. Furthermore, `scripts/append_to_daily.py` and `scripts/ensure_daily_log.py` write unsanitized user input into daily logs, and subsequent rollup scripts (`rollup-weekly.py`, `rollup-monthly.py`) propagate this content throughout the agent's memory system, creating a persistent prompt injection vector. While there is no evidence of intentional malicious behavior like data exfiltration or unauthorized remote execution, these vulnerabilities pose a significant risk to the agent's integrity and decision-making.
能力评估
Purpose & Capability
The scripts and SKILL.md match the stated purpose (daily→weekly→monthly→MEMORY.md rollups). However there are inconsistencies: some scripts hardcode WORKSPACE = /Users/brianq/.openclaw/workspace while others use Path.home()/.openclaw/workspace, and rollup-daily.py invokes an external 'openclaw' CLI (openclaw ask) even though the skill metadata lists no required binaries or credentials. The hardcoded path and undeclared external CLI are disproportionate to a purely local file rollup and may cause unexpected file writes or failures.
Instruction Scope
Instructions tell the agent/user to copy scripts into ~/.openclaw/workspace, set up cron jobs, and update AGENTS.md so sessions will read/write many local files (SOUL.md, USER.md, daily/monthly files). rollup-daily.py will send full diary text to an LLM via the 'openclaw ask' CLI — this transmits private diary content to an external model. The cron examples reference running an update_now.py which is not present in the bundle. Overall the instructions stay within the memory-management goal but include explicit external data transmission and reference missing artifacts.
Install Mechanism
There is no remote download or complex installer: user is instructed to copy provided Python scripts into their workspace and make them executable. That is low-risk from supply-chain perspective. All code is included in the skill bundle (no external archives).
Credentials
The skill declares no env vars/credentials, which is consistent with a local file-based tool, but rollup-daily.py requires the 'openclaw' CLI (to call an LLM) and will therefore rely on the agent/platform's credentials implicitly — this is not documented in requires.env. The hardcoded path (/Users/brianq/...) in two scripts is unexpected and could be inappropriate on other systems. Requesting filesystem access to ~/.openclaw/workspace and the ability to create cron jobs is proportionate to the purpose, but the implicit transmission of diary contents to an external model needs explicit disclosure and user consent.
Persistence & Privilege
The skill does not request always:true or modify other skills. It asks you to add cron jobs and copy scripts into your workspace (user-controlled actions). It does write state files (rollup-state.json, integrity.json) under the user's workspace, which is expected and scoped to its memory domain.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install fractal-memory
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /fractal-memory 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: Automated hierarchical memory compression system with daily→weekly→monthly→core rollups, cron integration, and context overflow prevention
元数据
Slug fractal-memory
版本 1.0.0
许可证
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Fractal Memory 是什么?

Automated hierarchical memory compression system that prevents context overflow through daily→weekly→monthly→core compression. Use when you need (1) long-ter... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 741 次。

如何安装 Fractal Memory?

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

Fractal Memory 是免费的吗?

是的,Fractal Memory 完全免费(开源免费),可自由下载、安装和使用。

Fractal Memory 支持哪些平台?

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

谁开发了 Fractal Memory?

由 Baiyuan Chiu(@bugmaker2)开发并维护,当前版本 v1.0.0。

💬 留言讨论