📦 Z1 Memory Palace v3.0

v3.0.0

基于文件的长期 AI 记忆系统,集成 BGE-M3 向量搜索、元数据过滤、复合评分、图邻居扩展与自动记忆管理

0· 30·0 当前·0 累计
0
安全扫描
VirusTotal
可疑
查看报告
OpenClaw
可疑
high confidence
该技能宣称的“零基础设施、本地当前目录”行为,与内含脚本中硬编码的单一用户绝对 vault 路径及路径/名称不匹配不符——该包会修改磁盘文件,若未调整路径直接运行,可能脆弱或带来意外。
评估建议
Don't run these scripts unchanged. Key risks and actions to consider: - The code hardcodes ROOT = /Users/zhouyi0415126.com/ai_matrix/vault/01_core; it will not operate on a palace/ you create in the current directory. Before running, either change ROOT to a safe test directory or run inside a disposable copy of your repository. - The scripts perform filesystem writes (rename backup of manifest, overwrite index files, write graph JSON). Backup your data first and inspect the manifest/index files ...
详细分析 ▾
用途与能力
The skill claims a file-based, zero-infrastructure memory palace you can initialize in the current working directory, but the Python and shell scripts are written to operate on a hardcoded absolute ROOT (/Users/zhouyi0415126.com/ai_matrix/vault/01_core). That means running the provided scripts will not act on the local 'palace/' you create unless you edit the code. This mismatch is unexpected for the claimed purpose and suggests poor packaging or that the code was copied from a single developer's machine.
指令范围
SKILL.md tells the agent/user to create palace/ in the current directory and run pip install FlagEmbedding and the build/query scripts. The code, however, reads/writes manifests, index and graph files under the absolute ROOT path and performs file operations (renaming manifest to a .backup, writing indexes, writing graph_neighbors). auto_maintain.sh also cd's into the hardcoded path and calls scripts under scripts/watchdog/, but the included files are in scripts/ (no watchog subdir). These instructions will either fail or operate on unexpected files; they also perform writes/renames on the user's filesystem (expected for an indexer but important to be explicit).
安装机制
There is no formal install spec; SKILL.md suggests pip install FlagEmbedding. That is a moderate-risk dependency (unknown third-party package) but not inherently malicious. Because this is instruction-only with code files, nothing is automatically written to disk by the registry, but following the instructions will install a third-party Python package and run local scripts that modify files.
凭证需求
The skill does not request environment variables or credentials. However, it expects filesystem access to a specific absolute path and will read and write files there (manifests, index, backups, graph). That filesystem access is proportional for a local memory manager, but the hardcoded path is disproportionate to the 'zero-infrastructure' claim and increases risk of accidental modification of unrelated user data if the path is adapted incorrectly.
持久化与权限
The skill is not marked 'always' and does not itself install persistent agents. It contains an auto_maintain.sh that is intended to be run by a LaunchAgent daily (comment only). If a user or integrator wires this into a scheduler, it will perform recurring writes and rebuilds on the hardcoded vault. That persistent operation would increase blast radius, so treat automated scheduling cautiously.
安全有层次,运行前请审查代码。

运行时依赖

无特殊依赖

安装命令

点击复制
官方npx clawhub@latest install z1-memory-palace
镜像加速npx clawhub@latest install z1-memory-palace --registry https://cn.longxiaskill.com

技能文档

Memory Palace 面向 AI 代理的零基础设施(无需 Docker、无需外部服务)文件型长期记忆系统。

架构 palace/ ├── grand_hall/ # 全局导航、房间地图、日志 ├── chambers/ # 代理专属知识(每代理一间) ├── project_rooms/ # 长期项目存储 ├── reflection_wing/ # 已提炼洞察:原则、内核、模式 ├── dispatch_corridor/ # 任务路由与状态跟踪 ├── conflict_room/ # 冲突解决记录 └── archive_basement/ # 冷存(默认搜索排除)

快速开始 # 1. 初始化宫殿结构 mkdir -p palace/{grand_hall,chambers,project_rooms,reflection_wing,dispatch_corridor,conflict_room,archive_basement} # 2. 安装 BGE-m3 pip install FlagEmbedding # 3. 构建索引 python3 scripts/build_index_bge.py --force # 4. 查询 python3 scripts/query_bge.py "你的搜索词" python3 scripts/query_bge.py --type palace --priority high "查询" python3 scripts/query_bge.py --details "查询" # 显示子分 python3 scripts/query_bge.py --raw "查询" # 纯余弦(v2 兼容)

搜索评分 复合分 = 0.5×语义 + 0.25×时效 + 0.25×重要度 语义:BGE-m3 余弦相似度(截断至 [0,1]) 时效:基于文件 mtime 的 30 天半衰衰减 重要度:priority 映射(high=1.0, medium=0.6, low=0.3)

关键脚本 build_index_bge.py 构建 BGE-m3 向量索引,支持增量维护 query_bge.py 复合评分搜索,支持元数据过滤、raw 模式 graph_router.py 构建 1-hop [[links]] 邻居图 cold_zone_blinding_patch.py 排除 archive_basement 搜索

索引清单格式 watchdog_manifest_v1.jsonl 中每条记录: {"path":"palace/chambers/01_agent/accumulated_knowledge.md","type":"palace","priority":"high"} 字段:path(必填)、type(元数据过滤)、priority(重要度评分)

记忆代谢 详见 references/memory_metabolism.md: 3 级升级路径:Project Room → Reflection Wing → Constitution 5 类输出:principle card、prompt kernel、failure pattern、thinking path、constitution candidate 低价值内容反向淘汰规则

数据来源ClawHub ↗ · 中文优化:龙虾技能库