編集者注

跨会话记忆

remember/recall/forget/pin

これは DeepSeek Harness(DSH)プラグインです。当サイトは GitHub README、インストール情報、メンテナンス状況、公開セキュリティシグナルをまとめています。

上流で中国語 README が提供されていないため、リポジトリのオリジナルコンテンツを表示しています。

dsh-memory 🧠

Cross-session memory plugin for DeepSeek Harness (dsh).

YAML-backed remember / recall / view / list / forget / pin tools with embedding search, title-first injection, and two-level (session/auto) automatic injection — the agent "naturally carries" memory without having to remember to call a tool.

English | 中文

✨ Features

FeatureDescription
remember / recall / view / list / forget / pinWrite, semantic search, expand-by-id, list (titles), soft-delete, force-inject pinning
Title-first injectionMemories inject as summary titles (with id), not full text — compact prompts; details expand via the view tool
Two-level injectioninjectLevel: session memories are resident (injected once at session start, OpenClaw-style); auto memories arrive via topic retrieval
Once-per-session injectionFixed memories inject on the session's FIRST step, then ride the history (no per-round re-render — token + prefix-cache friendly)
Embedding searchHybridSearch (keyword 2-gram + local embedding via ollama, RRF fusion) — catches paraphrases keyword search misses
Tuned matchingGeneric-word downweighting (文件/测试/文档…), ≥2-token keyword hits, retrieval gate skips test-chatter ("别管/只是测试")
Provenance labelingInjected memories are prefixed "…from the memory store (not conversation history)" so the model never mistakes them for dialogue
Data safetySerialized write queue (no lost updates), corrupt-file quarantine + backup, atomic writes, mtime cache invalidation

📦 Install

# From source (inside a dsh checkout)
pnpm install
pnpm run build

# Register in your profile patch (e.g. ~/.dsh/profiles/web/cordis.patch.yml)
- insert:
    - id: dsh-memory
      name: '@towzai/dsh-memory'
      config:
        file: /path/to/memory.yaml
        injectLimit: 8

Requires a local ollama instance with an embedding model (default qwen3-embedding:0.6b; override via DSH_MEMORY_EMBED_MODEL).

🔨 Build (from source)

Requires the dsh checkout's dependencies (the plugin's peer deps live there). On Windows you can junction them instead of reinstalling:

# in the plugin repo
cmd /c mklink /J node_modules <path-to-dsh-checkout>\node_modules
npm run build   # outputs lib/index.js

🛠️ Tools

ToolPurpose
rememberSave a memory (content / title / category / tags / importance / forceInject / injectLevel / source)
recallHybrid search (keyword + embedding) top-N
viewExpand ONE memory's full content by id (title-first injection's detail entry)
listList memories as titles (category/tag/importance filters, full for content)
forgetSoft-delete (marks retired, keeps history)
pinToggle forceInject — pinned memories always appear at session start

🗂️ Storage

Single YAML file (default memory.yaml). Each entry:

- id: MEM-20260814-001
  title: "Summary title (auto-derived if absent)"   # injected as title
  content: "..."
  category: preference | project | lesson | fact
  tags: [tag1, tag2]
  importance: high | normal | low
  created: 2026-08-14
  updated: 2026-08-14
  source: user | agent | conversation
  retired: false
  forceInject: false           # full behavioural rules, always resident
  injectLevel: session | auto  # resident vs on-demand
  vector: [...]   # 1024-dim embedding, auto-computed on write

🔧 Architecture

src/
├── index.ts    # plugin entry: tools + session-first injection + pre-step listener
├── storage.ts  # Storage interface + YamlStorage (queue, mtime cache, quarantine)
├── search.ts   # KeywordSearch / EmbeddingSearch / HybridSearch (RRF) / OllamaEmbedder
├── inject.ts   # selectForInjection / renderSection (title-first) / deriveTitle / entryTitle
├── dynamic.ts  # DynamicInjector (per-session dedup + retrieval gate + fixed-set exclusion)
└── types.ts    # data model (+ reserved fields: vector/scope/weight for future)

Design doc: docs/2026-08-13-dsh-memory-design.md.

⚠️ Notes

  • Embedding model change invalidates stored vectors (dimension mismatch is detected and logged)
  • The plugin is developed against dsh v0.1.0-rc.5; peer dependency ranges may need bumping

🔗 References

This plugin is part of the DeepSeek Harness (dsh) plugin ecosystem.

📄 License

MIT

REPOSITORY SIGNALS

セキュリティとインストールエビデンス

このスコアは公開リポジトリメタデータと当サイトに登録されたインストールエビデンスのみに基づくもので、コードセキュリティ監査とは異なります。

出所の追跡可能性

公開プラグインカタログから取得し、公開 GitHub リポジトリにリンクしています。

ライセンス

リポジトリは MIT ライセンスを宣言しています。

メンテナンス活動

過去180日以内にコードの更新があります。

インストールエビデンス

再現可能な正確なインストールメタデータはまだ登録されていません。リポジトリの説明に従って手動で確認してください。

インストールライフサイクルスクリプト

確認したパッケージメタデータにインストールライフサイクルスクリプトは宣言されていません。