dsh-memory-ladder: DSH's layered compression backend

btyg123/dsh-memory-ladder is a compression backend bundle for DeepSeek Harness, maintained by BTYG123 and released under the MIT license. It implements a context layering strategy based on recency: the latest round occupies T/3 of the window, with earlier layers halving successively (T/6, T/12, etc.). A single model call rewrites the history to be discarded as a memory ladder, replacing the masked history with a checkpoint. Compared to default compression, it triggers earlier and maintains a stable 2:1 ratio between new and old layers. Starting from v0.2, before compression, user, assistant, and tool messages are written into session-independent archives; subsequent steps retrieve the original text based on the user's question and provide it to the model via a dynamic context interface. The README positions this tool as a capacity saver rather than an information saver, noting that secondary details decay as they move down the layers. Installation requires installing `pnpm` globally via `npm i -g pnpm`, then adding the plugin using `dsh plugin --profile <profile> add git+https://github.com/BTYG123/dsh-memory-ladder.git`, and disabling `compaction-basic`. Configuration options include `newestFraction`, `tierCount`, `maxSummaryTokens`, `archiveRecall`, `archiveDirectory`, `recallMaxBytes`, and others. Verified on `@deepseek-ai/dsh@0.2.1-rc.5` with Node.js 22/24. Known limitations include an inability to compress extremely large single messages, the inability to compress further once archives are full, the fact that the sleep operation itself consumes a model call, and the fact that it is non-lossless.

Read More