Memory Vault: Organizing DSH Sessions into Daily-Archived Long-Term Memory

Introduction

DSH (DeepSeek Harness) sessions frequently need to be interrupted or switched when context runs out. Without any organization, the conversation content is lost once the session ends. For users who need to maintain long-term projects, track decision-making processes, or accumulate knowledge, this adds considerable overhead.

The Memory Atlas plugin solves the same problem: context fills up, sessions change, but “who you are, what you’re working on, what you prefer, and what decisions were made” should not disappear. It organizes DSH sessions into portable long-term memory: raw transcripts stored by day, a daily diary entry, a six-chapter memory card, and a zoomable, clickable, searchable memory atlas.

What It Does

  • One archive per session. The archive is a plain folder — you can inspect it, back it up, or move it wherever you want.
  • Daily snapshots. Each day gets a raw transcript (only real user messages and assistant body text are kept; tool outputs, reasoning traces, and injected context are all filtered out).
  • Two-pass distillation. On the same day, the model first writes a diary entry, then extracts long-term-useful items into the memory card. Items are filed into six chapters: “Who I Am / What I’m Working On / Preferences & Habits / Key Decisions / People & Relationships / To-Dos & Threads.”
  • Day-by-day persistence, resumable. Progress is tracked in a ledger; if you stop midway, close DSH, or hit a model error, completed days are never redone. Each run processes at most 20 days by default — run “Continue Processing” to pick up earlier days.
  • /yiku recall. Type /yiku in any session, and the plugin hands the current assistant the paths to the memory card and the last 3 days of diaries, letting the assistant read them itself. The full memory is never dumped into context.
  • On-demand retrieval. Two tools let the assistant dig through archives when old topics come up:
  • atlas_search: keyword search across the memory card, diaries, and raw transcripts, returning snippets with sources;
  • atlas_read: read the full memory card, or a specific day’s diary / raw transcript.
  • Two visualizations. Toggle between “2D / 3D” in the top-right corner of the atlas. 2D is a flat star map: “Me” at the center, six chapters radiating outward, with a time river at the bottom listing diaries by day. 3D is the same memory rendered as a rotatable nebula — drag to rotate, scroll to zoom, double-click to reset. Both support hover, click-to-expand entries, and search highlighting.

Interface

The atlas offers two views — 2D and 3D — toggleable from the top-right corner.

2D: “Me” at the center, six chapters unfolding outward. Each dot is a memory entry, and the time river at the bottom lists diaries day by day.

3D: The same memory placed in a rotatable space; chapter nodes are differentiated by depth and size. Drag to rotate, scroll to zoom, double-click to reset.

Installation

Requirements: DSH >= 0.2.0, Node >= 22.

git clone https://github.com/zdddrszj985/dsh-memory-atlas.git
dsh plugin --profile desktop add ./dsh-memory-atlas

Replace the path after add with your actual clone directory. After installation, restart DSH (or let HMR pick it up) — “Memory Atlas” will appear in the sidebar.

If it doesn’t show up, check whether dsh-memory-atlas is present in the dsh.profile.bundles array in ~/.dsh/profiles/<profile>/package.json; if not, add it manually and restart.

Create a symlink in the profile directory and add the package name to the profile’s package.json:

  1. Create the junction:
   New-Item -ItemType Junction -Path "$env:USERPROFILE\.dsh\profiles\desktop\node_modules\dsh-memory-atlas" -Target "C:\plugins\dsh-memory-atlas"
  1. Edit $env:USERPROFILE\.dsh\profiles\desktop\package.json:
    - Add "dsh-memory-atlas": "link:C:/plugins/dsh-memory-atlas" to dependencies;
    - Add "dsh-memory-atlas" to the dsh.profile.bundles array.
  2. Restart DSH.

