Introduction¶
During long-running operation of multi-agent systems, repeatedly reading tool results, prompt compression causing rules to become ineffective, and expensive models performing review tasks are common causes of excessive Token consumption and a lack of observability. The DeepSeek Harness (DSH) plugin ecosystem aims to solve these problems through plugin-based approaches.
Plugin Introduction¶
gongyijie85/dsh-agent-frugality is a DSH plugin used to implement read-ledger deduplication, compression-immune rules, a mechanical completion gate, and a low-cost review lane in multi-agent systems. The plugin has zero external dependencies and can run through injection.
Core Features¶
The plugin provides the following core capabilities:
1. Read-ledger deduplication: records content hashes for each agent’s read operations and visualizes waste from repeated reads.
2. Compression-immune rules: places defensive rules in non-compressible prompt sections to prevent rule loss caused by context compression.
3. Mechanical completion gate: requires completion claims to pass validation and prevents invalid completion attempts.
4. Low-cost review lane: uses low-cost models to independently review work, while the main model does not review itself.
Installation and Dependencies¶
Installation command:
dsh plugin add github:gongyijie85/dsh-agent-frugality
Runtime requirements:
* Node.js >= 20
* DSH >= 0.1.0-rc.6
Typical Usage¶
The plugin is used through the following tools and configuration options:
* Tools:
* frugality_ledger: read ledger; view each agent’s reads, duplicates, and byte consumption.
* frugality_gate: completion gate; validate completion claims and exit codes.
* frugality_review: low-cost review; execute reviews in an independent lane.
* Environment variable configuration:
* DSH_FRUGALITY_DEDUP: set to 1 to enable deduplication (default: 0).
* DSH_FRUGALITY_GATE: set to 0 to disable the completion gate (default: 1).
* DSH_FRUGALITY_GATE_MAX: maximum number of gate objections (default: 2).
* DSH_FRUGALITY_REVIEW_MODEL: review model ID; set to auto to use the CHEAP family.
* DSH_FRUGALITY_RULES: custom rules file (default: built-in).
* DSH_FRUGALITY_LEDGER_CAP: maximum number of entries in the read cache table (default: 30).
* DSH_FRUGALITY_WORKDIR: working directory for gate validation commands (default: current directory).
Logs and Storage¶
The plugin does not store content and only records hashes.
* Log file located at $DSH_HOME/agent-frugality.log.
* Ledger file located at $DSH_HOME/agent-frugality-ledger.l.
Notes¶
- Default behavior: deduplication (DEDUP) is disabled by default, and the completion gate (GATE) is enabled by default. It is recommended to observe baseline data through
frugality_ledgerbefore deciding whether to enable deduplication. - Permissions and security: the plugin runs with the permissions of the current DSH process. Please check the source code and license (MIT) before installation.
- Ecosystem positioning: this plugin fills gaps not covered by shared memory, model routing, and task orchestration plugins, focusing on read deduplication, completion gating, and low-cost review.
Summary¶
dsh-agent-frugality provides observability and cost-control mechanisms for multi-agent systems. It quantifies waste through the read ledger, constrains behavior through the mechanical gate, and reduces costs through low-cost review.
- GitHub repository: https://github.com/gongyijie85/dsh-agent-frugality