coding-agents
vectorize-io/hindsightHindsight:会学习的 Agent 长期记忆系统,自动召回/保存、知识页、深度反思与按仓库隔离的记忆银行。
压缩后端:用确定性语义提取器替换 LLM 摘要(保留代码/路径/命令,剔除闲聊),附带 28.4x KV 压缩记账。
AgentFrame 压缩后端插件 —— 把 DeepSeek Harness 的默认 LLM 摘要压缩替换为 语义 + 物理双轨压缩(28.4x KV 压缩思路)。
默认 compaction-basic 用 LLM 摘要(有损总结旧对话),每次压缩都要一次
LLM 调用,且摘要可能丢细节。
AgentFrame 的思路:
在 profile 的 cordis.patch.yml 中把 compaction-basic 替换为:
- id: compaction-agentframe
name: '@deepseek-ai/dsh-compaction-agentframe'
config:
semantic: true
retainRatio: 0.2
physical: true
| 字段 | 默认 | 说明 |
|---|---|---|
semantic | true | 语义压缩(保留高信息行) |
retainRatio | 0.2 | 压缩后保留比例 |
physical | true | 物理压缩记账(bytes/token) |
bytesPerToken | 7776 | INT4 压缩后每 token 字节 |
auto | true | 自动压缩 |
继承 CompactionEngine(compaction seam),实现三个抽象方法:
compactIfNeeded — 自动压力触发compactNow — 手动 /compact 命令compactRegion — 指定范围压缩保持 dsh 的 surface/事件/持久化契约(compaction/start → replace → compaction/end), 只替换"如何压缩"。
GPL-3.0 © Cloud LTE Studio / AgentFrame