dsh-project-memory: Cross-session Engineering Memory

Preface

When running coding agents on DeepSeek Harness (DSH), the same repository often involves multiple rounds of sessions. The model itself does not remember root causes already investigated in previous rounds, nor does it remember fix approaches already falsified in the project. Consequently, a common phenomenon is: repeated derivation and repeated pitfalls. Some people in the community use long transcripts or manually paste notes to supplement context, but transcripts are large and noisy, and tend to mix “guesses” with “verified conclusions.”

Below is an introduction to dsh-project-memory (category: Memory), released by maintainer yuyuyyyyyyyyyyyy. It maintains persistent records of engineering conclusions for each project on the host side, and recalls a small number of relevant entries into the prompt before the agent plans tasks. What it stores is structured conclusions, not the full conversation history.

What Is This

dsh-project-memory is a host-plane Cordis plugin: it does not modify the Harness core package, nor does it copy or edit built-in presets. It mounts onto the profile via dsh.bundle.patch, provides the projectMemory service, performs recall each time the system prompt is assembled, and registers a set of memory tools with the agent.

The current version of the plugin is 1.1.1 (see the repository’s package.json), license MIT, and the runtime environment requires Node >= 20.

Core Capabilities

No Need to Choose a Preset / Mode

Because it is a host-plane plugin, once installed it applies to all agent presets (the README lists standard, ptc, minimal, cordis, and custom-written presets). There is no preset named project-memory in the mode selector; if an old installation leaves this preset behind, the documentation suggests deleting it—the functionality does not depend on it.

Injection Timing and Standing Contract

Contribution Hook Purpose
projectMemory service host plane Shares records across sessions per project
project-memory:recall ctx.systemPrompt.context() Recalls at the prompt assembly stage, before agent planning
project-memory:usage ctx.systemPrompt.section() Contract: search first, then record; write down reusable knowledge generated in this round; correct rather than repeatedly stack
memory_search ctx.tools.register() Explicitly retrieves by file, symbol, error text, symptom, feature, etc.
memory_record ctx.tools.register() Writes a structured conclusion
memory_correct ctx.tools.register() Marks old conclusions as superseded / corrected / invalidated / confirmed, can link to replacement records
memory_forget ctx.tools.register() Deletes a single or limited batch of inactive records (with project validation)
memory_audit ctx.tools.register() Views recalled/written/revised content and reasons

Record Structure (Conclusions vs. History)

A single record separates observations, inferences, and conclusions, preventing unverified guesses from being treated as “history.” Field groups include: identity (id, project, project_path, session_id, etc.), problem (problem, symptoms[]), facts[] (observations), hypotheses[] (inferences with open|rejected|confirmed), attempts and failures (attempts[], failed_attempts[]), conclusion side (root_cause, conclusion, verification), results (changes[], constraints[]), recall signals (related_files[], related_symbols[], tags[]), and revision status (status, superseded_by, etc.).

memory_record requires verification to be non-empty when conclusion: "verified", otherwise it refuses to write.

Automatic Recall

Each time the prompt is assembled, the plugin constructs a query from the session log:

  • The last human message (source.kind === 'user', excluding injected context or tool results);
  • File paths and symbols harvested from recent tool/call parameters;
  • The current session’s cwd.

Candidate records are kept only for the same project, and weighted scoring is performed based on signals such as paths, symbols, tags, problem/symptom words, failed attempts/constraints, etc.; by default, at most 3 records are kept (maxRecallRecords, configurable). When the score is below minScore, no block is injected, avoiding empty blocks or extra costs from irrelevant tasks. Records that have been superseded or invalidated are filtered out.

Project isolation is implemented by projectIdOf(cwd) (a slug + hash of the normalized cwd); Windows paths are case-folded, and separators are normalized.

Auditing and Debugging

Each recall, write, and revision writes to a bounded audit trail, which can be filtered by action and project via memory_audit, allowing you to view the query, number of candidates, injected record ids, relevance reasons, and injection volume. Setting the environment variable DSH_PROJECT_MEMORY_DEBUG=1, or setting debug: true on the plugin row, enables info-level logging.

Installation and Activation

Before installing, please read the repository source code and LICENSE yourself; the plugin reads and writes host-side storage with the permissions of the current dsh process. Installing indicates that you trust this package.

The official installation command (from the README’s Install section verbatim):

dsh plugin --profile web add github:yuyuyyyyyyyyyyyy/dsh-project-memory

Replace web with your profile name; github: can also be replaced with a registry name, tarball, or local path. After execution, restart dsh to complete the installation. This package declares dsh.bundle.patch; dsh plugin appends it to the profile’s dsh.profile.bundles, and then the in-package cordis.patch.yml mounts the plugin on the host side.

dsh plugin forwards to pnpm, so pnpm must be on PATH (e.g., corepack enable pnpm or npm i -g pnpm). The package contains no install scripts.

If you don’t have pnpm, you can do it manually: place the directory at $DSH_HOME/profiles/node_modules/dsh-project-memory/ (or a node_modules that Node can walk to under the profile), add "dsh-project-memory" to the dsh.profile.bundles array in $DSH_HOME/profiles/<profile>/package.json, and then restart dsh.

An example fragment of optional configuration (README Configuration section; all keys are optional):

- insert:
    - id: project-memory
      name: dsh-project-memory
      config:
        maxRecallRecords: 3

The documentation states that the patch row’s name must be a literal string, not a !!js expression; after modifying the plugin source code, you need to restart dsh to load the new module. Two dsh processes under the same $DSH_HOME cannot share the same session (will throw SessionAlreadyOwnedError).

Typical Usage (Agent Side)

The README defines behavior through project-memory:usage; during tasks, the agent should:

  1. When background is needed, first use memory_search (or rely on automatic recall before each prompt);
  2. When this round produces root causes, failed paths, or constraints that can be reused across sessions, write them using memory_record;
  3. When discovering that an old conclusion is wrong, use memory_correct to mark the revision relationship, rather than writing another duplicate conclusion;
  4. When needing to investigate “why these were recalled, which ones were filtered out,” use memory_audit.

For specific fields and tool parameters, refer to the repository README and source code.

Applicable Scenarios and Notes

Suitable for: DSH coding agents that maintain the same code repository over the long term and collaborate across multiple sessions; teams or individuals who want to reduce repeated trial and error and solidify “verified root causes / failed solutions / project constraints” into retrievable conclusions.

Notes:

  • The community directory SkillHub plugin page and the GitHub repository are maintained by the community and have no official affiliation with DeepSeek / Hia; the DSH ecosystem emphasizes “everything is a plugin,” so please judge the installation source yourself.
  • Do not fabricate configuration items that do not appear in the documentation; for the complete configuration keys, see the README (the Configuration section was truncated in the retrieved materials; refer to GitHub for the authoritative version).
  • Concurrency: Different sessions can run in parallel, but the Concurrent writers section of the documentation explains the impact of multiple writers on storage. It is recommended to read the full README before production use.

Links

  • Directory page: https://www.skillhub.cn/plugins/yuyuyyyyyyyyyyyy/dsh-project-memory
  • Source code and documentation: https://github.com/yuyuyyyyyyyyyyyy/dsh-project-memory

Through the above steps, a single dsh plugin add enables project-isolated engineering memory under all presets, and automatically recalls relevant conclusions before planning.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye