Auto-sync: TOOLS标准模板.md 新增第20章 memory-lancedb-pro 场景指令手册 (2026-04-11)
This commit is contained in:
@@ -791,3 +791,86 @@ ssh ubuntu2 'proxychains4 docker build --pull=false -t <image>:<tag> <dockerfile
|
||||
- **--pull=false**: 在已有本地镜像时使用,避免 build 过程中再次拉取基础镜像(耗时且仍可能失败)
|
||||
- **apt-get 不走代理**: Docker build 过程中 apt-get install 走的是直连 Debian 源,不受影响
|
||||
- **Docker daemon vs client**: proxychains4 包裹的是 docker 命令,而非 dockerd 守护进程
|
||||
|
||||
## 20. memory-lancedb-pro 场景指令手册
|
||||
|
||||
### 概述
|
||||
|
||||
基于 LanceDB 的长期记忆系统,支持向量+BM25 混合检索、LLM 智能分类、Weibull 衰减。六种分类:`fact` `entity` `preference` `decision` `reflection` `other`。
|
||||
|
||||
| 分类 | 适用场景 |
|
||||
|------|---------|
|
||||
| `fact` | 客观事实、知识 |
|
||||
| `entity` | 实体、人物、项目 |
|
||||
| `preference` | 用户偏好、设置 |
|
||||
| `decision` | 决策记录、结论 |
|
||||
| `reflection` | 反思、复盘 |
|
||||
| `other` | 其他 |
|
||||
|
||||
### 场景一:列出记忆
|
||||
**你说:** "列出 memory-lancedb-pro 记忆"
|
||||
**Agent 调用:** `memory_list(limit=20)`
|
||||
**返回:**
|
||||
```
|
||||
• [fact] 用户偏好 MacBook Pro 作为开发机 (0.9)
|
||||
• [entity] NAS 照片项目共 283,801 文件 (0.8)
|
||||
• [decision] Memory-Pro 选用 nomic-embed-text (0.7)
|
||||
...
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 场景二:搜索记忆
|
||||
**你说:** "搜索 memory-lancedb-pro 里有没有关于 xxx 的记忆"
|
||||
**Agent 调用:** `memory_recall(query="xxx", limit=5)`
|
||||
**返回:**
|
||||
```
|
||||
[2 条相关]
|
||||
1. [entity|0.8] NAS照片整理项目(2026-03-31启动)...
|
||||
2. [other|0.6] ...
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 场景三:存储记忆
|
||||
**你说:** "帮我记住 xxx"
|
||||
**Agent 调用:** `memory_store(text="xxx", category="fact", importance=0.8)`
|
||||
**返回:** `✅ 已存储 [fact] "xxx" (0.8)`
|
||||
|
||||
---
|
||||
|
||||
### 场景四:更新记忆
|
||||
**你说:** "帮我更新记忆,改为 xxx"
|
||||
**Agent 调用:** `memory_update(memoryId="<ID>", text="新内容")`
|
||||
**返回:** `✅ 已更新 ID: a2d1fb54`
|
||||
|
||||
---
|
||||
|
||||
### 场景五:删除记忆
|
||||
**你说:** "帮我删除 xxx 这条记忆"
|
||||
**Agent 调用:**
|
||||
```
|
||||
memory_recall(query="xxx") # 先确认
|
||||
memory_forget(memoryId="<找到的ID>") # 再删除
|
||||
```
|
||||
**返回:** `✅ 已删除 ID: a2d1fb54`
|
||||
|
||||
---
|
||||
|
||||
### 场景六:查询统计
|
||||
**你说:** "memory-lancedb-pro 有多少条记忆"
|
||||
**Agent 调用:** `memory_stats()`
|
||||
**返回:** `总计:146 条 / other:69 / fact:25 / entity:19 / ...`
|
||||
|
||||
---
|
||||
|
||||
### 快速对照表
|
||||
|
||||
| 你的需求 | Agent 调用 | 关键参数 |
|
||||
|---------|-----------|---------|
|
||||
| 列出记忆 | `memory_list` | `limit`, `scope`, `category` |
|
||||
| 搜索记忆 | `memory_recall` | `query`, `limit` |
|
||||
| 记住新内容 | `memory_store` | `text`, `category`, `importance` |
|
||||
| 更新已有记忆 | `memory_update` | `memoryId`, `text` |
|
||||
| 删除记忆 | `memory_forget` | `memoryId` 或 `query` |
|
||||
| 看有多少条 | `memory_stats` | `scope` |
|
||||
|
||||
Reference in New Issue
Block a user