ljsysfurry commited on
Commit
00d2fe6
·
verified ·
1 Parent(s): 0b326b5

sync cleaned docs: dsh-plugin/memory-director/README.md

Browse files
dsh-plugin/memory-director/README.md ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dsh-memory-director
2
+
3
+ **MemoryDirector 插件** —— 给 DeepSeek Harness 加"长期记忆"能力。
4
+
5
+ 官方 Harness 的 compaction 只做**摘要压缩**,没有任何"跨会话记住重要事实"的概念。
6
+ 这个插件补上 AgentFrame 的 MemoryDirector:
7
+
8
+ - **每轮对话后**:LLM 分析本轮,决定记住什么 / 忘记什么
9
+ - **每次请求前**:检索相关记忆,注入模型上下文
10
+ - **持久化**:记忆存 JSON 文件(`~/.dsh/memory.json`)
11
+
12
+ ## 为什么是差异化
13
+
14
+ | 能力 | 官方 Harness | dsh-memory-director |
15
+ |------|-------------|---------------------|
16
+ | 上下文压缩 | compaction | (可配合) |
17
+ | **记住重要事实** | × 没有 | **LLM 决策** |
18
+ | **跨会话记忆** | × | 持久化 |
19
+ | **记忆检索注入** | × | pre-step 注入 |
20
+ | **遗忘管理** | × | 重要度衰减 |
21
+
22
+ ## 接入
23
+
24
+ ```yaml
25
+ # profile 的 cordis.patch.yml
26
+ - id: memory-director
27
+ name: '@agentframe/dsh-memory-director'
28
+ config:
29
+ provider: deepseek-official
30
+ model: deepseek-v4-flash
31
+ maxTokens: 256
32
+ dedupThreshold: 0.8
33
+ forgetThreshold: 0.1
34
+ storePath: ~/.dsh/memory.json
35
+ auto: true
36
+ ```
37
+
38
+ ## 机制
39
+
40
+ ```
41
+ agent/turn-stopping (每轮结束)
42
+ → 提取本轮文本 → LLM 决策 {remember, forget, importance}
43
+ → remember → 存入记忆库 (去重)
44
+ → forget → 删除过时记忆
45
+
46
+ agent/pre-step (每次请求前)
47
+ → 取最后用户消息 → 检索相关记忆
48
+ → 注入 system 消息 (memory-director block)
49
+ → 模型可基于记忆回答
50
+ ```
51
+
52
+ ## 配置
53
+
54
+ | 字段 | 默认 | 说明 |
55
+ |------|------|------|
56
+ | `provider` | deepseek-official | 决策用 provider |
57
+ | `model` | deepseek-v4-flash | 决策用模型 (便宜快速) |
58
+ | `maxTokens` | 256 | 决策输出上限 |
59
+ | `dedupThreshold` | 0.8 | 记忆去重阈值 |
60
+ | `forgetThreshold` | 0.1 | 遗忘阈值 (重要度衰减) |
61
+ | `storePath` | ~/.dsh/memory.json | 持久化路径 |
62
+ | `auto` | true | 自动挂钩 agent 循环 |
63
+
64
+ ## License
65
+
66
+ GPL-3.0 © Cloud LTE Studio / AgentFrame