mirror of
https://gitcode.com/JianFeeeee/TrulyMEM-TrueHumanMEM.git
synced 2026-10-15 12:15:32 +00:00
refactor: update SKILL.md to encourage proactive graph memory usage
- Change positioning from 'enhancement' to 'primary long-term memory' - Add explicit guidelines for when AI must query/update memory - Add query templates for persona and tasks at conversation start - Update all 3 skills: graph-memory, graph-memory-persona, graph-memory-task - Sync bundled-skills with standalone skills
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
---
|
||||
name: graph-memory
|
||||
description: "图记忆工具 - 检索、写入、删除记忆。作为 OpenClaw memory-core 的增强补充,不替代其核心功能"
|
||||
description: "图记忆工具 - 检索、写入、删除记忆。AI 应优先使用图数据库管理长期记忆,将重要事实结构化存储"
|
||||
metadata: {"openclaw": {"requires": {"bins": ["node"]}}}
|
||||
user-invocable: true
|
||||
---
|
||||
@ -9,21 +9,21 @@ user-invocable: true
|
||||
|
||||
让 AI 拥有真正的长期记忆能力。
|
||||
|
||||
> **定位声明**:本工具是 **OpenClaw memory-core 的增强补充**,而非替代。memory-core 负责 session transcripts 和历史消息管理,GraphMemory 提供图数据库形式的结构化长期记忆。两者可并存运行。
|
||||
> **定位声明**:本工具是 AI 的**主要长期记忆系统**。memory-core 管理 session transcripts,GraphMemory 负责结构化长期记忆。AI 在对话中应优先将重要信息写入图数据库,而非依赖 message 历史。
|
||||
|
||||
## 与 memory-core 的关系
|
||||
|
||||
| 功能 | memory-core | GraphMemory (本工具) |
|
||||
|------|-------------|---------------------|
|
||||
| 对话历史 | ✅ 自动保存 messages | ❌ 不管理对话历史 |
|
||||
| 结构化记忆 | ❌ 无 | ✅ 三元组图存储 |
|
||||
| 人设管理 | ❌ 无 | ✅ persona_update/clear |
|
||||
| 任务追踪 | ❌ 无 | ✅ task_create/set_state |
|
||||
| 结构化记忆 | ❌ 无 | ✅ **主要存储** |
|
||||
| 人设管理 | ❌ 无 | ✅ **主要存储** |
|
||||
| 任务追踪 | ❌ 无 | ✅ **主要存储** |
|
||||
| 上下文压缩 | ❌ 无 | ✅ context_rewrite |
|
||||
| 工作记忆链 | ❌ 无 | ✅ working_memory_chain |
|
||||
| **语义搜索** | **❌ 无** | **✅ memory_search** |
|
||||
| **记忆文件读取** | **❌ 无** | **✅ memory_get** |
|
||||
| 自动触发 | ✅ 自动索引检索 | ❌ LLM 可选调用 |
|
||||
| 自动触发 | ✅ 自动索引检索 | ❌ LLM 主动调用 |
|
||||
|
||||
## 核心概念
|
||||
|
||||
@ -204,9 +204,43 @@ AI 会执行:
|
||||
|
||||
## 使用原则
|
||||
|
||||
1. **选择性记忆**:只记住重要和持久的信息
|
||||
2. **结构化**:使用三元组格式存储关系
|
||||
3. **定期清理**:删除过时或错误的信息
|
||||
4. **关联思考**:利用关系进行联想记忆
|
||||
5. **与 memory-core 配合**:对话历史由 memory-core 管理,结构化事实由 GraphMemory 管理
|
||||
6. **主动查询人设**:参考 `graph-memory-persona-force` Skill,在适当时候主动查询用户偏好和决策
|
||||
1. **优先使用图记忆**:对于重要事实、偏好、决策、任务等持久信息,**优先**使用 `commit` 写入图数据库,而非依赖 message 上下文
|
||||
2. **主动检索**:在回答用户问题前,**先调用 `recall` 或 `memory_search`** 检索相关记忆,而非仅凭当前上下文推理
|
||||
3. **结构化**:使用三元组格式存储关系,确保信息可被关联检索
|
||||
4. **定期清理**:删除过时或错误的信息
|
||||
5. **上下文压缩**:当对话过长时,使用 `context_rewrite` 将历史压缩为记忆节点
|
||||
6. **工作记忆**:使用 `working_memory_chain` 获取当前会话的上下文链
|
||||
7. **主动查询人设**:参考 `graph-memory-persona-force` Skill,在适当时候主动查询用户偏好和决策
|
||||
|
||||
## 记忆策略指南
|
||||
|
||||
### 什么时候写入图数据库?
|
||||
|
||||
**必须写入**:
|
||||
- 用户明确说"请记住"、"记住这个"等
|
||||
- 用户透露偏好、习惯、身份信息
|
||||
- 做出重要决策或选择
|
||||
- 创建任务或目标
|
||||
- 关键知识点或学习成果
|
||||
|
||||
**建议写入**:
|
||||
- 对话中重复出现的重要概念
|
||||
- 用户纠正或补充的信息
|
||||
- 项目相关的配置、路径、决策
|
||||
|
||||
**无需写入**:
|
||||
- 临时性问候、寒暄
|
||||
- 一次性问题(如"现在几点")
|
||||
- 已在图数据库中的重复信息
|
||||
|
||||
### 什么时候检索图数据库?
|
||||
|
||||
**必须检索**:
|
||||
- 用户问"我之前说过..."、"你还记得..."
|
||||
- 需要基于历史偏好做推荐或决策
|
||||
- 继续之前的任务或话题
|
||||
|
||||
**建议检索**:
|
||||
- 每次对话开始时,检索用户相关信息
|
||||
- 做推荐前先了解用户偏好
|
||||
- 涉及人设或性格相关的话题
|
||||
|
||||
Reference in New Issue
Block a user