Preface¶
In DeepSeek Harness (DSH), the common way to add “memory” to an Agent is to store it and retrieve it. In actual operation, several kinds of trouble arise: passwords or tokens being written into local files, the same preference being silently overwritten by new and old records, a single recall stuffing the entire library into the Prompt, and afterwards being unable to explain “what was remembered and why it was recalled”. Memory Guardian is a memory plugin released by community maintainer Ukashi0. It follows a local-first approach and, beyond read/write, adds source, scope, conflict review, recall budget, and a Web governance panel. It does not depend on Memmy, ExpMem, or vector databases, and does not proactively access the network.
What Is This¶
The plugin’s npm package name is dsh-memory-guardian, currently version 0.1.1-beta.1 (Beta), licensed under MIT. In one line: governable long-term memory for DeepSeek Harness — with built-in local storage, three model tools, and a native Web panel in Settings, making cross-session memory explainable, auditable, and bounded by a context limit.
Maintainer and repository: Ukashi0/dsh-memory-guardian. Community directory page: SkillHub plugin page.
Differences from Ordinary Memory Plugins¶
The materials summarize four additional capabilities:
- Memory security: Passwords, tokens, private keys, etc. are rejected directly before being written to disk; personal information such as emails and phone numbers enters quarantine by default and requires manual approval.
- Memory accuracy: When the same
semantic keyhas different new and old content, it is not silently overwritten; a conflict is created and enters the Review Queue. - Context budget: A single recall simultaneously limits the number of items (
maxRecallItems) and the body character count (maxRecallChars). - Explainability: Preserves source, scope, importance, recall count, risk, and lifecycle; the Privacy Ledger records governance events.
v0.1 uses local lexical retrieval, contains no Embeddings, has zero third-party runtime dependencies, and its results are auditable.
Core Features¶
Web Panel¶
After installation, open Settings → Memory Guardian in DSH. Main pages:
| Page | Purpose |
|---|---|
| Memory Vault | Browse Active, Review, Archived; view source and scope; pin or archive |
| Recall Lab | Enter a query, simulate recall, and focus on relevance scores and budget consumption |
| Review Queue | Compare new and old content; choose replace, coexist, or reject; unapproved items do not enter recall |
| Privacy Ledger | Records of creation, deduplication, quarantine, recall, archival, and credential interception |
The interface follows DSH’s light/dark theme and supports keyboard focus, mobile layouts, and prefers-reduced-motion.
Model Tools¶
Three tools are registered to the Agent:
| Tool | Description |
|---|---|
memory_remember |
Save long-term information; automatic deduplication, sensitive detection, and conflict quarantine |
memory_search |
Performs lexical relevance checks, then sorts by relevance, importance, recency, and pinned status; the whole group is constrained by the budget |
memory_forget |
Archive the specified memory and immediately exclude it from recall; it can be restored from the panel |
The plugin also injects a concise Memory Policy describing when to search, when to save, and what content is prohibited from being saved.
Explicit “Remember” Statements¶
When captureExplicitRequests is enabled (default true), user save intentions expressed in a fixed format are recognized, for example:
Remember: this project uniformly uses pnpm
Please remember npm test must be run before release
remember: I prefer concise answers
Ordinary chat is not automatically captured in full.
Data Model and Conflicts¶
Each record contains: body, semantic key, category, tags, importance, scope (global/project/agent/team), source (session/event), status (active/quarantined/archived), risk, conflict, and creation/update/last-recall times with optional expiry.
When the same key already maps to “VS Code” and “Zed” is saved, the new record enters the Review Queue rather than letting two contradictory memories affect the model simultaneously. Review can choose replace (replace the old Active entry) or coexist (coexist, with an alternative hint at recall time). Project scope uses the normalized absolute working directory (from the Session’s cwd or the panel selection); path text is normalized without calling realpath.
Installation and Activation¶
Requirements: DeepSeek Harness 0.1.2-rc.1 or higher, Node.js 22 or higher, and mainly the Web Profile running mode (Host storage and model tools can also be used with other Profiles that include the required services).
The published beta version uses the beta tag. If you already have the dsh command locally:
dsh plugin --profile web add dsh-memory-guardian@beta
dsh web
If there is no global dsh, you can use npx:
npx @deepseek-ai/dsh plugin --profile web add dsh-memory-guardian@beta
npx @deepseek-ai/dsh web
For local development or tgz package installation, see the repository README; when installing via a local directory link, that directory must be retained. The plugin does not depend on Context Sentinel.
By default, the bundle inserts the following configuration fragment (which can be adjusted in the DSH configuration):
- insert:
- id: memory-guardian
name: dsh-memory-guardian
config:
maxRecords: 10000
maxRecallItems: 8
maxRecallChars: 6000
captureExplicitRequests: true
quarantinePersonalData: true
Common configuration items:
| Config item | Default | Description |
|---|---|---|
storagePath |
~/.dsh/memory-guardian/store.json |
Local JSON storage |
maxRecords |
10000 |
Maximum number of records (upper limit 100000) |
maxRecallItems |
8 |
Maximum number of items per recall (upper limit 50) |
maxRecallChars |
6000 |
Recall body character budget (256–100000) |
captureExplicitRequests |
true |
Whether to recognize explicit requests such as “Remember: …” |
quarantinePersonalData |
true |
Whether emails, phone numbers, and ID numbers require manual approval |
auditLimit |
500 |
Number of local governance records (upper limit 5000) |
Before upgrading, it is recommended to back up store.json; do not let multiple DSH processes write to the same storage file simultaneously.
Typical Usage¶
In-session: Let the Agent call memory_remember / memory_search / memory_forget, or send a message in the above “Remember:” format.
In the panel: In Recall Lab, debug queries and the budget; in Review Queue, handle conflicts or approve / reject personal information (the current record’s reviewToken is required; expired tokens return HTTP 409).
HTTP API (Web Profile, same origin): GET /memory-guardian/api/snapshot, POST .../search, POST .../mutate, GET .../export. Conflict approval example:
{
"action": "approve",
"id": "<ID of the record under review>",
"resolution": "replace",
"expectedToken": "<current reviewToken>"
}
resolution can be replace or coexist; to reject a new record use "action": "reject".
Suitable Scenarios and Caveats¶
Suitable for: DSH developers who need long-term memory on a single machine in an offline environment and care about credential mis-storage, personal information isolation, semantic key conflicts, and Prompt bloat; team-internal Web Profile usage that wants to audit the recall and governance pipeline via a panel.
Caveats:
- The plugin reads and writes local JSON with the permissions of the current DSH process; local storage has no additional encryption, and untrusted environments should combine it with disk encryption or protected directories.
- Retrieval is lexical matching and does not guarantee semantic correctness; conflict detection depends on a stable
semantic key. - Do not expose DSH Web to untrusted networks without additional access control.
- Before installing, please review the repository source code and MIT license yourself; actual compatibility needs to be verified against your DSH version. SkillHub is a community directory and has no official affiliation with DeepSeek / High-Flyer.
Conclusion¶
Memory Guardian advances “able to remember” to “able to govern”: local storage, sensitive interception, conflict review, bounded recall, and an observable panel are all completed within the same plugin. To try it or contribute, you can enter the instructions from the SkillHub directory page, or directly consult the installation commands and the docs/privacy-and-security.md threat model in the GitHub repository.