Foreword¶
For agent long-term memory, the two common paths both come with costs: stuffing all memory into the system prompt results in higher token costs per session; using RAG and a vector database introduces a whole set of retrieval and operational costs, which is too heavy for most personal deployments. dsh-simple-wiki-memory (hereinafter DSWM) takes the third path: a small index document injected into each session, with specific topics stored in individual Markdown files, which are only read when needed. No RAG, no vector database, no runtime LLM calls. All assets are simply Markdown files plus a git repository.
What is this¶
DSWM is a simplified version of the llm-wiki memory plugin for DSH, created by rainow, licensed under MIT, and currently at version v0.1.2 (2026-08-28). It builds upon DSH’s native dsh-agent-instructions (AGENTS.md) mechanism, treating ~/.dsh/AGENTS.md as the memory index and ~/.dsh/workspace/ as the memory bank, and uses injected rules to let the agent maintain these files itself. You can manually edit the files or let the agent edit them; what you see is what you get.
Structure of the Memory Bank¶
The file layout maintained by the plugin is as follows:
~/.dsh/
├── AGENTS.md # Index + six maintenance rules (injected automatically each session)
└── workspace/ # Memory bank (git repository)
├── reference/ # Confirmed memory topics (enter index, participate in retrieval)
├── pending/ # Unconfirmed drafts (do not participate in retrieval, wait for you to say "archive")
├── archive/ # Obsolete topics (kept, do not participate in retrieval)
└── memory-log.md # Append-only operation log
Inside reference/ there is one Markdown file per topic. Each file carries the complete details of a topic, pointed to by entries in the index in AGENTS.md. Normally, only the index is loaded per session; the corresponding topic file is only read when the task requires it, saving unnecessary context.
Six Maintenance Rules¶
DSH automatically injects ~/.dsh/AGENTS.md before the first request of each session. Besides the index, it contains six rules that constrain how the agent writes and maintains memory:
- Write Trigger: Information worth remembering generated in the session is written immediately to
pending/; no waiting for the session to end, no silently discarding;/newor closing the page won’t cause loss. - Admission Process: Unconfirmed items stay in
pending/; after you say “Archive/Confirm”, they are promoted toreference/, while the index is updated and the log is recorded. - Unattended Sessions: (Scheduled task-board, background subagents) only write to
pending/and do not auto-promote. - Regular Cleanup: Saying “Organize Memory” triggers a reorganization process. The agent first proposes a plan (split/merge/rename/archive), and you confirm before execution. Obsolete content goes to
archive/. - Backup:
workspace/is a git repository. Memory changes are automatically committed. - Retrieval: First check the index; if there is no match, scan the
reference/directory as a fallback. It will not directly conclude “no memory.”
Installation and First Launch¶
Method 1, NPM source (recommended, dsh-market will display version number and check for updates):
dsh plugin --profile web add dsh-simple-wiki-memory
Method 2, GitHub source code installation:
dsh plugin --profile web add github:rainow/dsh-simple-wiki-memory
Method 3, give the GitHub repository link to the agent in a DSH session, let it install and complete the first sync for you:
https://github.com/rainow/dsh-simple-wiki-memory
The first launch will automatically sync the AGENTS.md skeleton, create the vault directory, and git init the workspace/. This process is idempotent, and for an existing ~/.dsh/AGENTS.md, it only merges but does not overwrite, so it won’t touch your index entries.
Daily Usage¶
A few typical interactions, all completed via natural language:
- Tell the agent to remember something in a session → write to
pending/; say “Archive/Confirm” → promote toreference/as formal memory and update the index. - Say “Organize Memory” → trigger the reorganization process (split/merge/rename/archive), requiring your confirmation before execution.
- Retrieval is handled by the built-in
memory-queryskill, which includes areference/directory scan as a fallback. - Runtime hooks handle the cleanup: automatically git commit at the end of a turn, and report pending unconfirmed memories at the start of a session. Thus, writing is real-time, confirmation is deferred, and nothing is lost across sessions.
The memory bank itself is a git repository, so you can rollback if something goes wrong:
git -C ~/.dsh/workspace log
git -C ~/.dsh/workspace reset --hard <commit>
Compatibility and Known Limitations¶
- DSH Version:
peerDependenciescovers three release lines:0.1.0-rc.7+/0.1.1-rc.2+/0.1.2-alpha.1+. Verified using DSH 0.1.2-alpha.2 (web profile), last verified date 2026-08-28. - Plugin Dependency: The plugin depends on DSH’s native
dsh-agent-instructionsmechanism (thedsh-basebundle is enabled by default); if your deployment has disabled it, memory injection will not take effect. - Conflict with Anchored Mode: The liangshen / Anchored Standard mode clears the runtime context at the start of the first round of a session, thereby blocking the automatic injection of
AGENTS.md. This is an intentional design of the Anchored mode, not a bug. The solution is to manually ask the agent to read, for example by saying “Read~/.dsh/AGENTS.mdfirst, then start”. Non-Anchored mode sessions are not affected. - Graceful Degradation: The plugin gracefully degrades if git is unavailable: memory functionality works normally, just without automatic backups.
Permissions and Data¶
- Files: Read/Write
~/.dsh/AGENTS.mdand~/.dsh/workspace/; Commands: Executegit init/add/commitwithin that directory. No network, no credentials, no telemetry. - Sandbox Requirements: Writing to
~/.dsh/workspace/requiresdanger-full-access, orworkspace-writeplus on-demand approval; reading memory is feasible in any sandbox mode.
Configuration and Uninstallation¶
Version v0.1 has no user-visible configuration items and uses safe defaults. Version v0.2 plans to provide three configurations: TTL in days, auto-commit toggle, and memory directory path.
Uninstall command:
dsh plugin --profile web remove dsh-simple-wiki-memory
Uninstalling will stop the runtime hooks (automatic commit, pending report), but all data in ~/.dsh/AGENTS.md and ~/.dsh/workspace/ will be retained. The six rules will still remain in AGENTS.md (it is just plain text); to remove them completely, manually delete that section.
Applicable Scenarios and Notes¶
DSWM is suitable for users with medium memory volume in personal DSH deployments who want a readable, editable, and git-friendly memory system. If you find the llm-wiki setup too heavy, or don’t want to pay for vector database operational costs, its trade-offs are reasonable. Another practical point is cross-harness sharing: memory is just plain markdown files; you can point other harnesses’ AGENTS.md or equivalent files to this library to reuse the memory.
As a reminder: the plugin runs with the permissions of the current dsh process. It is recommended to review the source code and license before installing to ensure the permission scope meets your expectations.
Closing¶
The philosophy of DSWM is “Index resident, content on demand”: using minimal mechanisms to solve the token cost problem of long-term memory, keeping data in Markdown and Git in the user’s hands, with no burden to install or uninstall. Project homepage and community directory are as follows:
- GitHub: https://github.com/rainow/dsh-simple-wiki-memory
- Directory: https://www.skillhub.cn/plugins/rainow/dsh-simple-wiki-memory
By the way: DSH’s philosophy is “Everything is a plugin”. The community directory above is an independent site and has no official affiliation with DeepSeek / Hypersphere.