Skip to main content

dsh-auto-memory

26Stars1Forks1Issues0Watchers

Provides a three-layer automatic memory engine for DSH Web GUI: automatic logging of each conversation turn, keyword retrieval, and cross-tool memory inheritance, with visualization panel and calendar view.

Categories◆ Memory
Evidence5/5methodologySourceInstallMaintenanceDSH versionSecurity scan
Machine-auditedInstall commandRepo verifieddsh-plugin topicLicenseREADMEAI wiki
Language
JavaScript
License
BSD-3-Clause
Branch
main
deepseek-harnessdshdsh-plugindsh-pluginsmemorynpmplugin

Install

cmdweb profile
$ dsh plugin --profile web add @a9i5k4/dsh-auto-memory

Run the command above in your terminal to install this plugin via the dsh CLI. You can switch Profile in the top-right corner. New to dsh? Read the beginner tutorial

Install via your agent

Install the DeepSeek Harness plugin Aik358/dsh-auto-memory for me: review the repository at https://github.com/Aik358/dsh-auto-memory first, then run the install command and verify the plugin loads successfully.

Paste this instruction to the DSH Web GUI assistant — it will install and verify for you.

One-Line Pitch

Provides centralized three-layer auto-memory for DeepSeek Harness (DSH) Web GUI: user-level rules, project notes, and daily logs are automatically written, injected, and retrieved by the plugin, while also inheriting memories left by other AI tools like CodeBuddy / Claude Code / Codex.

