← 返回
未分类

记忆管家 V2

管理 WorkBuddy .workbuddy/memory 记忆文件、Token 预算、缓存预览、备份导出、导入确认和 PROMPT_ 模板。
aakook
未分类 community v3.0.0 8 版本 99818.5 Key: 无需
★ 2
Stars
📥 510
下载
💾 9
安装
8
版本
#latest

概述

Memory Manager V3

中文摘要:当用户需要管理 WorkBuddy 工作区中的 .workbuddy/memory/ 记忆文件、Token 预算、缓存预览、备份导出、导入恢复或 PROMPT_ 模板时使用此 Skill。

Run commands from this skill directory. Use the bundled CLI:

python memory_manager.py --help
python memory_manager.py <command> <workspace>

is the folder that contains, or should contain, .workbuddy/memory/.

Use For

  • Analyze, search, load, rank, summarize, or report memory files.
  • Check estimated Token usage and trends.
  • Preview cache cleanup and memory cleanup.
  • Export or import memory data with explicit confirmation.
  • Manage prompt templates stored as PROMPT_*.md.

Do not use this skill for general file cleanup, code review, document conversion, or deleting unrelated files.

Inputs

Before running a command, identify:

  • Workspace path.
  • Intended action: read-only, preview, or write.
  • Search keyword, date range, tags, output archive, or prompt content when needed.

Read-Only Commands

These commands inspect data and can run without confirmation:

python memory_manager.py analyze <workspace>
python memory_manager.py search <keyword> <workspace>
python memory_manager.py load <workspace> --days 7
python memory_manager.py rank <workspace>
python memory_manager.py summarize <workspace>
python memory_manager.py report <workspace>
python memory_manager.py token-check <workspace>
python memory_manager.py token-trends <workspace> --period week
python memory_manager.py cache-reminder <workspace>
python memory_manager.py scan <workspace>
python memory_manager.py doctor <workspace>
python memory_manager.py prompt-list <workspace>
python memory_manager.py prompt-search <workspace> --keyword <keyword>

Preview Commands

Cleanup and deduplication commands are preview-only unless --execute is provided:

python memory_manager.py cache-clean <workspace>
python memory_manager.py clean <workspace>
python memory_manager.py auto-clean <workspace>
python memory_manager.py dedup <workspace>

Use --execute only after showing the preview and receiving explicit user confirmation:

python memory_manager.py cache-clean <workspace> --execute
python memory_manager.py clean <workspace> --execute
python memory_manager.py auto-clean <workspace> --execute
python memory_manager.py dedup <workspace> --execute

Export, Import, And Backup

Export writes a ZIP archive:

python memory_manager.py export <workspace> <output.zip>

Import writes files into the workspace and requires --confirm:

python memory_manager.py import <workspace> <input.zip> --confirm

Backup defaults to preview mode. Use --execute only after user confirmation:

python memory_manager.py backup <workspace> --path <backup_dir>
python memory_manager.py backup <workspace> --path <backup_dir> --execute

Prompt Templates

Prompt templates are stored under .workbuddy/memory/ with the PROMPT_ prefix:

python memory_manager.py prompt-list <workspace>
python memory_manager.py prompt-get <name> <workspace>
python memory_manager.py prompt-save <name> <workspace> --content "<prompt text>"
python memory_manager.py prompt-search <workspace> --keyword <keyword>

Language

The CLI supports Chinese and English interface output:

python memory_manager.py --lang zh analyze <workspace>
python memory_manager.py --lang en analyze <workspace>

Safety And Privacy

  • Treat memory files and exported ZIP files as sensitive user data.
  • Do not import, delete, archive, restore, or execute cleanup unless the user explicitly confirms.
  • Prefer preview commands before any write operation.
  • Do not claim permanent memory, automatic sync, perfect accuracy, or absolute safety.
  • Exported archives may contain private information; ask the user where to save them.
  • Import checks ZIP paths and size limits, but important memory changes still require user review.

References

  • Read references/cli-reference.md when exact command syntax is needed.
  • Read references/security.md before import, cleanup, backup, restore, or other write operations.

版本历史

