Preface¶
When building agents in DeepSeek Harness (DSH), session context usually exists only within the current process and the model window. After shutting down the service or switching profiles, preferences and conclusions confirmed in previous conversation turns often cannot automatically carry over to the next. The community has explored approaches like using MCP or modifying Harness source code to connect external memory, but these either rely on model-side invocation or incur high maintenance costs.
Below is an introduction to dsh-hindsight-bridge: a standalone Cordis bundle that interfaces with Hindsight using Harness native lifecycle events to implement per-turn recall and retain, without patching Harness source code. The maintainer is GitHub user online111111, and it is categorized as “Memory” in the SkillHub directory.
What is this¶
dsh-hindsight-bridge is aimed at developers who have already deployed DeepSeek Harness and have access to the Hindsight API. It automatically completes “recalling relevant memories before each turn starts” and “writing retainable content after each turn ends” within the DSH pipeline. Configuration options support boundaries such as API address, bank, switches, and timeouts, and it performs redaction on common key patterns by default.
In terms of implementation, it relies on the Cordis plugin mechanism and DSH session events, rather than initiating MCP memory calls during model turns. The Web interface also provides a Hindsight settings block, aligning with the atomic change mechanism of ConfigForms.
Environment and Dependencies¶
Before installation and operation, the conditions listed in the README must be met:
- DeepSeek Harness
0.2.0-rc.2 - Node
^22.19.0 || >=24 - Accessible Hindsight
0.10API; a dataplane API key should be used, not the access key for the management UI - The plugin is installed on the profile actually being used (e.g.,
web,desktop, or custom profile); it is recommended to enable only one automatic memory plugin per profile.
The plugin package version is 1.0.0, licensed under MIT. There is currently no official npm release; do not install solely by package name.
Core Behavior¶
Recall¶
Recall is executed once before the first request is sent to the model in each turn. The query text comes from real user input. Recall results are written into the durable user-role history as a bounded, explicitly labeled memory block; tool continuation steps within the same turn reuse this block without repeating the recall.
Retain¶
Content is collected from committed live events, retaining only real user text and final successful assistant text. The following content will not be written: plugin context, reasoning chains, tool payloads, restored history, model-only surface substitutions, and interrupted or failed turns.
Each turn uses a stable and distinct document ID; Hindsight’s replacement semantics will not erase earlier turns.
Asynchronous, Flushing, and Security¶
Retain is non-blocking: after an asynchronous operation is accepted, it polls until completion; “accepted” does not mean “completed”. session/flush and plugin disposal drain the pending write queue within the deadline.
Queue overflow or write failures are logged with non-sensitive error codes; POST requests are not automatically retried. Data may still be lost if the process is force-killed, the service crashes, or the flush times out—this is not a persistent offline log.
HTTP redirects are rejected; HTTPS is required except for loopback. Requests/responses have deadlines, byte limits, and cancellation to limit failure impact.
redactSecrets is enabled by default, performing best-effort redaction based on common key/token/password/private-key patterns; it does not guarantee identification of sensitive information in arbitrary natural language.
By default, memories of child sessions are not included; if synthetic content should also enter the bank, the corresponding option must be explicitly turned on.
Configuration Key Points¶
Fill in the configuration for the hindsight-memory plugin entry in the profile. It is recommended to inject the API key via environment variables, and the host process must inherit this variable. Example patch:
- id: hindsight-memory
config:
apiUrl: https://memory.example.com
apiKeyEnv: HINDSIGHT_API_KEY
bankId: deepseek-harness
autoRecall: true
autoRetain: true
Notes:
apiUrlshould be the HTTPS API root path, without/mcp/...or/v1suffixes, and do not point to the UI.- If using a shared Hermes bank, explicitly select
hermes-default; the defaultdeepseek-harnessbank is used for isolation from DSH instances. - Important fields include
enabled,apiUrl,apiKey/apiKeyEnv,bankId,autoRecall,autoRetain,recallBudget,recallTypes, etc. Recall defaults to observation-type memories; if the bank has not yet accumulated observations,worldandexperiencecan be added torecallTypes. - There are also limitation items such as
recallTimeoutMs,retainTimeoutMs,operationTimeoutMs,flushTimeoutMs,maxQueryChars,maxBlockChars,maxRetainChars,maxPendingWrites; for complete fields, refer to the exported Config schema.
Memory content is appended to history based on character limits, without rewriting the system prompt or earlier messages; each turn adds at most approximately maxBlockChars characters of model input, and multiple tool steps within the same turn see the same injected content.
Web clients can change configurations in the Hindsight settings area; conflicting writes will retain the draft, requiring an explicit discard to reload the current configuration. Keys are redacted in the host schema, and password inputs will not echo existing keys.
Installation and Activation¶
- Download the installable tarball from GitHub Release v1.0.0.
- Execute in the download directory (using the
webprofile as an example; for Desktop, use the bundled DSH CLI’sdesktopprofile):
dsh plugin --profile web add ./dsh-hindsight-bridge-1.0.0.tgz
- Modify the
hindsight-memoryconfiguration in the profile according to the previous section, and ensureHINDSIGHT_API_KEY(or your configured env name) is visible to the DSH process. - Restart the selected DSH service when convenient; the installation steps will not modify the memory server or automatically restart running applications.
Verification and Uninstallation¶
View the current profile configuration (output may contain credentials, do not paste publicly):
dsh --profile web --dump-config
Remove the plugin:
dsh plugin --profile web remove dsh-hindsight-bridge
Online acceptance idea: Perform an authenticated health/recall read check on Hindsight, then initiate a real user conversation turn and wait for retain to complete.
Scenarios and Cautions¶
Suitable for: Developers already using DSH 0.2.0-rc.2 with an existing Hindsight 0.10 service, who want session-level automatic recall/retain but do not want to modify Harness source code or rely on model-side MCP memory.
Cautions:
- The plugin accesses Hindsight with the permissions and network environment of the current DSH process; before installation, you should read the repository source code and MIT license, and independently assess API key and bank isolation strategies.
- The SkillHub plugin directory (https://www.skillhub.cn/plugins/online111111/dsh-hindsight-bridge) is a community site with no official affiliation with DeepSeek / High-Flyer; star counts and other metadata are subject to the directory page (currently 0).
- Keep only one automatic memory plugin to avoid multiple plugins writing to the same bank or duplicate injection.
Conclusion¶
dsh-hindsight-bridge connects Hindsight to the DSH native session lifecycle: per-turn recall, per-turn retain, configurable boundaries, and Web-side settings. It is suitable as a “Memory” category Cordis plugin for implementing long-term context. For details and release packages, see the GitHub repository https://github.com/online111111/dsh-hindsight-bridge , and for directory introduction, see https://www.skillhub.cn/plugins/online111111/dsh-hindsight-bridge .