DeepSeek Harness plugin

dsh-memory-towzai

Cross-session memory plugin for DeepSeek Harness (dsh): YAML-backed remember/recall/view/list/forget/pin tools, embedding search, title-first injection, and two-level (session/auto) automatic

Jump to install

Source facts

Repository
Towzai/dsh-memory
Latest update
Aug 16, 2026
Category
Docs & Rendering
GitHub stars
3
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/Towzai/dsh-memory
Plugin: dsh-memory-towzai
Author: Towzai

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer4 files
README.en.mdSource · read only
README language

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 | 中文

🎯 Injection Strategy: Precise, Conservative, Cache-Friendly

Design PrincipleDescription
Inject once, reuse foreverFixed memories inject on the session's FIRST step only, then ride the history — no per-round re-render
Title-first, expand on demandInjects concise titles (with id); full details expand via view tool — compact prompts
Dynamic memories independent from fixed setauto memories retrieved by topic, never pollute the fixed injection set
Preserves prefix cacheAfter injection, memories enter history; system prompt + history prefix stays identical — LLM KV cache hit rate unaffected
Provenance isolationInjected memories prefixed with Retrieved memories from the memory store (not conversation history) — model never mistakes them for dialogue

📊 Comparison with Alternatives

ApproachPer-round injectionCache impactToken cost
Full injection every round❌ Repeats each round❌ Breaks cacheHigh
This plugin✅ Once at start✅ Zero impactLow

✨ 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); 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)

Architecture: [docs/architecture.md](docs/architecture.md) · Changelog: [CHANGELOG.md](CHANGELOG.md).

🗺️ Planned

Ideas on the horizon (not yet implemented):

FeatureDescription
Feedback scoring (weight)Learn from implicit signals (usage, dismissals, agent feedback) and rank memories by usefulness instead of static importance
Multi-scope isolation (scope)Keep separate memory namespaces per project/workspace, so one agent's context never bleeds into another's
Auto-learningDistill session insights into new memories automatically (with human confirmation), instead of relying on explicit remember calls
More backendsSQLite / JSON storage behind the existing Storage interface
Web UIBrowse, edit and manage memories from the dsh WebUI (view only exists as an agent tool today)
Test suiteExpand automated coverage for storage, search and injection logic

⚠️ 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