共 8 个版本

  • v3.0.0 ### 新增 - ✅ P2-3:TF-IDF 语义搜索(`--tfidf` 参数) - ✅ P2-4:摘要 JSON schema 版本号(`schema_version: "1.0"`) - ✅ P2-5:跨文件引用 `[[YYYY-MM-DD]]` / `[[MEMORY]]` 支持 - ✅ P2-6:导出加密(`--encrypt` + AES-256-GCM) - ✅ P2-2:pytest 自动化测试套件(69 个用例) ### 修复 - ✅ P1-1:`retention_days` 默认值 1 → 7 - ✅ P1-2:`--agree` / `--force` 参数注册到 5 个破坏性命令 - ✅ P2-1:清理 `__pycache__/` 下 11 个 .pyc 文件 ### 优化 - 性能:7 项 P0/P1 优化补丁(实测降幅 12-99.5%) - 安全:六重 ZIP 防御 + TTY 确认机制 当前
    2026-06-14 21:27 安全 安全
  • v2.8.2 V2.8.2 (2026-05-16) — 中英双语一体版 🔴 P0 致命修复 (Critical Fixes) - 补充 `get_colors()` 函数定义,修复 `cache-clean`/`export`/`import` 崩溃 - 删除 `hashlib.HTTPError` 不存在异常,修正 `dedup` 异常处理 - 消除 UTF-8 BOM 头,修复 Python 语法解析报错 - 修复 `importlib.reload` 崩溃(stdout/stderr 重复 TextIOWrapper 包装) 🟡 P1 核心优化 (Core Optimizations) - **Token 校准**: `TOKEN_RATIO=2` 替换全局 `//4`(中文估算准确度 +2.6×) - **I/O 去重**: `auto_clean_memory` 一次读取替代两次 - **colorama**: 删除未使用的 `COLOR_SUPPORT`,避免双重初始化 - **魔数常量化**: 全部阈值提取为命名常量(`MEMORY_LARGE_SIZE_KB` 等) 🟢 P2 工程提升 (Engineering Improvements) - **jieba 中文分词** + 正则回退,关键词提取精度大幅提升 - **i18n 真国际化**: 6 个展示函数全链路走 `_()` 翻译;`--lang zh/en` CLI;183 键 100% 同步 - **Token 预警**: 新增 `token-check` 命令 + `cache-reminder` 内嵌三色报警 - **短文件防膨胀**: `SUMMARY_MIN_CHARS=500` 阈值,摘要不反向放大 - **安全加固**: 3 个裸 `except:` 全部指定异常类型;Windows 路径穿越修复;`__pycache__` symlink 三重防护 - **触发词扩充**: 13→34 个,覆盖全 17 条命令
    2026-05-16 22:39 安全 安全
  • v2.8.1 ### V2.8.1 变更 - 🆕 **增量加载**:`load --days N` 只加载N天内文件,节省50-70% Token - 🆕 **摘要压缩**:输出限制300字符,再省30% Token - 🔒 **安全修复**:cache_clean路径穿越修复、ZIP导入安全防护、dedup交互确认 - 🧹 **代码瘦身**:main()精简36%,SKILL.md精简86%,删除4个冗余文件
    2026-05-01 19:09 安全 安全
  • v2.6.3 V2.6.3 (2026-04-28) - 当前版本 🛡️ 新增:函数层面强制 confirm 参数(静态分析更安全) 🛡️ 新增:execute_cleanup / archive_old_memory 默认不删除 V2.6.2 (2026-04-28) 🛡️ 新增:归档操作需用户确认(回复"同意") 🛡️ 新增:设置向导需用户确认(回复"同意") V2.6.1 (2026-04-28) 🔧 修复:manifest异常处理 🔧 修复:safe_file_read 大文件分块读取 ⚡ 优化:scan_workspace 使用 os.scandir 提升 3-5 倍性能 V2.6.0 (2026-04-27) 🆕 新增:doctor 诊断工具 🆕 新增:wizard 设置向导 🆕 新增:feedback 用户反馈 V2.5.0 (2026-04-20) 🆕 新增:dedup 内容去重 🆕 新增:stats Token统计 🆕 新增:backup 本地备份 🆕 新增:schedule 定时任务 安全机制 函数 confirm 默认值 说明 execute_cleanup() False 两阶段:预览→确认→删除 archive_old_memory() False 先归档,确认后删除原文件 确认机制 clean 命令:预览待删文件 → 回复"同意" → 执行 archive 命令:先归档 → 回复"同意" → 删除原文件 wizard 命令:执行前提示目录结构 dedup 命令:默认 dry-run,需 --execute restore 命令:默认 dry-run,需 --execute 风险披露 风险类型 处理方式 文件删除 需用户回复"同意"确认 文件归档 需用户回复"同意"确认 目录创建 需用户回复"同意"确认
    2026-04-28 23:54 安全 安全
  • v2.6.2 V2.6.2 (2026-04-28) - 当前版本 🛡️ 新增:归档操作需用户确认(回复"同意") 🛡️ 新增:设置向导需用户确认(回复"同意") V2.6.1 (2026-04-28) 🔧 修复:manifest异常处理 🔧 修复:safe_file_read 大文件分块读取 ⚡ 优化:scan_workspace 使用 os.scandir 提升 3-5 倍性能 V2.6.0 (2026-04-27) 🆕 新增:doctor 诊断工具 🆕 新增:wizard 设置向导 🆕 新增:feedback 用户反馈 V2.5.0 (2026-04-20) 🆕 新增:dedup 内容去重 🆕 新增:stats Token统计 🆕 新增:backup 本地备份 🆕 新增:schedule 定时任务 风险披露 风险类型 处理方式 文件删除 需用户回复"同意"确认 文件归档 需用户回复"同意"确认 目录创建 需用户回复"同意"确认 确认机制 clean 命令:回复"同意"确认 archive 命令:归档后提示确认 wizard 命令:执行前提示目录结构 dedup 命令:默认 dry-run,需 --execute restore 命令:默认 dry-run,需 --execute
    2026-04-28 23:38 安全
  • v2.6.1 V2.6.1 (2026-04-28) - 当前版本 - 🔧 修复:manifest_file.read_text() 异常处理 - 🔧 修复:备份恢复时 manifest 损坏崩溃 - 🔧 修复:safe_file_read 大文件分块读取 - ⚡ 优化:scan_workspace 使用 os.scandir 提升3-5倍性能 V2.6.0 (2026-04-27) - 🆕 新增:doctor 诊断工具 - 🆕 新增:wizard 设置向导 - 🆕 新增:feedback 用户反馈 V2.5.0 (2026-04-20) - 🆕 新增:dedup 内容去重 - 🆕 新增:stats Token统计 - 🆕 新增:backup 本地备份 - 🆕 新增:schedule 定时任务
    2026-04-28 23:11 安全
  • v2.2.0 📊 功能对比 功能 V2.0 V2.1 V2.2 分析/扫描/清理 ✅ ✅ ✅ 归档/HTML报告 ❌ ✅ ✅ 摘要生成 ❌ ❌ ✅ 重要性分级 ❌ ❌ ✅ 智能加载 ❌ ❌ ✅ 全文搜索 ❌ ❌ ✅ TOKEN节省 30% 30-50% 50-80% 🛡️ 安全特性 ✅ 预览确认:清理前显示清单,确认后再执行 ✅ 受保护目录:.workbuddy/memory/ 和 .workbuddy/skills/ 永不删除 ✅ 符号链接防护:防止路径穿越攻击 ✅ 文件大小限制:单文件最大1MB,累计不超过5MB ✅ Dry Run模式:预览不实际删除 🎯 适用人群 AI重度用户 - 经常使用Claude、ChatGPT等AI助手 多项目管理者 - 同时维护多个工作空间 知识工作者 - 需要长期积累和复用对话记忆 开发者 - 使用WorkBuddy/Cody等AI编程工具 📦 包含文件 文件 说明 SKILL.md WorkBuddy技能配置 memory_manager.py 主程序(十大功能) analyze_memory.py 记忆分析模块 scan_workspace.py 工作空间扫描模块 memory_guide.md 使用指南 🚀 未来规划 (V2.3) dedup: 基于内容哈希去重 stats: Token消耗趋势图 backup: 云端备份支持 schedule: 定时自动整理 ⭐ 评价文案 短评(20字) "对话历史一键整理,Token消耗直降80%" 中评(50字) "用了记忆管家后,AI响应明显变快,核心记忆自动分级,再也不用翻半天找历史记录了" 好评(100字) "强烈推荐!作为一个同时管理多个项目的PM,记忆管家帮我把混乱的对话历史整理得井井有条。摘要生成+智能加载的组合拳,Token消耗直接砍半,AI回复速度肉眼可见地快了。绝对是AI重度用户的必备工具!" 版本:V2.2.0 | 核心升级:TOKEN节省50-80%
    2026-04-27 00:06 安全 安全
  • v1.0.0 Initial release
    2026-04-26 19:18 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-agent

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,398 📥 322,866
office-efficiency

MD格式互转工具

user_98283d0f
>支持 Markdown 与 PDF、Word、HTML、纯文本等 8 种格式双向互转的本地文档处理工具,支持中英日韩四种语言.
★ 0 📥 58
ai-agent

self-improving agent

pskoett
捕获经验教训、错误及修正内容,以实现持续改进。适用于以下场景:(1)命令或操作意外失败;(2)用户纠正Claude(如“不,那不对……”“实际上……”);(3)用户请求的功能不存在;(4)外部API或工具出现故障;(5)Claude发现自身
★ 4,103 📥 829,342