Skills per-agent-compression-universal
Zero-config memory consolidation for multi-agent OpenClaw deployments. Auto-discovers agents and registers staggered cron tasks with full state tracking, deduplication, and domain-aware extraction.
install
source · Clone the upstream repo
git clone https://github.com/openclaw/skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/bensk2001/per-agent-compression-universal" ~/.claude/skills/openclaw-skills-per-agent-compression-universal && rm -rf "$T"
OpenClaw · Install into ~/.openclaw/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.openclaw/skills && cp -r "$T/skills/bensk2001/per-agent-compression-universal" ~/.openclaw/skills/openclaw-skills-per-agent-compression-universal && rm -rf "$T"
manifest:
skills/bensk2001/per-agent-compression-universal/SKILL.mdsource content
Per-Agent Memory Compression Skill
Overview
This skill automates weekly memory consolidation for multi-agent OpenClaw deployments. It discovers all agents with workspaces and registers staggered cron tasks that compress old daily notes into long-term memory files.
Key Features
- Auto-discovery: Finds all agents via
openclaw agents list - Workspace isolation: Each agent compresses its own memory
- State persistence: Tracks processed notes in
.compression_state.json - Deduplication: Avoids duplicate entries
- Domain awareness: Includes DOMAIN_CONTEXT for tailored extraction
- Zero config: Just run
./install.sh
Installation
cd /root/.openclaw/workspace/skills/per-agent-compression-universal ./install.sh
This creates 5 staggered tasks (if you have 5 agents) running Sundays 03:00-05:00 Shanghai time.
What It Does
- Pre-check paths and initialize state
- List daily notes older than 7 days (skip recent)
- Sort oldest first, process up to 5 notes per run
- For each note:
- Read content
- Extract factual info (preferences, decisions, personal info)
- Append to target files with date headers
- Move original to
memory/processed/
- Update state file
- Clean working buffer
- Send DingTalk summary
File Structure
Each agent workspace should have:
(daily notes)memory/YYYY-MM-DD.md
,USER.md
,IDENTITY.md
,SOUL.md
(targets)MEMORY.md
After running:
(state tracking)memory/.compression_state.json
(moved old notes)memory/processed/
Customization
Edit
install.sh to adjust:
- Stagger offsets (
array)OFFSETS - Domain context per agent (
associative array)DOMAIN_CONTEXT - Cron expression (currently Sundays)
Troubleshooting
- Task hangs: Check STATE_FILE path uses
(uppercase), not{WORKSPACE}{workspace} - No notes processed: Ensure there are daily notes older than 7 days
- Timeout: Increase
in install.sh (default 1200s)--timeout - Delivery fails: Verify DingTalk connector configured with
fieldto
Uninstall
./uninstall.sh
Removes all
per_agent_compression_* tasks.
Version
Current: 1.3.4 (fixes STATE_FILE case sensitivity bug)
Support
See README.md for full documentation.