← 返回 Skills 市场
402
总下载
0
收藏
2
当前安装
1
版本数
在 OpenClaw 中安装
/install memory-dedup
功能描述
Automatically identify, merge, and clean duplicate or outdated entries in MEMORY.md to maintain concise, organized, and up-to-date information.
使用说明 (SKILL.md)
Memory Deduplication — 记忆去重与合并
保持 MEMORY.md 清洁,避免信息冗余
问题
随着时间推移,MEMORY.md 会出现:
- 重复信息 — 同一事件多次记录
- 过时信息 — 已完成的任务仍标记为进行中
- 冗余描述 — 同一项目多处描述
- 碎片化 — 相关信息散落各处
解决方案
1. 自动去重
识别并合并相似内容:
原始:
- AgentAwaken 网站开发中
- AgentAwaken 项目进行中
- AgentAwaken 待部署
合并后:
- AgentAwaken 网站: 开发中,待部署
2. 过时信息清理
原始:
- [P0] NeuroBoost v5.0 发布待重试
更新后:
- [P0] NeuroBoost v5.0 ✅ 已发布 (2026-02-26)
3. 信息聚合
原始:
### AgentAwaken
- 代码: /root/.openclaw/workspace/agentawaken
### AgentAwaken 域名
- agentawaken.xyz 待绑定
### AgentAwaken 部署
- 需要 Vercel
合并后:
### [P0] AgentAwaken 网站
- 代码: /root/.openclaw/workspace/agentawaken
- 域名: agentawaken.xyz (待绑定)
- 部署: Vercel (待配置)
实现
相似度计算
function similarity(text1, text2) {
// Jaccard 相似度
const words1 = new Set(text1.toLowerCase().split(/\s+/));
const words2 = new Set(text2.toLowerCase().split(/\s+/));
const intersection = new Set([...words1].filter(x => words2.has(x)));
const union = new Set([...words1, ...words2]);
return intersection.size / union.size;
}
去重规则
- 相似度 >0.8 — 完全重复,删除
- 相似度 0.5-0.8 — 部分重复,合并
- 相似度 \x3C0.5 — 不同内容,保留
合并策略
- 保留最新时间戳
- 合并所有唯一信息
- 保留最高优先级标记
使用
# 运行去重
node skills/memory-dedup/dedup.mjs
# 预览(不修改文件)
node skills/memory-dedup/dedup.mjs --dry-run
# 备份后去重
node skills/memory-dedup/dedup.mjs --backup
输出示例
=== Memory Deduplication Report ===
📊 统计:
- 原始条目: 87
- 重复条目: 12
- 合并条目: 5
- 删除条目: 7
- 最终条目: 68
🔍 发现的重复:
1. "AgentAwaken 网站开发" (3 次)
→ 合并为 1 条
2. "NeuroBoost v5.0 发布" (2 次)
→ 保留最新版本
✅ MEMORY.md 已优化
💾 备份保存到: memory/MEMORY-backup-2026-03-01.md
定期执行
# 每周日凌晨 2 点自动去重
openclaw cron add --name "memory-dedup-weekly" \
--cron "0 2 * * 0" --tz "Asia/Shanghai" \
--session isolated --agent main \
--message "运行记忆去重,清理 MEMORY.md 冗余信息"
安全措施
- 自动备份 — 去重前备份原文件
- 人工审核 — 生成 diff 供审核
- 可回滚 — 保留最近 10 次备份
- 白名单 — 某些关键信息不去重
效果
- 文件大小减少 30-50%
- 检索速度提升 2-3 倍
- 信息密度提升 40%
- 维护成本降低 60%
安全使用建议
This skill appears coherent with its purpose and contains no network or secret-exfiltration behavior. Before installing/running: (1) run node dedup.mjs --dry-run to preview changes; (2) verify the workspace target (set OPENCLAW_WORKSPACE explicitly if needed) so it edits the intended MEMORY.md; (3) review the backup folder after a real run and confirm diffs; (4) consider running first in an isolated agent/session or on a copy of your repository. If you want stricter guarantees, inspect the script locally (dedup.mjs is small and readable) or run it inside a sandboxed environment.
功能分析
Type: OpenClaw Skill
Name: memory-dedup
Version: 1.0.0
The skill bundle is designed for memory deduplication and cleanup of the `MEMORY.md` file. The `SKILL.md` provides clear instructions for running the `dedup.mjs` script and setting up a weekly cron job using the `openclaw` CLI, all aligned with the stated purpose. The `dedup.mjs` script uses standard Node.js file system modules (`fs`, `path`) to read, process, and write `MEMORY.md` and its backups within the designated workspace. There is no evidence of network communication, arbitrary command execution, access to sensitive system files or credentials, obfuscation, or malicious prompt injection attempts against the agent. All actions are confined to the skill's stated functionality.
能力评估
Purpose & Capability
The name/description (Memory Deduplication) match the contained script and SKILL.md: the tool parses MEMORY.md, finds similar sections, merges/removes them, and writes results. No unrelated binaries, credentials, or external services are requested.
Instruction Scope
SKILL.md instructs running the provided Node script and optionally scheduling a cron job. The runtime instructions and script operate only on MEMORY.md in the workspace and create backups; they do not read network endpoints or other system credentials. Note: the script overwrites MEMORY.md (with backups by default) — use --dry-run to preview changes and review diffs before accepting.
Install Mechanism
No install spec or external downloads; this is an instruction-only/embedded script. The package files are local and there are no archives or remote install URLs, so install-side risk is low.
Credentials
The registry metadata declares no required env vars, which is consistent. The code does read an optional OPENCLAW_WORKSPACE environment variable to determine the workspace path; this env var is not declared in requires.env (it's optional). This is not malicious but worth noting because setting OPENCLAW_WORKSPACE changes which MEMORY.md is edited.
Persistence & Privilege
The skill is not always-enabled and does not request elevated platform privileges. It writes to files within the workspace (MEMORY.md and a memory/ backup folder) which is expected for its purpose. It does not modify other skills or global agent configuration.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install memory-dedup - 安装完成后,直接呼叫该 Skill 的名称或使用
/memory-dedup触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
初始版本:记忆去重与合并,自动识别并合并重复内容,保持MEMORY.md清洁
元数据
常见问题
Memory Deduplication 是什么?
Automatically identify, merge, and clean duplicate or outdated entries in MEMORY.md to maintain concise, organized, and up-to-date information. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 402 次。
如何安装 Memory Deduplication?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install memory-dedup」即可一键安装,无需额外配置。
Memory Deduplication 是免费的吗?
是的,Memory Deduplication 完全免费(开源免费),可自由下载、安装和使用。
Memory Deduplication 支持哪些平台?
Memory Deduplication 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Memory Deduplication?
由 ceelo(@weidadong2359)开发并维护,当前版本 v1.0.0。
推荐 Skills