qwert702/dsh-memory

Long-term memory for the DeepSeek Harness Web GUI: project-scoped + global memory stores with automatic extraction, automatic briefing injection, small-model periodic consolidation, and an Obsidian-style memory graph.

catalog 简介 / catalog descriptioncatalog description:Long-term memory plugin for the DeepSeek Harness Web GUI: project+global stores, auto extraction/injection, small-model consolidation, Obsidian-style link graph.

项目介绍Project Overview

dsh-memory 是 DeepSeek Harness Web GUI 的长期记忆插件,提供项目与全局两级 JSON 记忆库,支持对话结束后自动抽取、按新鲜度/强化度/关联度注入 top-K 上下文、定期由小模型合并链接归档,并带记忆列表与图谱视图。适合需要跨会话保留事实、偏好和项目背景时使用;自动抽取/整理依赖模型调用,连续失败会暂停,需手动运行恢复。

dsh-memory is a long-term memory plugin for the DeepSeek Harness Web GUI. It maintains project-scoped and global JSON stores, automatically extracts memories after turns, injects top-ranked memories into system prompts, periodically consolidates them with a model, and provides a searchable list plus Obsidian-style graph. Use it to preserve facts and context across sessions. Extraction and consolidation depend on model calls; repeated failures pause auto-extraction until a manual run succeeds.

或使用命令行安装(适合开发者)Or use CLI install (for developers)

命令行安装CLI Install

dsh plugin --profile web add github:qwert702/dsh-memory

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

READMEREADME

dsh-memory

Long-term memory for the DeepSeek Harness Web GUI: project-scoped + global memory stores with automatic extraction, automatic briefing injection, small-model periodic consolidation, and an Obsidian-style memory graph.

See README.zh.md for the full Chinese documentation.

Highlights

  • Two scopes: per-workspace project memories (keyed by a hash of the session cwd) plus one global store; plain JSON under ~/.dsh/memory/ (respects $DSH_HOME), atomic writes.
  • Memory view tab beside Chat/Trajectory: one-card-per-row list (type dot, tags, origin, reinforcement count, links) with inline edit/archive/link/delete, search, and a canvas force-directed graph with zoom/pan/drag, neighbor highlighting and a detail card.
  • Auto injection: a global system-prompt/assemble waterfall listener appends the top-K memories (freshness x reinforcement x degree, interleaved scopes, char-capped) as a dynamic context; agentless assemblies get globals only; failures never touch the assembly.
  • Auto extraction: on turn/end, new events are replayed as a transcript and distilled by the model into JSON candidates; near-duplicates (bigram Jaccard >= 0.65) reinforce instead of duplicating; 3 consecutive failures pause auto-extraction until a manual run recovers.
  • Periodic consolidation: every N extracted turns per scope (default 20) or on manual trigger, the model proposes merge/link/archive/retag ops that are id-validated and applied transactionally.

Install

dsh plugin --profile web add <repo-or-local-path>
dsh web   # restart, then refresh the page

Settings (~/.dsh/settings.yaml)

dsh-memory:
  enabled: true
  injectEnabled: true
  autoExtract: true
  extractProvider: ''   # pair with extractModel to pin a small model
  extractModel: ''
  manageProvider: ''    # consolidation model provider (empty = fall back to extract*)
  manageModel: ''
  consolidateEveryTurns: 20
  topK: 8
  maxInjectChars: 1500
  maxInputChars: 12000
  maxTokens: 1024
  autoArchiveDays: 90       # heuristic auto-archive age in days (0 = off)
  memoryLocale: ''          # force memory language: '' = follow the conversation, or zh/en
  embeddingsEnabled: true   # local semantic embeddings (needs the optional dependency)
  embeddingRemoteHost: ''   # HuggingFace mirror, e.g. https://hf-mirror.com
  autoLinkThreshold: 0.78   # cosine threshold for auto-linking during consolidation (0 = off)

Layout

  • lib/index.js — host half: settings, injection/extraction listeners, consolidation pipeline, routes.
  • lib/store.js — two-scope JSON store + durable cursors/counters.
  • lib/util.js — pure helpers (scope keys, similarity, parsers, transcript builder).
  • lib/embeddings.js — optional local embeddings (transformers.js WASM): vector sidecar + serial inference queue.
  • lib/client.js — browser half (hand-written bundle): additive conversation.view entry.
  • test/smoke.cjsnode test/smoke.cjs.
  • test/e2e-flow.cjs — six-stage end-to-end business flow (node test/e2e-flow.cjs).

MIT

上一个 Prev dsh-query-jump 下一个 Next dsh-plugins-plus