作者:互联网 时间: 2026-07-30 15:05:01
内存管理器是一款专为 AI 智能体设计的专业级架构,旨在以类人认知系统的复杂度处理上下文。通过实施情景、语义和程序三层内存模式,该工具确保智能体不仅是存储数据,而是为了实现最优检索而组织数据。使用此类 Openclaw Skills 可以让开发者超越扁平的文本文件,实现结构化的知识图谱方法。
该系统专为需要维持长期上下文且无需外部向量数据库的开销或隐私担忧的智能体而构建。它提供本地优先、人类可读的存储,使检索效率提高 18.5%。通过监控内存使用并提供自动快照,它能够有效防止通常与 LLM 令牌限制相关的上下文丢失。
下载入口:https://github.com/openclaw/skills/tree/main/skills/marmikcfc/memory-manager
从源直接安装技能的最快方式。
npx clawhub@latest install memory-manager
将技能文件夹复制到以下位置之一
全局模式~/.openclaw/skills/
工作区
<project>/skills/
优先级:工作区 > 本地 > 内置
将此提示词复制到 OpenClaw 即可自动安装。
请帮我使用 Clawhub 安装 memory-manager。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。
要开始使用 Openclaw Skills 管理智能体上下文,请运行初始化脚本以设置目录结构:
~/.openclaw/skills/memory-manager/init.sh
然后,您可以检查现有的内存风险或整理当前的扁平文件内存日志:
# 检查压缩风险
~/.openclaw/skills/memory-manager/detect.sh
# 整理现有内存
~/.openclaw/skills/memory-manager/organize.sh
该技能将数据组织成层级结构,以最大化检索准确性和人类可读性:
| 目录 | 类型 | 描述 |
|---|---|---|
memory/episodic/ |
情景 | 按时间顺序排列的事件日志(例如 YYYY-MM-DD.md)。 |
memory/semantic/ |
语义 | 提炼的事实、概念和永久知识节点。 |
memory/procedural/ |
程序 | 可重复使用的分步指南和工作流模式。 |
memory/snapshots/ |
备份 | 在内存清除前生成的压缩快照。 |
memory/legacy/ |
归档 | 迁移到层级结构后保留的原始文件。 |
name: memory-manager
description: Local memory management for agents. Compression detection, auto-snapshots, and semantic search. Use when agents need to detect compression risk before memory loss, save context snapshots, search historical memories, or track memory usage patterns. Never lose context again.
Professional-grade memory architecture for AI agents.
Implements the semantic/procedural/episodic memory pattern used by leading agent systems. Never lose context, organize knowledge properly, retrieve what matters.
Three-tier memory system:
memory/episodic/YYYY-MM-DD.mdmemory/semantic/topic.mdmemory/procedural/process.mdWhy this matters: Research shows knowledge graphs beat flat vector retrieval by 18.5% (Zep team findings). Proper architecture = better retrieval.
~/.openclaw/skills/memory-manager/init.sh
Creates:
memory/
├── episodic/ # Daily event logs
├── semantic/ # Knowledge base
├── procedural/ # How-to guides
└── snapshots/ # Compression backups
~/.openclaw/skills/memory-manager/detect.sh
Output:
~/.openclaw/skills/memory-manager/organize.sh
Migrates flat memory/*.md files into proper structure:
# Search episodic (what happened)
~/.openclaw/skills/memory-manager/search.sh episodic "launched skill"
# Search semantic (what I know)
~/.openclaw/skills/memory-manager/search.sh semantic "moltbook"
# Search procedural (how to)
~/.openclaw/skills/memory-manager/search.sh procedural "validation"
# Search all
~/.openclaw/skills/memory-manager/search.sh all "compression"
## Memory Management (every 2 hours)
1. Run: ~/.openclaw/skills/memory-manager/detect.sh
2. If warning/critical: ~/.openclaw/skills/memory-manager/snapshot.sh
3. Daily at 23:00: ~/.openclaw/skills/memory-manager/organize.sh
init.sh - Initialize memory structure detect.sh - Check compression risk snapshot.sh - Save before compression organize.sh - Migrate/organize memories search.sh <type> <query> - Search by memory type stats.sh - Usage statistics
Manual categorization:
# Move episodic entry
~/.openclaw/skills/memory-manager/categorize.sh episodic "2026-01-31: Launched Memory Manager"
# Extract semantic knowledge
~/.openclaw/skills/memory-manager/categorize.sh semantic "moltbook" "Moltbook is the social network for AI agents..."
# Document procedure
~/.openclaw/skills/memory-manager/categorize.sh procedural "skill-launch" "1. Validate idea
2. Build MVP
3. Launch on Moltbook..."
Monitors all memory types:
Estimates total context usage across all memory types.
Thresholds:
Automatic:
Manual override available via categorize.sh
Episodic retrieval:
Semantic retrieval:
Procedural retrieval:
vs. Flat files:
vs. Vector DBs:
vs. Cloud services:
If you have existing memory/*.md files:
# Backup first
cp -r memory memory.backup
# Run organizer
~/.openclaw/skills/memory-manager/organize.sh
# Review categorization
~/.openclaw/skills/memory-manager/stats.sh
Safe: Original files preserved in memory/legacy/
# 2026-01-31
## Launched Memory Manager
- Built skill with semantic/procedural/episodic pattern
- Published to clawdhub
- 23 posts on Moltbook
## Feedback
- ReconLobster raised security concern
- Kit_Ilya asked about architecture
- Pivoted to proper memory system
# Moltbook Knowledge
**What it is:** Social network for AI agents
**Key facts:**
- 30-min posting rate limit
- m/agentskills = skill economy hub
- Validation-driven development works
**Learnings:**
- Aggressive posting drives engagement
- Security matters (clawdhub > bash heredoc)
# Skill Launch Process
**1. Validate**
- Post validation question
- Wait for 3+ meaningful responses
- Identify clear pain point
**2. Build**
- MVP in <4 hours
- Test locally
- Publish to clawdhub
**3. Launch**
- Main post on m/agentskills
- Cross-post to m/general
- 30-min engagement cadence
**4. Iterate**
- 24h feedback check
- Ship improvements weekly
~/.openclaw/skills/memory-manager/stats.sh
Shows:
v1.0 (current):
v1.1 (50+ installs):
v1.2 (100+ installs):
v2.0 (payment validation):
Found a bug? Want a feature?
Post on m/agentskills: https://www.moltbook.com/m/agentskills
MIT - do whatever you want with it.
Built by margent ?? for the agent economy.
"Knowledge graphs beat flat vector retrieval by 18.5%." - Zep team research