Preface¶
When working on projects with DeepSeek Harness (DSH), closing a session often scatters the context: how a plan was decided last week, the pitfalls encountered, or the commands run at the time often rely on digging through chat history or personal notes. The community has seen practices of writing key points into Memory.md or stuffing summaries into the system prompt, but these are either disconnected from the session or consume tokens by default.
Below is an introduction to dsh-workspace-recollection (GitHub: reaxlll/dsh-workspace-recollection, categorized as “Memory” in the community directory), released by maintainer reaxlll. It isolates memories by workspace and shares them across sessions. By default, it injects nothing into the system prompt; instead, it retrieves information hierarchically via tools when needed. This makes it suitable for long-term iteration in the same repository where you want the Agent to “remember” past decisions.
What is this¶
dsh-workspace-recollection is a cross-session long-term memory plugin for DSH: memories are bucketed by the cwd (current working directory) of the session header, with one memory store per workspace shared by all sessions within that workspace. The core is hierarchical retrieval—nothing is injected at the start of a session; you invoke the specific tool layer as needed.
The plugin uses only the official plugin API (systemPrompt.section, tools.register, webServer.register). The frontend and backend communicate via /api/session-memory/*, without modifying the DSH kernel. The current package version is 2.6.0 (MIT License); the README states it was developed and tested with dsh 0.2.0-rc.2. If you encounter issues with other versions, please submit an issue to the repository.
Core Features¶
Cross-Session & Zero Injection¶
- Memories are persisted in
$DSH_HOME/session-memory/memory.json; there is a mirror index file<workspace>/Memory.mdon the workspace side, which contains shallow key points. - By default, no memories are stuffed into the system prompt (injection is automatically disabled during upgrades from old data); directories, key points, and original texts are all obtained on-demand via tools.
- Supports one-click import of historical sessions from the current workspace into long-term memory (a single memory entry corresponds to the user message at the time, original thinking text, tool calls, and conclusions).
Hierarchical Retrieval (Token Efficient)¶
| Layer | Function |
|---|---|
| Shallow | Use memory_index to get the directory; use memory_recall for semantic search, returning only key points + id |
| Segment | For long texts, first use memory_locate to find the segment number by keyword, then use memory_detail’s segments to fetch only the slice |
| Deep | Only when complete thoughts, commands, or conclusions are needed, use memory_detail to retrieve the full original text |
The retrieval order suggested in the README is: stop when sufficient—start with memory_recall, if insufficient proceed to memory_locate / segment slicing, and finally use full memory_detail. Tests show that for a memory entry of about 15,000 characters, retrieving two segments (approx. 1,200 characters) can save about 92%–97% of tokens compared to retrieving the whole entry (data from the repository README).
Local Embeddings & Retrieval Augmentation¶
- Semantic search uses the local model Xenova/bge-small-zh-v1.5 (512 dimensions, ONNX quantized to about 23MB). It automatically downloads from a mirror (
hf-mirror.com, falling back tohuggingface.coon failure) on first startup; afterwards, it runs with zero network connection and does not call cloud APIs. - When embeddings are unavailable,
memory_recallfalls back to keyword search; the panel status bar allows retrying “Load Model”. memory_recallfeatures noise filtering (four signals: absolute baseline, hard features, relative long tail, tie-break) and a time channel (e.g., filtering entries by “yesterday” or “nine days ago” based on the timezone recorded during first installation).- Segment-level location uses BM25 locally (
lib/segments.js), splitting sections by body text##headings, purely CPU-based with no additional models.
Nine Tools & Panel¶
The tools include: memory_write, memory_index, memory_recall, memory_locate, memory_detail, memory_search, memory_forget, memory_import, session_read. Manually decompressing zstd session files under $DSH_HOME/sessions/ is intercepted at the tool layer; use session_read to read historical sessions.
After installation and restarting DSH, click “Memory” at the session header to open the panel: status bar, memory list, add/edit, preview injection, retrieval testing, as well as the preview and manual notes section of Memory.md.
Installation & Activation¶
Execute the following commands in a terminal (PowerShell / CMD / bash, etc.). The plugin runs with the permissions of the current dsh process; it is recommended to review the repository source code and license before installing.
# Confirm Node.js is installed
node -v
# Install DSH launcher and pnpm (skip if already installed; please reopen terminal after installation)
npm install -g @deepseek-ai/dsh pnpm
dsh --version
# Install plugin: fill in the actual profile for --profile (use desktop for desktop app, web for dsh web)
dsh plugin --profile desktop add dsh-workspace-recollection
After installation, reopen the desktop application (restart dsh web for dsh web users)—the running process still holds the old plugin list. package.json requires Node.js >= 22.12.0.
To mount from a local directory (pure JavaScript, no build step), the README example is:
dsh plugin --profile desktop add file:/path/to/dsh-workspace-recollection
(You need to replace the path with the cloned directory yourself; this article does not expand on the clone steps.)
Typical Usage¶
Don’t know what’s in the library¶
Call the directory tool first, then search as needed:
memory_index → Pinned points + paginated list
memory_recall("…") → Shallow semantic search, returns only points and id
Hit a long entry, only need one segment¶
memory_recall("that encoding pitfall")
memory_locate({ id, query: "zstd" })
memory_detail({ ids, segments: [2, 7] })
Write & Import¶
memory_write: Write full deep content withtext;summaryis optional (if omitted, the background LLM compresses it into a one-sentence key point).memory_import: Collect historical sessions of the current workspace into long-term memory.
Recall by Time¶
Include natural language time (e.g., “October 6”, “yesterday”) in the query of memory_recall. It will filter by calendar day based on the timeZone written to memory.json when the plugin was first installed, and provide relevant session ids, which can then be read using session_read.
Use Cases & Notes¶
Suitable for: Teams or individuals developing long-term in the same workspace, needing to retain “what was done, how it was decided, where the pitfalls are” across multiple DSH sessions; hoping not to occupy the prompt by default, yet able to pull details back on-demand during conversation.
Notes:
- Memories and vectors are stored in
$DSH_HOME/session-memory/(memory.json,vectors.json);Memory.mdwithin the workspace is a shallow mirror. Consider them together when backing up or migrating DSH data. - The first download of the embedding model requires network access; intranet or offline environments can rely on keyword fallback, but the semantic search experience will degrade.
- The community directory (skillhub plugin page) and GitHub repository are maintained by the community and have no official affiliation with DeepSeek / High-Flyer; the DSH ecosystem emphasizes “everything is a plugin”, please evaluate security and compliance yourself before selecting plugins.
- Issues & Contributions: The repository welcomes issues and PRs; when reporting bugs, please include the plugin version,
dshversion, operating system, and reproduction steps.
Conclusion¶
dsh-workspace-recollection precipitates decisions and pitfalls in the DSH workspace into searchable long-term memory, using hierarchical tools to control tokens, and local embeddings to ensure retrieval does not rely on external network APIs. If you are repeatedly starting new sessions in the same repository and do not want to explain the background from scratch every time, you can install it using the commands above and start experimenting with memory_index and memory_recall.
- Community Directory: https://www.skillhub.cn/plugins/reaxlll/dsh-workspace-recollection
- GitHub: https://github.com/reaxlll/dsh-workspace-recollection