Getting Started

  1. Open “Memory Atlas” in the sidebar.
  2. Use the top dropdown to select a session (defaults to the most recently active one). Entries marked with ● already have an archive.
  3. Click “Start Processing” for the first time: it creates an archive at Documents/忆库/<Session Title>-<first 8 chars of id>/ and begins processing. You can also go to “Settings” to pick a folder, change the default location, or switch models.
  4. During processing you’ll see a progress bar, the current date, and the current phase. You can “Stop” at any time — completed days are not lost.
  5. After processing, switch to “Atlas,” “Memory Card,” or “Diary” to view results. Typing a term in the search box highlights matching entries and snippets.
  6. Go back to any session, type /yiku, and the assistant will read the memory card and recent diaries before responding to you.

/yiku only starts a new turn when there is processed content available; empty archives will prompt you to process first.

What an Archive Looks Like

Documents/忆库/用B站视频开发记忆档案插件-1a2b3c4d/
├─ 记忆卡.md          # Six chapters, ### entry title + body + <!-- d:date i:importance -->
├─ 日记/
│  ├─ 2026-11-23.md   # Daily overview + timeline + entries noted today
│  └─ 2026-11-22.md
├─ 原始对话/
│  ├─ 2026-11-23.md   # User messages and assistant body text for the day
│  └─ 2026-11-22.md
└─ .atlas.json        # Ledger: progress, watermarks, per-day status/entry count/word count/errors

The memory card is plain Markdown — you can edit it directly by hand. The next processing run reads it back and merges. Entries in the same chapter with the same (or highly similar) title are updated rather than duplicated; each chapter retains at most 80 entries.

How Processing Works

  • Reads ~/.dsh/sessions/**/session.v4.jsonl.zstd. Logs are concatenated zstd frames; each frame is decompressed individually.
  • Only collects real user messages (source.kind === 'user' in user/message) and assistant body blocks (assistant/message). Tool calls, reasoning, and injected context are excluded.
  • Groups by local date, processing oldest days first. If a day is too long, it’s split into at most 4 segments for the model to process separately, then merged.
  • Each day’s output is strict JSON: {title, diary, cards[], events[]}. A parse failure triggers one retry; if it still fails, the error is logged, the raw transcript is preserved, and it can be redone next time.
  • The model defaults to DSH’s current default model; you can also pin a provider/model in “Settings.” All calls go through DSH’s own llm service.

Privacy

  • All archives live in local folders. No external network requests, no cloud sync, no telemetry.
  • The only data egress is the model service DSH is already configured with: processing sends the day’s conversation to it. If you’re concerned, you can switch to your own local model provider in “Settings.”
  • Raw transcript files are plain text — avoid placing the archive directory in a public repository.

Tools & API

Assistant tools:

Tool Parameters Purpose
atlas_search query (required), date, scope=all/card/diary/raw, limit Search memory card / diaries / raw transcripts; returns snippets with sources ranked by relevance
atlas_read what=card/diary/raw (required), date Read the full memory card or a specific day’s diary / raw transcript (truncated at 24,000 chars per call)

The panel communicates via local-host HTTP: /api/memory-atlas/{status,sessions,archives,models,archive,diary,raw,search,pickdir,bind,unbind,config,distill,stop,job}. Only same-origin localhost requests are accepted.

Development & Self-Testing

cd dsh-memory-atlas
npm test

Test coverage: multi-frame zstd decoding, real-user-message filtering, day-based grouping, memory card parsing/rendering/merging, model JSON fault tolerance, long-conversation segmentation, archive read/write and retrieval, extractDay retry, day-by-day persistence and resume, routing/tool/command registration under a mock context, and client & entry-point syntax.

Known Limitations

  • Only sessions already persisted by DSH can be processed; in-progress sessions will be complete after the next disk flush.
  • When a day has too many messages, it’s split into 4 segments max; extremely long days may lose some detail in the tail (the raw transcript remains complete).
  • Memory card merging relies on title similarity; if the model gives the same entry a completely different title, duplicates may persist.
  • The atlas renders at most 16 entry nodes per chapter; the full entry list is in the “Memory Card” tab.

License

MIT. All UI and code are original to this plugin; no third-party plugin source code is included.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye