dsh-compaction: An Efficient Context Compaction Backend for DeepSeek Harness

ljsysfurryace/dsh-compaction

Tools & CapabilitiesVerified
Listed on 2026-08-27
Page last updated 2026-09-27

AgentFrame compaction backend for DeepSeek Harness, replacing default LLM summarization with semantic+physical KV compression achieving 28.4x without extra LLM calls.

dsh-compaction is a compaction backend plugin for DeepSeek Harness that replaces the default LLM summarization with a semantic and physical dual-track approach, addressing the lossy and LLM-heavy nature of the default. The semantic track uses MemoryDirector to retain key information, while the physical track applies absorptive MLA and INT4 quantization, achieving about 28.4x KV compression without extra LLM calls. It supports automatic pressure-based triggering and manual /compact control, with adjustable parameters like retainRatio, ideal for DSH users managing long conversations efficiently.

How to Install

install
dsh plugin --profile web add github:ljsysfurryace/dsh-compaction
Category
Tools & Capabilities
Platform
DSH Plugin
Author
ljsysfurryace
Distribution
Plugin

dsh-compaction Key Features

Semantic compression retains key infoPhysical compression saves tokensNo extra LLM callsAuto/manual compaction triggers
Listed on dsh-plugin.org

dsh-compaction Repo Summary

What Does It Do?

dsh-compaction is a DSH plugin for DeepSeek Harness that replaces the default LLM summarization compaction with a semantic and physical dual-track compression backend. It solves the problem of lossy summarization and extra LLM calls by preserving key information through semantic analysis and quantizing tokens physically, achieving about 28.4x KV compression without additional LLM invocations. Maintained by ljsysfurryACE under GPL-3.0, it suits DSH scenarios needing efficient long-context management.

Core Features

  • Semantic compression: uses MemoryDirector to judge token value, removing chit-chat and retaining key high-information lines.
  • Physical compression: applies absorptive MLA and INT4 quantization, reducing bytes per token from 270KB to 7.6KB for a 28.4x compression ratio.
  • Automatic triggering: compresses based on pressure without manual intervention.
  • Manual control: supports manual compression via the /compact command or region-specific compression.
  • Configurable parameters: allows adjusting retention ratio and byte settings to fit different scenarios.

How to Use This Plugin?

In your DSH profile configuration, replace the default compaction-basic with compaction-agentframe and enable semantic and physical compression options. Once enabled, the plugin monitors conversation pressure and triggers compression when needed, preserving key information and saving tokens. For manual compression, type the /compact command in the conversation, or adjust parameters like retention ratio in the config.

This page is an independent rewrite of the plugin's official README — for authoritative documentation and the latest changes, refer to the source: ljsysfurryace/dsh-compaction. The plugin is third-party code that runs on your machine once installed; inclusion does not imply endorsement — please review the source before installing.

Install, update, and uninstall this plugin in the Plugin Market of DeepSeek Harness's DSH Plugin Hub

DSH Plugin FAQ