Preface¶
When DeepSeek Harness (DSH) compresses context, it replaces the compressed segment with a single-line summary. No matter how well that summary is written, the details are gone. After a few rounds of compression, what’s left is just a blurry smear. dsh-metabolism doesn’t replace any compression backend. It does a few specific things: stores the original text in a local “outhouse,” leaves behind a textured narrative summary during compression, provides retrieval tools by keyword or date, tags index entries, extracts a “relationship history” between the user and the assistant, and performs passive hydration gated by cosine similarity.
What It Is¶
dsh-metabolism is a DSH plugin maintained by changmingjuebumaimeng3666, categorized under “Memory.” It saves the pre-compression original text (raw session events), the summary at that moment, and the index together into a local directory—one folder per day, one line per entry. Summaries are split into two types: experiences (experiences persist) and facts (facts are preferentially collapsed into index entries). During compression, it no longer leaves just a one-line pointer. Starting from 0.3.1, it uses a summary block; 0.4.0 added tags, relationship history, and passive hydration. Summary blocks have a hard word count of 950–1300.
Core Features¶
-
Archiving: Every time a compression succeeds, the compressed original text, the summary at that moment, and the index are all written to the local directory. One folder per day, one line per entry.
-
Summary Block: Before a segment is compressed, a narrative summary is left behind (what happened, why, what it felt like). Within seven days it’s an event summary; between seven and thirty days it’s collapsed into a daily summary; beyond thirty days it’s collapsed into a single index line. The total summary volume has a budget—as long as it fits, it never collapses. Since 0.4.0, the word count is hard-capped at 950–1300. If it’s under, it won’t be accepted; if it’s over, it won’t be accepted either. It gets sent back for a rewrite.
-
Retrieval: Provides a tool to retrieve the original text by keyword or date, returning snippets and their source. Time-weighted: for the same match, newer entries rank higher.
-
Tags: Index entries are tagged as “Experience / Technical / Chit-chat / Other,” stored by content hash (persists even if the index is rebuilt). Tags are applied automatically at archival time. During hydration retrieval, technical entries are skipped first based on tags.
-
Relationship History: After compression is committed, it extracts sentence-by-sentence from the compressed segment the “in-between” events (arguments, reconciliations, rule-setting, name changes, probing, delegation of authority) and stores them as a timeline in
记忆\关系史\时间线.jsonl—one entry per line. -
Passive Hydration: Each turn inspects the recent few-turn hot window, gated by cosine similarity. On a hit, it retrieves, filters by tag and technical symbols, uses flash to pick the few most worth surfacing, and injects them into context. A segment that’s been injected once won’t be injected again.
Installation & Activation¶
The install command is as follows:
dsh plugin --profile <your profile> add dsh-metabolism
Restart once after installation. The default archive directory is 代谢/茅房 under the profile directory. If you need to change the storage location, you can set it by priority:
- Set
archiveRootin the plugin configuration; - Place a
本地配置.jsonfile in the plugin directory with{ "archiveRoot": "...", "indexDir": "...", "logFile": "...", "switchesFile": "..." }; - Set the environment variable
DSH_METABOLISM_HOME.
If none of these are set, it’s auto-calculated from the profile directory.
Taking Over Auto-Compression (Optional)¶
The runtime switch is off by default. To enable it, write the following in 代谢日志/开关.json in the data directory:
{
"takeover": true,
"dryRun": false,
"softTokens": 600000,
"nudgeStep": 20000,
"thresholdTokens": 650000,
"retainTokens": 530000,
"minKeepTokens": 80000,
"keepRecentHours": 24,
"summaryBlock": true,
"summaryWaitMs": 300000,
"foldEnabled": true,
"foldDryRun": false,
"summaryBudgetTokens": 180000,
"relationship": true,
"hydrate": true
}
takeover: Only read at startup; a restart is required after changing.softTokens: When context hits this number, a reminder is inserted into the conversation so you can browse the directory and pick segments yourself.thresholdTokens: The context must reach this number before the engine is allowed to compress on its own.retainTokens: How much to retain after compression.summaryBlock: Enable summary blocks (enabled by default).summaryWaitMs: How long to wait after a manual segment collection, giving you time to write the summary.foldEnabled/foldDryRun: Whether folding is on, and whether it’s a dry run or a real fold.summaryBudgetTokens: Total cap for summary blocks; only folds when exceeded.
Compatibility with Tool-Call Results¶
DeepSeek requires that “a message with tool calls must be immediately followed by the results of each call.” Compression appends a checkpoint to the tail of the conversation. If at that exact moment a tool call has been sent out but its result hasn’t come back yet, the checkpoint gets inserted in between, and the next request will directly error with tool calls need immediate results. So the engine has a gate: if there are still pending calls at the surface level, compression is never written. When manual compression is triggered (metabolism_compact), since that call itself hasn’t received a result yet, it gets queued first and written after the result lands and before the next turn begins. Version 0.2.3 fixed this exact issue.
Rolling Back¶
Change takeover back to false in 开关.json and restart. The original compression backend comes back immediately. Archiving and retrieval are unaffected.
What the Data Looks Like¶
The directory structure is as follows:
代谢/茅房/2026-11-18/
index.md One line per entry: time range, count, tokens, filename, first sentence of summary
metabolism-<id>.jsonl Original text: verbatim backup of session events
metabolism-<id>.summary.md The summary the model saw at that moment
You can browse it with Notepad. No database, no encryption, no network access.
What It Doesn’t Do¶
- It doesn’t delete anything. The archive only grows, never shrinks. Cleanup is entirely up to you.
- It doesn’t connect to the network. The only network access is downloading dependencies during installation.
Use Cases & Cautions¶
Suitable for DSH users who need to retain session details long-term, need to retrieve snippets by time or keyword, or need to manage the “in-between” relationship history. The plugin runs with the current DSH process permissions. Review the source code and license before installing.
Closing¶
dsh-metabolism collects the full pre-compression original text into a local “outhouse.” The window keeps only a textured summary block. The original text is always there, and details can always be flipped back up. Used alongside four-layer memory plugins, a single window can stay open indefinitely—no need to switch.
- Plugin directory page: https://www.skillhub.cn/plugins/changmingjuebumaimeng3666/dsh-metabolism
- GitHub: https://github.com/changmingjuebumaimeng3666/dsh-metabolism