Core Features

  • Auto-inject memory context: When assembling system prompts each time, append user rules, project notes, recent one-day logs, reflection highlights, and incomplete calendar items as needed, so the model reads the memory discipline last before responding
  • Auto-precipitate per conversation: After each conversation round, a sub-agent judges the round's value and writes to today's log (marked [auto-precipitated]); long-term decisions escalate to project notes, cross-project rules escalate to user-level memory, and casual chit-chat rounds are automatically skipped
  • Proactive calendar & reminders: AI automatically extracts deadlines, appointments, and task nodes from conversations and writes them to the calendar, distinguishing important/urgent four-quadrant colors, and reminds in subsequent sessions before the time arrives
  • Cross-tool memory inheritance: Automatically detects and connects to memories from other AI tools like WorkBuddy / CodeBuddy / Claude Code / Codex (only records paths, doesn't copy content, reads on demand)
  • Visualization & settings: Sidebar "Memory" entry provides seven panels: Overview / Logs / Notes / Reflections / Connect / Calendar / Search; AI writes period greetings, three-level drawer summaries, liquid glass visuals, memory map (v0.1.24)
  • Sanitization gate & one-click upgrade: Write-end intercepts garbled text/repetitive reading/external AI profile raw JSON pollution; settings page provides version check, npm registry comparison, one-click upgrade command

Technical Implementation

  • Language: JavaScript (ESM, type: module, source is compiled from lib/index.js and lib/client.js, no .ts source provided)
  • Key dependencies: Zero runtime third-party dependencies (only Node built-ins node:fs/promises, node:fs, node:child_process, node:zlib, node:os, node:path, node:url); host peer dependency @deepseek-ai/cordis ^4.0.1; frontend shares React with DSH client runtime via require('react')
  • Architecture pattern: Dual-face cordis plugin—lib/index.js (host half) registers routes, tools, system prompt injection, lifecycle hooks; lib/client.js (browser half) injects into DSH Web GUI via cordis.patch.yml and package.json#dsh.client.inject; platform fixed to web
  • Entry file: lib/index.js (exports apply(ctx, config) to mount in host process; exports name = 'auto-memory' as stable cordis plugin identifier), corresponding to lib/client.js injecting browser sidebar panel

Use Cases

Developers who continuously work on projects in DSH, switch across workspaces, and revisit across sessions. The pain point is that DSH doesn't persist project memories by default, the model starts from scratch each time, and previous decisions need to be actively restated by the user—this plugin lets the model remember what was done before, and沉淀 deadlines, appointments, and user preferences into searchable local notes. Also suitable for users who simultaneously use CodeBuddy / Claude Code / Codex, reusing historical memories across tools without manual migration.

Prerequisites & Compatibility

DependencyMinimum VersionNotes
DeepSeek Harness (DSH)Not declaredListed in plugin marketplace, no minimum DSH version declared; requires DSH web GUI to be launchable (web profile exists)
Node.js>= 22.19.0 (recommended)zstd decompression requires node:zlib.zstdDecompressSync; with Node <22, session index falls back to plaintext read, still runnable but workspace overview may miss compressed session frames
@deepseek-ai/cordis^4.0.1peer dependency, provided by host DSH
PlatformCross-platformHost is Node.js process, runs only under DSH web profile; client panel is browser-side React
Native modulesNo third-party native dependenciesAll use Node built-in modules (fs/child_process/zlib/os/path/url), no node-gyp build artifacts
pnpmv9 or v10 (v11 needs extra config)pnpm v11 defaults to restricting installation of versions released less than 1 day ago; same-day releases need minimumReleaseAge: 0 in pnpm-workspace.yaml or explicit version number

Installation

dsh plugin --profile web add @a9i5k4/dsh-auto-memory

Actual equivalent steps: Install the package under DSH's web profile directory ~/.dsh/profiles/web, append @a9i5k4/dsh-auto-memory to that directory's package.json dsh.profile.bundles array, then restart dsh web to see the sidebar "Memory" entry.

Configuration Options

Config file located at ~/.dsh/dsh-auto-memory.json (auto-created on first launch), complete defaults determined by DEFAULT_CONFIG in source lib/index.js:

ConfigTypeNotesDefault
userMemoryDirpathUser-level memory directory (absolute path or starting with ~)~/.dsh/memory
projectMemoryDirstringProject-level memory directory name (relative to workspace).dsh-memory
memoryRootpathCentralized memory root directory, one subdirectory per workspace~/.dsh/memory/workspaces
injectEnabledbooleanWhether to inject memory context into system promptstrue
injectBudgetCharsnumberTotal character budget for injection (dynamic part cap)2400
recentDaysInjectednumberRecent log days to inject1
autoConsolidatebooleanWhether to auto-evaluate and write to today's log after each conversation roundtrue
autoConsolidateMinCharsnumberMinimum character count for this round to trigger auto-precipitation (below = casual chit-chat, skip)240
autoConsolidateCooldownMinutesnumberAuto-precipitation cooldown minutes (automatically doubled during non-working hours 22:00–08:00)30
autoConsolidateDailyMaxnumberMaximum daily auto-precipitation calls (rate limit)8
awayMinutesnumberHow many minutes away counts as "stepped out", show memory window and greeting on return60
autoPopupEnabledbooleanWhether to auto-popup memory window on return from stepped outtrue
autoSummaryTimesstring arraySchedule for auto-generating period summaries (24h HH:MM), empty array = off[]
dayBoundaryMinutesnumberDay boundary (minutes from midnight), work before this goes to previous day's log450 (7:30 AM)
reflectEnabledbooleanWhether to enable daily reflectiontrue
reflectStyleenumReflection style: auto / life / professionalauto
localeenumUI language: system (follows DSH system language) / zh / ensystem
externalInjectionCharsnumberExternal memory injection budget (characters)1400
externalSourcesobjectExternal memory source toggles (WorkBuddy/CodeBuddy/Claude Code/Codex/Project conventions)all true

No restart needed after modification: Settings → Auto Memory page takes effect on save; panel font size (small/normal/large/extra-large) switches in real-time without saving.

FAQ

Q: Didn't see the "Memory" sidebar entry after installation. What to do?

A: All three steps must be complete: install the package under ~/.dsh/profiles/web, append @a9i5k4/dsh-auto-memory to that directory's package.json dsh.profile.bundles array, then restart dsh web. Just installing without restart or not adding the bundle line won't show it.

Q: Where are memory files stored? Will they be lost when reinstalling DSH?

A: Memory is stored as plain text Markdown in the user home directory, isolated from DSH installation: user-level at ~/.dsh/memory/MEMORY.md, project memories consolidated at ~/.dsh/memory/workspaces/{workspace}/. Reinstalling DSH doesn't affect them; the old dispersed .dsh-memory in workspaces will auto-migrate to the centralized root directory on first run, old files kept without deletion.

Q: Will auto-precipitation consume a lot of tokens?

A: Enabled by default with max 8 calls per day, 30-minute cooldown (automatically doubled during non-working hours), adjustable in settings. Static rules are attached to system prompt for byte-level stability; dynamic memory goes through runtime snapshot, allowing DeepSeek prefix cache to hit throughout to reduce redundant encoding overhead.

Q: Can it inherit memories from CodeBuddy / Claude Code / Codex?

A: Yes. The plugin scans directories like ~/.workbuddy, ~/.codebuddy, ~/.claude, ~/.codex. The memory_external import action uses "pure link mode", only recording source file path pointers in local memory, not copying content, reading on demand when needed—this lets you use external history without being polluted by other AI tools' profile raw JSON/garbled text.

Q: Will secrets leak into memory?

A: Content injected into prompts filters out suspected tokens/secrets/credentials paragraphs; files themselves remain intact; external session retrieval is keyword-level (not semantic). But secrets themselves are still sensitive—it's recommended not to actively write or paste them into conversations.

Q: How to upgrade this plugin?

A: Run pnpm up @a9i5k4/dsh-auto-memory (or npm install @a9i5k4/dsh-auto-memory@latest) in ~/.dsh/profiles/web directory, then restart dsh web; the Settings → Auto Memory page provides a "Check for Updates" button that compares your current version with npm registry latest and displays the upgrade command. Note pnpm v11 defaults to restricting installation of versions released less than 1 day: same-day releases wanting immediate new version need minimumReleaseAge: 0 in pnpm-workspace.yaml or use explicit version like pnpm add @a9i5k4/dsh-auto-memory@<version>.

Q: Will memory remain after uninstall?

A: Memory files are stored in user home directory (~/.dsh/memory/), not in DSH installation directory; removing bundle from web profile and uninstalling the package won't delete these Markdown files, they can continue to be used on reinstall.

Learning Curve

Beginner — no configuration needed after installation to get default three-layer memory + auto-precipitation + proactive calendar capabilities; all preferences can be adjusted in GUI's Settings → Auto Memory page and take effect in real-time, no need to touch JSON.

Known Issues & Limitations

  • Memory retrieval is keyword-level (not semantic): memory_recall does OR matching after tokenizing by whitespace/Chinese punctuation, sorted by hit count; source provides no vector retrieval or semantic matching
  • memory_recall cross-historical DSH session retrieval depends on host-deployed session-query index; when that index isn't enabled, only local memory files can be searched (README original limitation)
  • Plugin add/remove requires restart dsh web to take effect (README original limitation)
  • Node.js < 22.19.0 lacks zstdDecompressSync, DSH new version session persistence session.jsonl.zstd compressed frames can't be decompressed, workspace overview will miss compressed sessions (v0.1.16 fixed read logic, but old Node still only falls back to plaintext read)
  • pnpm v11 defaults to disallowing installation of versions released less than 1 day ago: same-day release wanting immediate new version needs minimumReleaseAge: 0 in pnpm-workspace.yaml or use pnpm add @a9i5k4/dsh-auto-memory@<version> explicit version
  • System folder picker depends on DSH host's directory-picker-auto native backend; when unavailable, settings page auto-fallbacks to embedded folder browser
  • Versions 0.1.14 and below will pierce DeepSeek prefix cache (old version injects second-level timestamps into system prompt), consuming massive tokens; if still running old version, recommend upgrading to 0.1.16+ to fix
  • External memory import (memory_external) only records path pointers, doesn't copy content: benefit is pollution resistance, cost is content from other AI tools needs on-demand reading when needed, not immediately full-text searchable after import

Read the usage guide →

Install steps, key points, FAQ and compatibility for this plugin — auto-derived from indexed fields.

Listing badge

Listed on deepseek-plugin.org
[![Listed on deepseek-plugin.org](https://img.shields.io/badge/listed_on-deepseek--plugin.org-007EC6)](https://deepseek-plugin.org/plugins/Aik358/dsh-auto-memory)

Paste this markdown into your GitHub README to link back to this listing. The badge only states the listing — not a security endorsement.

← Back to plugin directory