lesliechowsh/dsh-memo

插件Plugin ⭐ 5 MIT memory

Memo — session memory search for DeepSeek Harness agents (memo_search / memo_remember / memo_stats on the official sessionQuery service). Every benchmark number is the shipped product's own, with the experiment trail published.

编辑导读Editor's Brief

## 核心特性
- Memo 提供三个工具:memo_search、memo_remember 和 memo_stats,可通过一个插件命令搜索过往 DSH 会话和已存储的笔记。
- memo_search 返回匹配的会话、片段、时间戳、匹配模式和笔记,并支持可选的数量限制、会话过滤、时间过滤和笔记标签。
- memo_remember 会以 JSONL 记录形式追加持久笔记并返回已存储的笔记;相同文本会被报告为重复,而不会再次追加。
- memo_stats 提供语料概览,包含会话数量、最近会话和笔记数量,无需查询参数。
- 该插件通过官方 sessionQuery 后端搜索 DSH 会话语料,并将提炼后的笔记保存在本地人类可读文件中。

## 使用场景
- Agent 可以通过定位某个主题、决策或短语先前出现过的会话,回答关于过往对话的问题。
- Agent 可以使用 memo_remember 存储明确的事实、偏好、约定或项目决策,并稍后通过 memo_search 检索。
- 当相关上下文仅部分已知时,Agent 可以通过会话标识符、epoch 毫秒时间边界或笔记标签缩小历史搜索范围。
- Agent 可以先通过 memo_stats 查看可用记忆量和最近活动,再发起更有针对性的搜索。

## 技术细节
- 安装命令会将该插件添加到 DSH web profile,并在首次使用时启用平台会话搜索索引,除非后续补丁禁用该行为。
- 搜索处理结合了完整查询短语步骤与加权 token 步骤,对结果去重,并将短语命中排在加权命中之前。
- 会话事件会被索引到一个倒排索引中,并持久化保存在 $DSH_HOME/memo/index.json;笔记则存储在 $DSH_HOME/memo/notes.jsonl。
- 该插件不需要向量数据库、embedding API、外部 API key、后台索引器或网络调用;如果会话查询索引已关闭或缺失,它会报告错误。

## 注意事项
- 默认的内存索引会在重新启动后重建,因此在大型语料中的首次搜索可能比后续搜索更慢。
- 中文查询依赖将连续汉字串作为加权短语;如果不修改上游分词器,则无法在连续汉字串内进行词级搜索。
- 基准测试数据描述的是词法检索下的会话定位命中率,而不是端到端回答准确率;涉及助手引述或偏好的问题召回率较低。

## Core Features
- Memo exposes three tools, memo_search, memo_remember, and memo_stats, for searching past DSH sessions and stored notes from one plugin command.
- memo_search returns matching sessions, snippets, timestamps, match modes, and notes, with optional limits, session filters, time filters, and note tags.
- memo_remember appends durable notes as JSONL records and returns the stored note, while identical text is reported as a duplicate instead of appended again.
- memo_stats provides a corpus overview containing session count, recent sessions, and note count without requiring query parameters.
- The plugin searches the DSH session corpus through the official sessionQuery backend and keeps distilled notes in a local human-readable file.

## Use Cases
- Agents can answer questions about prior conversations by locating sessions where a topic, decision, or phrase previously appeared.
- Agents can store explicit facts, preferences, conventions, or project decisions with memo_remember and retrieve them later through memo_search.
- Agents can narrow historical search by session identifier, epoch-millisecond time boundary, or note tags when the relevant context is partially known.
- Agents can inspect available memory volume and recent activity through memo_stats before issuing more targeted searches.

## Technical Details
- The install command adds the plugin to the DSH web profile and enables the platform session-search index on first use unless a later patch disables it.
- Search processing combines a whole-query phrase step with a weighted token step, deduplicates results, and orders phrase hits before weighted hits.
- Conversation events are indexed into an inverted index persisted at $DSH_HOME/memo/index.json, while notes are stored at $DSH_HOME/memo/notes.jsonl.
- The plugin does not require a vector database, embedding API, external API keys, background indexer, or network calls, and it reports a closed or missing session-query index as an error.

## Notes
- The default in-memory index is rebuilt after a fresh boot, so the first search in a large corpus can be slower than later searches.
- Chinese queries rely on contiguous Han runs as weighted phrases, and word-level search inside a run is unavailable without an upstream tokenizer change.
- Benchmark figures describe session-localization hit rates under lexical retrieval, not end-to-end answer accuracy, and assistant-quoted or preference questions show lower recall.

安装Install

dsh plugin --profile web add dsh-memo@latest

lesliechowsh/dsh-memo 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

上一个 Prev dsh-split-panes 下一个 Next dsh-plugin-longgraph