Preface¶
When acting as a long-term assistant in DeepSeek Harness (DSH), session logs preserve facts. However, across sessions, it is difficult for the model to consistently adhere to its previously formed opinions, nor is it easy to distinguish between “what I currently believe” and “what I used to believe.” Common practices involve stuffing chat records into vector databases or using similarity to determine if new information overturns old conclusions. However, measurements by MemStrata (arXiv 2606.26511) on human-annotated pairs show that the AUROC of cosine similarity in distinguishing “contradictions” from “rephrasings” is only about 0.59, with the average similarity scores of contradictory and rephrased pairs actually being close.
Below is an introduction to the community plugin dsh-ai-memory (maintainer Isyyyue). It does not append session events to DSH but maintains a derived long-term memory ledger outside of sessions: recording judgments, rules, thoughts, and personality traits. It uses structured keys for deterministic supersession and utilizes a relationship graph to assist in browsing and explanation.
What is this¶
dsh-ai-memory is a “memory” class plugin in the DSH ecosystem. The repository is Isyyyue/dsh-ai-memory, and the SkillHub directory page is isyyyue/dsh-ai-memory. It records neither complete chat transcripts nor user-hardcoded character cards, but rather the judgments, self-imposed rules, nascent thoughts, memory sources, and personality tendencies formed by the AI during interactions. All of this resides on an append-only JSONL ledger, from which the plugin folds out current state, revision history, and a graph.
DSH session logs remain the single source of truth for session facts; this plugin is a derived cache and does not write events to the session log.
Core Design: Deterministic Supersession and Bi-temporal Ledger¶
Why not use similarity¶
The plugin explicitly does not compute vector similarity nor call an LLM to make “contradiction” judgments. When a new judgment and an old judgment share the same (subject, relation) but have different object values, they are treated as a new answer to the same question, and the new entry supersedes the old one:
(Service, Port, 8000) → (Service, Port, 8080)
The old judgment is marked as superseded but not deleted; the supersession event and relationship edges remain in the ledger, allowing it to answer both “what is it now” and “what was it previously and why did it change.” The README emphasizes that the benefits of this approach are testability, reproducibility, zero external dependencies, zero judgment latency, and avoiding silent errors on similar texts.
What is in the ledger¶
Default ledger path:
~/.dsh/ai-memory/ledger.jsonl
Event types include (excerpt): node.created, node.revised, node.superseded, node.withdrawn, edge.linked / edge.unlinked, rule.amended, as well as personality-related persona.proposed, persona.accepted, persona.rejected, persona.revised. Current state, retrieval, graphs, and statistics are all recomputed from the ledger; deleting derived data does not lose history.
Separate governance for memory and personality¶
The AI’s own memory covers judgments, rules, thoughts, personality traits, etc., preserving sources and change history.
Personality adopts a “candidate-feedback-confirmation” model: The AI may first propose personality candidates. Only after the user confirms or rejects them do they enter the stable personality and influence subsequent injections; proposals, confirmations, rejections, and revisions are all recorded in the ledger. Confirmed personalities serve as expression references; pending candidates do not enter normal session injection and only appear in memory_persona read and memory_reflect, preventing accidental observations from being reinforced repeatedly.
Eight Tools¶
You should search existing memory before writing new judgments. The tools listed in the README are as follows:
| Tool | Purpose |
|---|---|
memory_search |
Search existing memories |
memory_write |
Write judgments; deterministically supersedes old judgments when triples conflict |
memory_connect |
Establish a bidirectional relationship between two memories |
memory_history |
View the revision and supersession history of judgments |
memory_rule |
Read, modify, or rollback AI self-imposed rules |
memory_persona |
Propose, confirm, reject, and revise personality traits |
memory_reflect |
Aggregate recent memories and personality to support self-reflection |
memory_stats |
Check memory count, orphans, and ledger issues |
memory_reflect provides recent memories and current personality, guiding the AI to discover stable but unrecorded tendencies; if a candidate is formed, it can be proposed via memory_persona propose, pointing to relevant memories with source_ids.
After installation and restarting DSH, a “Judgment Graph” panel will appear in the client sidebar for navigation and explanation (nodes are summaries; full text requires retrieval).
Installation and Activation¶
The plugin is installed as a bundle. In the DSH environment, replace <absolute path to this directory> with the absolute path of the plugin root directory after local cloning or extraction (the material requires using install_bundle; do not manually modify package.json or cordis.patch.yml in the profile):
plugin_manager action=install_bundle target=<absolute path to this directory>
Restart DSH once after installation to allow the client graph to complete its startup scan, then refresh the page.
Disable or remove (does not delete the memory ledger):
plugin_manager action=set_bundle target=dsh-ai-memory enabled=false
plugin_manager action=remove_bundle target=dsh-ai-memory
The project’s package.json indicates Node.js 22+ is required, and the README states there are no external npm dependencies at runtime. The license is MIT.
Configuration¶
No configuration is needed by default. For customization, you can override it in the profile’s cordis.patch.yml:
- id: dsh-ai-memory
name: dsh-ai-memory
config:
dir: 'D:\my-memory'
injectIndex: true
maxIndexEntries: 40
maxGraphNodes: 500
enabled: true
| Config Item | Default | Description |
|---|---|---|
dir |
~/.dsh/ai-memory |
Ledger directory |
injectIndex |
true |
Whether to inject memory index at session start |
maxIndexEntries |
40 |
Max number of injected judgment entries |
maxGraphNodes |
500 |
Max nodes in graph snapshot |
enabled |
true |
Whether to register the plugin |
What is injected is a summary index, not the entire ledger. When there is no memory yet, a brief writing rule will also be injected to help the AI start accumulating; the reminder itself does not automatically save conversations.
Typical Usage (Workflow)¶
- Session Start: If
injectIndexis true, you will receive a memory index and confirmed personality summary (excluding pending candidates). - Before forming or updating opinions: Call
memory_searchto avoid duplication or unhandled conflicts with existing judgments. - Writing: Use
memory_writeto persist; if(subject, relation)is the same butobjectdiffers, the old judgment is deterministically superseded. - Connecting evidence or complements/contradictions: Use
memory_connectto build edges, and usememory_historyto check the revision chain if necessary. - Self-imposed constraints: Maintain rules the AI sets for itself via
memory_rule. - Personality evolution: Observe tendencies → propose candidates via
memory_persona→ user confirms or rejects → subsequent revisions possible; periodically usememory_reflectto aggregate and re-propose. - Operational self-check:
memory_statsto view counts and ledger issues; graph panel to browse structure.
For development and verification, the repository provides commands like npm test and node test/e2e.mjs; if DSH is locally available, you can use node test/host-runtime.mjs <DSH source root directory> to perform tool registration and HTTP route checks (without installing dependencies, calling models, or modifying the production ledger).
Use Cases and Notes¶
Who it is for: Developers who want their assistant in DSH to have cross-session, explainable long-term judgments and personality evolution, and who can accept that “supersession relationships are determined by structured triples rather than semantic similarity.”
Boundaries (from README): Each operation rescans the ledger, which may require indexing after tens of thousands of entries; concurrent writing requires upper-level coordination; personality candidates are proposed by the caller, and the plugin is not responsible for automatically extracting all features from natural language; client visual verification cannot be completed without a DSH browser environment.
Security and Permissions: The plugin runs with the current DSH process permissions and reads/writes the local ledger directory (default ~/.dsh/ai-memory). Before installation, you should read the source code and MIT license on GitHub to confirm the bundle source is trusted; the community directory SkillHub is an independent site and has no official affiliation with DeepSeek / High-Flyer.
Conclusion¶
dsh-ai-memory turns “judgment memory” into an auditable JSONL ledger: deterministic supersession, bidirectional relationship links, separate tracks for rules and personality, and graph-based navigation. If you are building long-term collaborative agents in DSH, you can learn more from the directory page or repository and install it locally as a bundle.
- Directory Page: https://www.skillhub.cn/plugins/Isyyyue/dsh-ai-memory
- GitHub: https://github.com/Isyyyue/dsh-ai-memory