dsh-context-graph 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,144 +1,148 @@
1
- # dsh-context-graph
2
-
3
- A DeepSeek Harness (dsh) plugin that remembers your past conversations as a small graph.
4
- New sessions start with a one-screen map of what was decided before, each turn gets the few
5
- nodes that match what you just asked, and the model fetches the verbatim original text only
6
- when it needs it. Old messages stop being re-sent; decisions stop getting lost.
7
-
8
- **Folding (v0.2.0).** Every chat normally re-sends all earlier messages on every turn. Once the
9
- older part of a chat costs more than `foldAtTokens` per request, the plugin replaces it with one
10
- short table of contents: the topics found in it and a one-line list of what you asked in each
11
- turn (t1, t2, ...). The model follows that table to the exact part it needs with `recall("t7")`
12
- or `recall("n12")`. Your newest turns stay word for word. Nothing is deleted: the full turns stay
13
- in the session log and in the chat window.
14
-
15
- **Looks like dsh (v0.3.0).** The Plugins page shows the plugin's own icon in dsh's icon style, a
16
- title and description in English or Chinese (上下文图谱), and a Chinese detail page. In chat,
17
- `/context-graph` results appear in dsh's own command card: a titled row with a one-line summary
18
- that expands to the details.
19
-
20
- Status: v0.3.0. Installs and loads in the dsh desktop app (dsh 0.2.1-rc.5); folding and indexing
21
- are not yet verified with a live model. 28 tests pass against the published dsh packages.
22
-
23
- Using Claude Code instead? The Claude version is a separate plugin built for Claude's app:
24
- [claude-context-graph](https://github.com/William20100221/claude-context-graph).
25
-
26
- ## What it does
27
-
28
- | Moment | What happens | Cost |
29
- |---|---|---|
30
- | Every 4 human turns (default) | After the turn closes, one small auxiliary model call indexes the new messages into `.context-graph/graph.json` and stores the cited messages verbatim under `.context-graph/src/`. | about the span's tokens in, under 1k out, off the critical path |
31
- | First human turn of a session | A `[context-graph]` block lists the best-connected nodes from earlier sessions: id, label, one-line gist. | about 15 tokens per node, 40 nodes max |
32
- | Every human turn | The prompt is matched against node labels and aliases by word overlap (no model call). Up to 5 hits are appended to the message. One clearly dominant short hit is included verbatim. | under about 150 tokens |
33
- | Older part of this chat costs more than 24k tokens per request | At the start of your next turn it is replaced by a table of contents (topics plus one line per turn). The last 2 turns stay as they are. | breaks the provider cache once per fold, then every later request is smaller |
34
- | Model calls `recall(id)` | `n12`: the topic's verbatim source and neighbours. `t7`: folded turn 7 exactly, including tool calls. | one tool round trip |
35
- | `/context-graph` | `stats`, `build` (index now), `fold` (index and fold now), `find <words>`. | none |
36
-
37
- Design rules, in order of importance:
38
-
39
- 1. **Nothing is written without its source.** A node is stored only together with the verbatim
40
- messages it was drawn from. The gist is a pointer, never the record.
41
- 2. **Fold in batches, not every turn.** DeepSeek bills re-sent cached input at about 1/30 price,
42
- and any fold restarts that cache. So a fold happens only when the old part is large
43
- (24k tokens by default) and the table of contents is under half its size. Between folds the
44
- prefix stays stable and cached. Matcher blocks ride at the end of the newest message.
45
- 3. **Old decisions resolve to new ones.** A `supersedes` edge makes a hit on the old node show
46
- the replacement instead.
47
- 4. **Matching is lexical.** Labels, aliases and gists; English words, identifiers and Chinese
48
- bigrams. The builder is asked to write aliases precisely so this works without embeddings.
49
-
50
- The full design, including what was borrowed from `dsh-plugin-save-token` and why cache
51
- economics make cross-session memory the main win, is in [docs/core-design.md](docs/core-design.md).
52
-
53
- ## Install
54
-
55
- Desktop app: **Plugins → Add plugin**, official npm registry, enter `dsh-context-graph`,
56
- install, then fully restart the app so the `/context-graph` command appears.
57
-
58
- Command line (use the profile your app runs; the desktop app uses `desktop`):
59
-
60
- ```sh
61
- dsh plugin --profile desktop add dsh-context-graph
62
- ```
63
-
64
- **Updates.** dsh 0.2.1 desktop builds have no update check for third-party plugins, so the
65
- plugin checks npm itself once per app start. When a newer version exists, your next chat reply
66
- ends with one line saying so, and `/context-graph stats` shows it on its first line. To update:
67
- Plugins, open dsh-context-graph, **Uninstall**, then **Add plugin** `dsh-context-graph@<new version>`
68
- and restart the app. Name the exact version: dsh's pnpm holds back very new releases otherwise.
69
- Turn the check off with the environment variable `DSH_CONTEXT_GRAPH_NO_UPDATE_CHECK=1`.
70
-
71
- Remove with `dsh plugin --profile desktop remove dsh-context-graph`.
72
-
73
- ## Releasing a new version
74
-
75
- ```sh
76
- npm test
77
- npm version patch
78
- npm publish
79
- git push --follow-tags
80
- ```
81
-
82
- `npm version patch` bumps the version, commits and tags it. `npm publish` needs `npm login`
83
- once. Users then see the new version after pressing Refresh on the Plugins page.
84
-
85
- ## Configuration
86
-
87
- Defaults live in [cordis.patch.yml](cordis.patch.yml). A patch replaces the row's whole
88
- `config`, so restate every key you keep.
89
-
90
- | Key | Default | Meaning |
91
- |---|---|---|
92
- | `dir` | `.context-graph` | Graph folder, relative to the agent workspace or absolute |
93
- | `buildEveryTurns` | `4` | Index after this many new human turns |
94
- | `buildMinChars` | `400` | ...and at least this much new text |
95
- | `maxHits` | `5` | Nodes shown per human turn |
96
- | `inlineMaxChars` | `1200` | A single dominant hit this short is shown verbatim |
97
- | `surfaceMaxNodes` | `40` | Nodes listed at the start of a session |
98
- | `builderMaxTokens` | `8192` | Output cap for the indexing call; thinking models spend part of it reasoning |
99
- | `provider`, `model` | `''` | Empty: reuse the conversation's routed provider and model |
100
- | `fold` | `true` | Fold old turns of the current chat into a table of contents |
101
- | `foldAtTokens` | `24000` | Fold once the foldable part costs this much per request |
102
- | `keepTurns` | `2` | Newest human turns never folded |
103
-
104
- ## Files
105
-
106
- ```
107
- index.js dsh plugin: builder, matcher, recall tool, meter, /context-graph command
108
- graph.js pure core: tokenize, match, merge, render, builder prompt and parser
109
- store.js graph.json and src/<id>.md read/write
110
- update.js once-per-start check of npm for a newer version
111
- lib/client.js dsh chat card for /context-graph (DisclosureRow, en/zh titles)
112
- icon.svg Plugins page icon in dsh's built-in icon style
113
- locale/ Plugins page title and description (en, zh); zh links README.zh.md
114
- cordis.patch.yml mounts the plugin at the profile root with default config
115
- test/ node --test; plugin.test.js needs DSH_NODE_MODULES (see below)
116
- docs/ design
117
- ```
118
-
119
- ## Testing
120
-
121
- Unit tests need nothing:
122
-
123
- ```sh
124
- node --test test/graph.test.js
125
- ```
126
-
127
- The wiring test imports the real dsh packages from an existing dsh install. Point it at that
128
- install's `node_modules`:
129
-
130
- ```sh
131
- DSH_NODE_MODULES=/path/to/dsh/node_modules npm test
132
- ```
133
-
134
- Without the variable it is skipped. Nothing here calls a model.
135
-
136
- ## Known limits
137
-
138
- - Builds are indexed per process; after a restart the first build of a resumed session re-reads
139
- its whole surface. Existing ids are reused, so this costs one larger call, not duplicates.
140
- - Two agents writing the same workspace graph at once: last writer wins.
141
- - Subagent sessions are neither indexed nor given memory blocks.
142
- - Tool outputs are not indexed as topics, but they are folded and `recall("tN")` returns them (each capped at 2000 characters).
143
- - Only indexed turns are folded. After an app restart the index position resets, so the first fold waits for one build.
144
- - A skill list or runtime-context message inside the folded part is copied into the fold message so the model keeps it.
1
+ # dsh-context-graph
2
+
3
+ A DeepSeek Harness (dsh) plugin that gives each chat a small memory graph you switch on when you
4
+ want it. Other chats in the same workspace then get a short pointer to what was decided before, and
5
+ the model fetches the exact original text only when it needs it. Old messages are not re-sent;
6
+ decisions are not lost.
7
+
8
+ First principle: save input tokens without losing quality. The plugin adds nothing to a request
9
+ unless you turned memory on in that chat, and what it adds is a few lines that point at exact text.
10
+
11
+ Status: v0.4.0. Loads in the dsh desktop app (dsh 0.2.1-rc.5); not yet verified with a live model.
12
+ Tests pass against the published dsh packages.
13
+
14
+ Using Claude Code instead? The Claude version is a separate plugin built for Claude's app:
15
+ [claude-context-graph](https://github.com/William20100221/claude-context-graph).
16
+
17
+ ## How it works
18
+
19
+ Nothing happens in a chat until you run `/context-graph on`. From then on:
20
+
21
+ | Moment | What happens | Cost |
22
+ |---|---|---|
23
+ | `/context-graph on` | The chat is indexed now, then again every 4 human turns: one small auxiliary model call writes topics into `.context-graph/chats/<chat>/graph.json` and stores the cited messages verbatim. | about the new text's tokens in, under 1k out, off the critical path |
24
+ | First message after `on` | One block lists the shared chats of this workspace, newest first: chat id, date, title, topic count. | about 15 tokens per chat |
25
+ | Every human message | Your words are matched against the topics of the other shared chats by word overlap (no model call). Up to 5 hits are appended to the message. One clearly dominant short hit is included verbatim. | under about 150 tokens |
26
+ | Your message names a time | "yesterday", "last week", "11月1日", "2026-11-01" ... that slice is searched first: chats active then, then topics from then, then everything. If nothing matches, the chats from that time are listed instead. | same |
27
+ | Model calls `recall(id)` | `c3n12`: the topic's verbatim source and linked topics. `c3`: a chat's topics. `2026-11-01`: every chat and topic from that day. `t7`: turn 7 of this chat word for word. | one tool round trip |
28
+ | `/context-graph share` | Lets other chats in the workspace see this chat's graph. Nothing is copied or merged; it is a flag on the chat. | none |
29
+
30
+ Design rules, in order:
31
+
32
+ 1. **Off until asked.** No surface map, no matches, no indexing in a chat that has not run `on`.
33
+ 2. **Nothing is written without its source.** A topic is stored only together with the verbatim
34
+ messages it was drawn from. The gist is a pointer, never the record.
35
+ 3. **Organise, never merge.** Each chat's graph stays in its own folder with its own dates. Sharing
36
+ is a flag. Ids carry the chat number (`c3n12`) so every topic traces back to its chat.
37
+ 4. **Time is the first filter.** A named day or week narrows the search before anything else.
38
+ 5. **Append at the end.** Injected blocks ride at the tail of the newest message so the provider's
39
+ prefix cache survives. Hiding or folding old turns is not this plugin's job.
40
+
41
+ ## Commands
42
+
43
+ Type `/context-graph`, pick it from the menu, then type the word:
44
+
45
+ | Command | Does |
46
+ |---|---|
47
+ | `on` / `off` | Start or stop memory for this chat. `off` keeps the graph file. |
48
+ | `share` / `unshare` | Let other chats in the workspace use this chat's graph, or stop. |
49
+ | `stats` (default) | Memory state, topic counts, shared chats, pending turns, token counters. |
50
+ | `build` | Index this chat now. |
51
+ | `map` | Every chat in the workspace, newest first, with its top topics. |
52
+ | `find <words>` | Search the shared chats; time words narrow it. |
53
+
54
+ Results show in dsh's own command card: a one-line summary that expands to the details.
55
+
56
+ ## Install
57
+
58
+ Desktop app: **Plugins → Add plugin**, official npm registry, enter `dsh-context-graph`,
59
+ install, then fully restart the app so the `/context-graph` command appears.
60
+
61
+ Command line (use the profile your app runs; the desktop app uses `desktop`):
62
+
63
+ ```sh
64
+ dsh plugin --profile desktop add dsh-context-graph
65
+ ```
66
+
67
+ **Updates.** dsh 0.2.1 desktop builds have no update check for third-party plugins, so the
68
+ plugin checks npm itself once per app start. When a newer version exists, your next chat reply
69
+ ends with one line saying so, and `/context-graph stats` shows it on its first line. To update:
70
+ Plugins, open dsh-context-graph, **Uninstall**, then **Add plugin** `dsh-context-graph@<new version>`
71
+ and restart the app. Name the exact version: dsh's pnpm holds back very new releases otherwise.
72
+ Turn the check off with the environment variable `DSH_CONTEXT_GRAPH_NO_UPDATE_CHECK=1`.
73
+
74
+ Remove with `dsh plugin --profile desktop remove dsh-context-graph`.
75
+
76
+ ## Releasing a new version
77
+
78
+ ```sh
79
+ npm test
80
+ npm version patch
81
+ npm publish
82
+ git push --follow-tags
83
+ ```
84
+
85
+ ## Configuration
86
+
87
+ Defaults live in [cordis.patch.yml](cordis.patch.yml). A patch replaces the row's whole
88
+ `config`, so restate every key you keep.
89
+
90
+ | Key | Default | Meaning |
91
+ |---|---|---|
92
+ | `dir` | `.context-graph` | Memory folder, relative to the agent workspace or absolute |
93
+ | `buildEveryTurns` | `4` | Index after this many new human turns (chats with memory on) |
94
+ | `buildMinChars` | `400` | ...and at least this much new text |
95
+ | `maxHits` | `5` | Topics shown per human turn |
96
+ | `inlineMaxChars` | `1200` | A single dominant hit this short is shown verbatim |
97
+ | `surfaceMaxChats` | `20` | Chats listed right after `on` |
98
+ | `builderMaxTokens` | `8192` | Output cap for the indexing call; thinking models spend part of it reasoning |
99
+ | `provider`, `model` | `''` | Empty: reuse the conversation's routed provider and model |
100
+
101
+ ## Files
102
+
103
+ ```
104
+ index.js dsh plugin: builder, matcher, recall tool, meter, /context-graph command
105
+ graph.js pure core: tokenize, match, time ranges, merge, render, builder prompt and parser
106
+ store.js chats/<chat>/{meta.json, graph.json, src/<id>.md}
107
+ update.js once-per-start check of npm for a newer version
108
+ lib/client.js dsh chat card for /context-graph (DisclosureRow, en/zh titles)
109
+ icon.svg Plugins page icon in dsh's built-in icon style
110
+ locale/ Plugins page title and description (en, zh); zh links README.zh.md
111
+ cordis.patch.yml mounts the plugin at the profile root with default config
112
+ test/ node --test; plugin.test.js needs DSH_NODE_MODULES (see below)
113
+ ```
114
+
115
+ On disk, per workspace:
116
+
117
+ ```
118
+ .context-graph/chats/<sessionId>/meta.json cid, title, startedAt, lastActiveAt, turns, memory, shared
119
+ .context-graph/chats/<sessionId>/graph.json topics and links; every topic has its time
120
+ .context-graph/chats/<sessionId>/src/<id>.md verbatim messages behind each topic
121
+ ```
122
+
123
+ ## Testing
124
+
125
+ Unit tests need nothing:
126
+
127
+ ```sh
128
+ node --test test/graph.test.js
129
+ ```
130
+
131
+ The wiring test imports the real dsh packages from an existing dsh install. Point it at that
132
+ install's `node_modules`:
133
+
134
+ ```sh
135
+ DSH_NODE_MODULES=/path/to/dsh/node_modules npm test
136
+ ```
137
+
138
+ Without the variable it is skipped. Nothing here calls a model.
139
+
140
+ ## Known limits
141
+
142
+ - Builds are indexed per process; after a restart the first build of a resumed chat re-reads its
143
+ whole surface. Existing ids are reused, so this costs one larger call, not duplicates.
144
+ - Two agents writing the same chat's graph at once: last writer wins.
145
+ - Subagent sessions are neither indexed nor given memory blocks.
146
+ - Tool outputs are not indexed as topics; `recall("tN")` returns them (each capped at 2000 characters).
147
+ - The chat title is the first message, shortened, until dsh exposes its own titles to plugins.
148
+ - The graph page (a visual map in the sidebar) is not built yet; `/context-graph map` is the text version.
package/README.zh.md CHANGED
@@ -1,25 +1,44 @@
1
1
  # 上下文图谱(dsh-context-graph)
2
2
 
3
- DeepSeek Harness 插件:把过往对话记成一张小型主题图谱,并把长对话的旧轮次折叠成目录,让每次请求少发送输入 token。需要细节时,模型按目录找到原文。
3
+ DeepSeek Harness 插件:给每个对话一张小型记忆图谱,由你决定何时开启。同一工作区里的其他对话会收到几行指向过往结论的提示,模型需要细节时再取回原文。旧消息不再重复发送,结论也不会丢失。
4
+
5
+ 第一原则:在不损失质量的前提下减少输入 token。没有在某个对话里运行 `/context-graph on`,插件不会往请求里加任何内容。
4
6
 
5
7
  ## 它做什么
6
8
 
9
+ 在对话里运行 `/context-graph on` 之后:
10
+
7
11
  | 时机 | 发生了什么 |
8
12
  |---|---|
9
- | 每 4 轮人类发言 | 回合结束后,用一次小型模型调用把新内容整理进 `.context-graph/graph.json`,并原样保存被引用的消息。不会拖慢回复。 |
10
- | 新对话的第一条消息 | 附上之前对话中最重要的主题(编号、名称、一句话要点),最多 40 条。 |
11
- | 每条人类消息 | 按词语重合匹配图谱(不调用模型),把最多 5 个相关主题附在消息末尾。 |
12
- | 对话旧内容每次请求超过约 24k token | 在下一轮开始时,把旧轮次替换为一份目录:主题列表加每轮一句话。最近 2 轮保持原样。原文不删除,聊天窗口照常显示。 |
13
- | 模型调用 `recall` | `n12`:返回该主题的原文和相邻主题。`t7`:原样返回被折叠的第 7 轮,包括工具输出。 |
13
+ | `/context-graph on` | 立即索引当前对话,之后每 4 轮人类发言再索引一次:一次小型模型调用把主题写进 `.context-graph/chats/<对话>/graph.json`,并原样保存被引用的消息。不会拖慢回复。 |
14
+ | 开启后的第一条消息 | 附上本工作区已共享的对话列表(最新在前):对话编号、日期、标题、主题数。 |
15
+ | 每条人类消息 | 按词语重合匹配其他已共享对话的主题(不调用模型),把最多 5 个相关主题附在消息末尾。唯一且很短的命中会直接附原文。 |
16
+ | 消息里提到时间 | “昨天”“上周”“11月1日”“2026-11-01”……先搜那个时间段:先按对话,再按主题,最后才搜全部。没有命中时,列出那段时间的对话。 |
17
+ | 模型调用 `recall` | `c3n12`:该主题的原文和相邻主题。`c3`:某个对话的主题列表。`2026-11-01`:那天的全部对话和主题。`t7`:当前对话第 7 轮的原文。 |
18
+ | `/context-graph share` | 让工作区里的其他对话看到本对话的图谱。只是一个标记,不复制、不合并。 |
19
+
20
+ 设计规则:
21
+
22
+ 1. **不开不动。** 没有运行 `on` 的对话不会被索引,也不会收到任何附加内容。
23
+ 2. **没有原文不写入。** 主题只和它来源的原始消息一起保存。要点是指针,不是记录。
24
+ 3. **只组织,不合并。** 每个对话的图谱留在自己的文件夹里,带自己的日期。编号带对话号(`c3n12`),每个主题都能追溯到来源对话。
25
+ 4. **时间是第一过滤条件。**
26
+ 5. **只在末尾追加**,保住服务商的前缀缓存。隐藏或折叠旧轮次不是本插件的工作。
14
27
 
15
28
  ## 命令
16
29
 
17
- 在对话中输入(菜单弹出时先选 `context-graph`,再输入后面的词):
30
+ 输入 `/context-graph`,在菜单里选中后再输入后面的词:
18
31
 
19
- - `/context-graph`:状态,包括主题数、待索引轮数、是否有新版本。
20
- - `/context-graph build`:立即索引当前对话。
21
- - `/context-graph fold`:立即索引并折叠旧轮次。
22
- - `/context-graph find 关键词`:查找相关主题。
32
+ | 命令 | 作用 |
33
+ |---|---|
34
+ | `on` / `off` | 开启或关闭本对话的记忆。`off` 保留图谱文件。 |
35
+ | `share` / `unshare` | 允许或停止工作区里的其他对话使用本对话的图谱。 |
36
+ | `stats`(默认) | 记忆状态、主题数、共享对话数、待索引轮数、token 计数。 |
37
+ | `build` | 立即索引当前对话。 |
38
+ | `map` | 工作区里的全部对话(最新在前)及其主要主题。 |
39
+ | `find 关键词` | 在已共享对话里查找;时间词会缩小范围。 |
40
+
41
+ 结果显示在 dsh 自带的命令卡片里:第一行是摘要,展开看详情。
23
42
 
24
43
  ## 安装与更新
25
44
 
@@ -27,12 +46,18 @@ DeepSeek Harness 插件:把过往对话记成一张小型主题图谱,并把
27
46
 
28
47
  有新版本时,你的下一次回复末尾会提示一次,`/context-graph` 的第一行也会显示。更新方法:打开本插件 → 卸载 → 添加插件 `dsh-context-graph@新版本号` → 重启。务必写明版本号:dsh 的 pnpm 默认会暂缓刚发布的版本。
29
48
 
30
- ## 关于费用
31
-
32
- DeepSeek 对重复发送的已缓存输入只收约 1/30 的价格,而每次折叠都会让缓存重新开始一次。所以折叠只在旧内容很大时、并且目录不到原内容一半时才发生。短对话里它什么都不做。最大的收益来自新对话:不用重复解释,图谱已经记得之前的决定。
49
+ ## 文件
33
50
 
34
- ## 设置
51
+ ```
52
+ .context-graph/chats/<对话>/meta.json 编号、标题、开始/最近时间、轮数、memory、shared
53
+ .context-graph/chats/<对话>/graph.json 主题与链接,每个主题带时间
54
+ .context-graph/chats/<对话>/src/<id>.md 每个主题背后的原始消息
55
+ ```
35
56
 
36
- 默认值见 [cordis.patch.yml](cordis.patch.yml)。如果你的对话模型是"思考型"模型(例如 Qwen3)而且较慢,可以用 `provider` 和 `model` 让索引改用更快的模型。
57
+ ## 已知限制
37
58
 
38
- 英文完整说明见 [README.md](README.md)。
59
+ - 重启后,续聊的第一次索引会重读整个对话(编号复用,不会重复)。
60
+ - 两个代理同时写同一个对话的图谱:后写的覆盖先写的。
61
+ - 子代理会话不索引,也不附加记忆。
62
+ - 对话标题暂用第一条消息的缩写。
63
+ - 侧边栏的可视化图谱页面尚未实现,`/context-graph map` 是文字版。
package/cordis.patch.yml CHANGED
@@ -1,18 +1,15 @@
1
- # Mounted at the profile root so the recall tool, the matcher and the builder are available to
2
- # every agent. Every value below is the default; restate the whole config block when you change one.
3
- - insert:
4
- - id: context-graph
5
- name: dsh-context-graph
6
- config:
7
- dir: .context-graph # relative to the agent workspace, or an absolute path
8
- buildEveryTurns: 4 # index after this many new human turns
9
- buildMinChars: 400 # ...and at least this much new text
10
- maxHits: 5 # nodes shown per human turn
11
- inlineMaxChars: 1200 # one dominant hit this short is shown verbatim, no recall needed
12
- surfaceMaxNodes: 40 # god nodes listed at the start of a session
13
- builderMaxTokens: 8192 # thinking models spend part of this on reasoning
14
- provider: '' # empty: reuse the conversation's routed provider/model
15
- model: ''
16
- fold: true # replace old turns of the current chat with a table of contents
17
- foldAtTokens: 24000 # fold once the foldable part costs this much per request
18
- keepTurns: 2 # newest human turns always kept word for word
1
+ # Mounted at the profile root so the recall tool, the matcher and the builder are available to
2
+ # every agent. Every value below is the default; restate the whole config block when you change one.
3
+ - insert:
4
+ - id: context-graph
5
+ name: dsh-context-graph
6
+ config:
7
+ dir: .context-graph # relative to the agent workspace, or an absolute path
8
+ buildEveryTurns: 4 # index after this many new human turns (only in chats with memory on)
9
+ buildMinChars: 400 # ...and at least this much new text
10
+ maxHits: 5 # topics shown per human turn
11
+ inlineMaxChars: 1200 # one dominant hit this short is shown verbatim, no recall needed
12
+ surfaceMaxChats: 20 # chats listed right after /context-graph on
13
+ builderMaxTokens: 8192 # thinking models spend part of this on reasoning
14
+ provider: '' # empty: reuse the conversation's routed provider/model
15
+ model: ''