Introduction

When developing agents with DeepSeek Harness (DSH), a common pain point is that memory does not persist across sessions: decisions, preferences, and entity relationships confirmed in this session are gone in the next. Common solutions involve attaching a vector database or an independent memory service, but every extra process means extra deployment and maintenance costs.

dsh-trivium’s approach is to make graph memory a DSH plugin, loaded together with the dsh web process, with a .tdb file per workspace, without introducing a sidecar service. DSH’s philosophy is “everything is a plugin”; this plugin converges memory capabilities into four tools and a restrained injection strategy. Below is an introduction to its positioning, features, installation, and precautions.

What is it

dsh-trivium is an open-source plugin maintained by QWQcool, belonging to the memory category, positioning as “In-process graph memory for DeepSeek Harness, backed by TriviumDB”: In-process graph memory based on TriviumDB. It stores only nodes and edges, injects as little as possible, and allows manual correction.

Version and dependency information is as follows:

  • Plugin version: 0.4.16
  • License: MIT
  • Dependencies: triviumdb ^0.8.4 (vector + JSON payload + directed weighted graph)
  • Node requirements: ^22.19.0 || >=24
  • Test host: @deepseek-ai/dsh@0.1.1-rc.2 (dsh-llm / dsh-tools peers also accept 0.1.0-rc.8)

Core Features

Cross-Session Graph Memory

Nodes are divided into four categories: entity / preference / decision / experience; business edges are about / decided / broke / fixed. Facts stored in session A can be retrieved along with their associations when queried in session B.

Quiet by Default

New sessions only inject a short graph (≤400 tokens). The model calls tools on demand if it needs more, dumping content at every step is avoided. The first short graph is injected only once per session; if session-start loses a race with the first model step, pre-step catches up. No rewriting at every step, friendly to prefix caching.

Only Four Tools Provided

ctx_find / ctx_read / ctx_remember / ctx_link. Enabling Chips or Session layer does not add a fifth tool.

Injection and Recall

Short graphs are injected via agent.inject() rather than system prompts, so persona.complete: true will not lose the short graph. Each recall carries a path: which node it hits and which edge it traverses.

Chips Memory Whitelist and Session layer

Chips are disabled by default. After enabling in Settings, the title bar shows the Chips tab. Checked items are fixed for the next round (L0, ≤300 tokens), and chips can be added, archived, or deleted. Session layer is also disabled by default; enabling it allows compressed/forked graphs to be drawn as flowcharts.

Manually Editable

In Settings, you can search, rename, merge, import/export.

Strict Extraction and Write Hygiene

Small talk, one-off file edits, and keys are not automatically written from conversation history. ctx_remember, chip add, extract, and external imports all go through a write hygiene gate, rejecting gibberish, stutter loops, JSON envelopes, base64 residues, and keys.

Optional Embedding

Disabled by default. The official DeepSeek chat API does not have an embeddings endpoint; if vector recall is needed, you can fill in an OpenAI-compatible URL. When not enabled, keyword + graph traversal is still available.

Git sidecar

Disabled by default; trivium.jsonl serves as the git source for business facts. When enabled, you can generate/delete jsonl.

Others

  • Failures do not block the agent: storage, embedding, and extraction errors are only logged, and the main loop continues.
  • The interface follows the host language (zh / en).

Installation and Usage

Prerequisite is that DeepSeek Harness is installed and dsh web has been started at least once. Run:

dsh plugin --profile web add dsh-trivium

Restart dsh web, open a workspace. Settings will show Trivium memory, and the Chips tab is disabled by default. If you use Dsh_BatStart to launch DSH, the plugin is already installed and this command can be skipped.

After installation, data is located in the following places:

<workspace>/.dsh/trivium.tdb           # Local index, binary, needs gitignore
<workspace>/.dsh/trivium.jsonl         # Business facts, git source
~/.dsh/trivium.json                    # Settings and chip pins, may contain manually entered embedding API key
<workspace>/.dsh/trivium-pending.json  # Local queue when extraction fails

For local source debugging, follow these two steps, then restart dsh web:

npm install
node scripts/link-dsh.mjs

Typical Usage

Cross-Session Access

Store “auth goes in header X” in session A; session B calls ctx_find("auth") and gets the hit along with its about / decided / broke / fixed associations.

Git Collaboration

Commit trivium.jsonl and ignore binary files in .gitignore:

.dsh/trivium.tdb
.dsh/trivium.tdb*
.dsh/trivium-pending.json

Disable but Do Not Uninstall

Data is retained. Add to cordis.patch.yml in this profile:

- id: dsh-trivium
  disabled: true

Then restart dsh web.

Update and Uninstall

Update: Run dsh plugin --profile web add dsh-trivium again and restart dsh web; for source code, run git pull then re-run node scripts/link-dsh.mjs. Updates will not clear memory; committed trivium.jsonl can be restored with git checkout.

Uninstall: Stop dsh web first, then run:

dsh plugin --profile web remove dsh-trivium

Uninstalling will delete ~/.dsh/trivium.json, as well as trivium.tdb / trivium.jsonl / trivium-pending.json in every workspace the plugin has opened; other files under .dsh/ are retained.

Use Cases and Precautions

Suitable for developers who want to work on long-term projects on DSH, need to remember decisions and entity relationships across sessions, but do not want to deploy a separate service for memory.

Precautions before use:

  1. The plugin is loaded within the current dsh web process and runs with the permissions of the current process. Before installing, you should check the source code and the license (MIT).

  2. Do not open the same .tdb file with two Node processes at the same time.

  3. Network is disabled by default: chat text is not sent out, extraction and search are performed locally. It is only sent out after you enable embedding and fill in a URL; the Check for updates in Settings only fetches the version number from the npm registry and does not contain conversation content.

  4. ~/.dsh/trivium.json may contain an embedding API key you typed in manually, so keep it safe.

Conclusion

dsh-trivium converges cross-session memory into an in-process file, four tools, and a restrained injection strategy: quiet by default, manually correctable, and failures do not block the main loop. If you need memory capabilities on DSH but don’t want to introduce extra services, give it a try.

  • GitHub: https://github.com/QWQcool/dsh-trivium
  • Directory: https://www.skillhub.cn/plugins/QWQcool/dsh-trivium

skillhub.cn is a community-maintained plugin directory with no official affiliation with DeepSeek / Huafan.