Agent Memory Skill 提供一个持久化、可搜索的记忆库,能够自动与项目文档同步。它以 MCP 服务器的方式运行,允许对长期记忆进行读取、写入和搜索。
用途 该技能用于为 AI 智能体建立长期知识管理能力,覆盖架构(Architecture)、模式(Patterns)、决策(Decisions)等类型的知识,使智能体能够跨会话保存和检索项目相关的记忆内容。
前置条件 需要 Node.js(v18+)。
安装与启动
-
克隆仓库:将 agentMemory 项目克隆到智能体工作区或并行目录: git clone https://github.com/webzler/agentMemory.git .agent/skills/agent-memory
-
安装依赖: cd .agent/skills/agent-memory npm install npm run compile
-
启动 MCP 服务器:使用辅助脚本为当前项目激活记忆库: npm run start-server <project_id> <absolute_path_to_target_workspace>
当前目录示例: npm run start-server my-project $(pwd)
主要能力(MCP 工具)
- memory_search:按查询、类型或标签搜索记忆。参数:query(字符串)、type?(字符串)、tags?(字符串数组)。示例:"Find all authentication patterns" -> memory_search({ query: "authentication", type: "pattern" })
- memory_write:记录新知识或决策。参数:key(字符串)、type(字符串)、content(字符串)、tags?(字符串数组)。示例:"Save this architecture decision" -> memory_write({ key: "auth-v1", type: "decision", content: "..." })
- memory_read:按键检索特定记忆内容。参数:key(字符串)。示例:"Get the auth design" -> memory_read({ key: "auth-v1" })
- memory_stats:查看记忆使用情况的分析数据。示例:"Show memory statistics" -> memory_stats({})
仪表盘 该技能包含一个独立仪表盘,用于可视化记忆使用情况: npm run start-dashboard <absolute_path_to_target_workspace> 访问地址:http://localhost:3333
适用场景 适用于需要为 AI 智能体维护长期、可检索项目知识的场景,例如保存架构设计、记录模式与决策,并在后续任务中按查询、类型或标签检索这些内容。
限制 资料未提供关于收费、价格、平台兼容范围、性能效果等方面的信息,暂未提供。