coding-agents
vectorize-io/hindsightHindsight:会学习的 Agent 长期记忆系统,自动召回/保存、知识页、深度反思与按仓库隔离的记忆银行。
面向 DeepSeek Harness 的项目级本地上下文引擎:对历史、代码、文件、用户偏好和 Agent 轨迹做检索/压缩/优先级排序,为任意 LLM 生成动态上下文窗口。
ContextPrism 是一个面向 DeepSeek Harness (DSH) 的本地上下文引擎 / 动态 context window 插件。
完整架构文档见:docs/ARCHITECTURE.md
它会在调用任何 LLM 之前,对以下本地数据做 retrieval / compression / prioritization:
然后输出一个受 token 预算约束的 动态 context window,可适配任意 LLM(DeepSeek / OpenAI / 其他兼容接口)。
ctx.workspaceRegistry 自动定位当前 DSH workspace.lce/index.dbUser Preferences → History → Trajectory → Code → FilesllmSummarization: true 后,压缩阶段会尝试用 DeepSeek 生成摘要deepseek-chat / deepseek-reasoner / OpenAI 兼容 payloadcontext_prism_dashboard 生成独立 HTML 面板/context-prism/dashboard 实时面板fs.watch + 防抖重索引)Context-Prism/
├── package.json # DSH 插件包
├── lib/index.js # DSH 插件入口
├── engine/ # JS 版 ContextPrism 核心
│ ├── models.js
│ ├── text_utils.js
│ ├── cache.js
│ ├── index.js
│ ├── sqlite_index.js
│ ├── retrieval.js
│ ├── prioritization.js
│ ├── compression.js
│ ├── ingest.js
│ ├── engine.js
│ └── providers.js
├── test/ # Node 测试
│ ├── engine.test.js
│ └── plugin.test.js
└── python/ # Python 参考实现(可选)
├── local_context_engine/
├── tests/
└── pyproject.toml
# 从 GitHub 安装(需要仓库公开后)
dsh plugin --profile web add github:LFM097384/Context-Prism
# 或在 profile 的 cordis.patch.yml 中激活
- insert:
- id: context-prism
name: 'context-prism-dsh-plugin'
config:
backend: 'auto'
defaultIndex: '.lce/index.db'
autoInject: true
autoIndexFiles: true
autoMaxTokens: 4000
autoReservedTokens: 800
autoIndexIntervalMs: 60000
fileWatch: true
watchDebounceMs: 2000
llmSummarization: false
summarizationModel: 'deepseek-chat'
summaryMaxTokens: 200
| Tool | 作用 |
|---|---|
context_prism_build | 在调用 LLM 前构建动态 context window |
context_prism_ingest | 把文件/目录/history/trajectory 灌入本地索引 |
context_prism_status | 查看当前项目索引状态(chunk 数量、类型、来源) |
context_prism_dashboard | 生成并保存独立的 HTML 可视化面板到 .lce/dashboard.html |
context_prism_evaluate | 运行 A/B 检索评估(语义+BM25 vs BM25-only) |
context_prism_summarize | 用 LLM 或本地 extractive 方式总结文本 |
npm install
npm test
cd python
python -m unittest discover -s tests -v