Introduction

In long-term projects (software development, academic research, product design), LLM/agent conversations often span multiple sessions. Each time a new conversation starts, the model “forgets” and the background must be explained again. This leads to reduced efficiency, information loss, and a disrupted experience. DialogueContextBridge is a DSH (DeepSeek Harness) plugin designed to address cross-session context bridging.

What Is It?

DialogueContextBridge is a DSH plugin maintained by ShadowQuill. It packages “information already understood” from a conversation into portable knowledge units, supports one-click import into a new conversation, and lets the AI avoid repeatedly learning the background from scratch.

Plugin data is stored only locally in ~/.dsh/ and is never uploaded to any server. Snapshots are plain-text Markdown files and support migrating memory across devices/accounts via file import/export.

Core Design: Three-Layer Snapshots

The plugin designs snapshots as a three-layer structure to address the “summarization loss” problem.

  1. Verbatim key messages: finalized code, decision conclusions, technical parameters, and hard instructions. The strategy is to preserve them verbatim, without compression or truncation.

  2. Structured summary: discussion background, reasoning process, intermediate trial-and-error, and excluded approaches. The strategy is for /compile to compress it into hierarchical points (built-in extractive mode, or call the host LLM via summary.mode=llm).

  3. User preferences and settings: style preferences, role settings, and hard project constraints. The strategy is to archive them by stable key for easier cross-snapshot resolution.

Installation and Enablement

Install the plugin in the DSH working directory.

npm install dsh-plugin-dialogue-context-bridge

Load the plugin in the DSH configuration.

import bridge from 'dsh-plugin-dialogue-context-bridge';

ctx.plugin(bridge, {
  maxTokens: 4096,
  autoSave: false,
});

Typical Usage

The plugin provides the following commands to run the complete loop.

  1. Compile and save:
# 编译当前对话为快照草稿(仅在内存中)
/compile --title "上下文桥接架构评审" --tags 架构,phase1

# 确认无误后落库
/save
  1. Retrieve and import:
# 按关键词找回快照
/snapshot-search 上下文桥接

# 在新对话里一键引入(默认仅新信息模式)
/import snap_a1b2c3

# 想融合历史快照?使用 merge 模式
/import snap_a1b2c3 --mode merge
  1. Cross-device migration:
# 导出快照为 .md 文件
/dcb-export snap_a1b2c3

# 从文件导入快照(自动分配新 id,不覆盖)
/dcb-import ~/Desktop/my-snapshots/snap_a1b2c3__xxx.md --dry-run

Notes

  1. Data storage: All data is stored only locally in ~/.dsh/ and is never uploaded to any server.

  2. Environment requirements: Node.js >= 20 (CI matrix is 20.x / 22.x); SQLite >= 3.34 (for the FTS5 trigram tokenizer; Chinese search depends on it, and lower SQLite versions automatically fall back to the unicode61 tokenizer).

  3. Encryption behavior: If encryption is enabled for the data directory, imported content is re-encrypted to disk according to local policy.

  4. Command execution: In DSH 0.1.1-rc.2, the bubble for a manually typed parameterized command may stay in “Executing…” (the result has already been injected; send a new message to clear it). It is recommended to use no-parameter commands (such as /dcb-import-last) or select commands via the command palette.

  5. Version control: What is versioned is the snapshot Markdown plaintext; git history is not encrypted.

Short Conclusion

DialogueContextBridge uses a three-layer snapshot mechanism to build a portable local memory library, making it suitable for developers who need to maintain continuity in long-term projects.