OpenViking
volcengine
Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:MimicHunterZ/dsh-agent-compact
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
English · 简体中文
Context compression for DeepSeek Harness: lets the agent autonomously call context_compact to compress a span of the conversation it chooses — the finished, no-longer-needed middle — and replace it with a checkpoint the agent writes itself.
Compaction is normally a full-context sweep: the official engine only ever compresses from the start of the conversation, so the opening's task plan and direction are partially lost along with the compressed information. context_compact compresses only the span the agent selects — a finished step, a debugged log exchange, an off-track discussion — while the important opening and the recent context stay intact. Span compaction keeps information loss from compaction as small as possible — like human memory, the middle is not compressed indiscriminately: what can be summarized is consolidated into a checkpoint, and important details stay word-for-word — the agent decides what is truly dead, and only that gets condensed.
Typical moments to use it:
startAnchor / endAnchor (unique-prefix matching, CJK punctuation-width tolerant) and passes a required summary — the Markdown checkpoint it wrote itself.~/.dsh/spill/session-<hash>/<hex>-<seq>.txt, sequential naming, restart-safe); the path is echoed in the shadow message so the model can read the raw text back.The tool call itself happens inside the agent's normal turn and is billed like any other turn; what is avoided is only the extra summarizer request the official engine would make for the same span.
# from a published registry package
dsh plugin --profile web add @mimichunterz/agent-compact
# or from a local checkout
dsh plugin --profile web add ./agent-compact
dsh plugin forwards to pnpm in the profile directory and appends the bundle to dsh.profile.bundles (see the official publish guide). Restart the profile — every session then sees the context_compact tool.
The bundle's own cordis.patch.yml pins the spill archive root to ~/.dsh/spill (deployments can override it again through the profile's cordis.patch.yml).
dsh plugin --profile web remove @mimichunterz/agent-compact
dsh plugin remove forwards to pnpm remove in the profile directory: it uninstalls the package and reconciles the bundle out of dsh.profile.bundles. Restart the profile — every session then stops seeing the context_compact tool. The same package name works whether you installed from the registry or from a local checkout.
If the plugin was additionally mounted through a row in the profile's cordis.patch.yml (dev mode), remove that row too, otherwise the patch re-mounts it on the next boot.
| field | default | meaning |
|---|---|---|
autoArchive |
true |
context_compact saves the full raw span to a spill artifact before replacing it |
Pass through the inserted row in the profile's cordis.patch.yml or a bundle patch.
summary is mandatory, so the tool path always uses the checkpoint the agent wrote. patchEngine() (see src/optimizer.ts) wraps the engine's summarize(): when an _externalSummary is present (one-shot, keyed per session id), it returns that text directly; only when none is present does it forward to the stock implementation — a branch that serves the automatic compaction path and keeps official behavior intact.src/normalize.ts): normText collapses whitespace and maps CJK full-width punctuation to half-width (,→, etc.), applied to both anchors and node text. Matching keeps unique-prefix semantics: zero hits → "not found" with closest-node hints; more than one hit → "AMBIGUOUS".max+1) — gap-free; the backend's random hex prefix makes filename collisions impossible.summary argument) and its tool/result are each replaced by one tiny shadow message, so the checkpoint text never appears twice on the surface (skipped when the message holds more than one tool call).0.1.0-rc.6 (@deepseek-ai/dsh-compaction-basic@0.1.0-rc.6).root field → in-memory counter), and compaction itself is unaffected.MIT. The patch derives from @deepseek-ai/dsh-compaction-basic and related DeepSeek Harness packages (MIT, Copyright DeepSeek) — see LICENSE.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: context-compression。