Introduction¶
DSH’s plugin mechanism allows extending the agent workflow without modifying the core process. When developing for DSH, common issues include session state remaining only within the conversation; the lack of task status, decisions, and pitfall records when reopening the same project; and the need to prevent cross-project memory pollution when running multiple projects in parallel. Below is the introduction to crwsr124/dsh-memflow, a memory framework plugin for DSH.
What is it¶
crwsr124/dsh-memflow is a memory framework plugin for DeepSeek Harness (DSH), positioned as the MEMFLOW memory framework. It adopts a distributed memory architecture: each working directory/project has an independent persistent memory/, and memories from different projects are isolated from each other.
This plugin is maintained by crwsr124, is MIT licensed, is a community project, and has no affiliation with DeepSeek officially.
Core Features¶
Load current directory memory on session start¶
When starting a session in any directory, the session automatically loads a memory snapshot of the current directory. Verified priority items include:
history
brick_index
notes
status
tasks
The verified memory snapshot size limit is: single file inline cap 8192 bytes, total snapshot cap 65536 bytes.
Trigger-write during work¶
Task completion, status changes, key decisions, and lessons learned are written immediately. This capability has no fixed flush process, ensuring key state is no longer limited to staying in the conversation.
Protocol variable injection¶
The protocol variable {{memflow_protocol}} is read in real-time from the full text of MEMFLOW.md and injected as a persona during every prompt assembly.
Delegate sub-agent¶
The delegate tool launches a worker sub-agent using a prepared dossier. The prepared dossier mechanically inlines project memory and essential files, supporting foreground, background one-shot, and continuables modes.
The verified delegate dossier single file inline cap is 32768 bytes.
Auto-creation of presets¶
After installation, a memflow preset is created. This preset copies standard, attaches the persona via the protocol variable, and disables built-in sub-agent tools to prevent recursion. It does not change the original default preset of the deployment.
Installation and Activation¶
After the initial installation, the dsh process needs to be restarted to load it. The installation command selects the target profile:
dsh plugin --profile <name> add github:crwsr124/dsh-memflow
Common examples:
dsh plugin --profile web add github:crwsr124/dsh-memflow
dsh plugin --profile headless add github:crwsr124/dsh-memflow
After installation, you can select the “Memory Flow Mode” preset as needed when creating a new session. The headless deployment can run tasks directly:
dsh --profile headless "your task"
Typical Usage¶
- Start a session in any project directory. On session start, it reads the current directory’s
memory/snapshot and organizes the context according to verified priority items:
history
brick_index
notes
status
tasks
-
Process tasks during the session. Task completion, status changes, key decisions, and lessons learned are written immediately.
-
Use
delegatewhen you need to delegate to a sub-agent. The memory ofproject_dirand thecontext_filesare mechanically inlined into the dossier. -
If you need to adjust behavior, override configuration items in the profile’s
cordis.patch.ymlaccording to the plugin ID. Verified supported configuration items include:
protocolFile
setDefault
memoryBootstrap
rosterlessProtocol
memoryPriority
memoryPerFileBytes
memoryTotalBytes
maxInlineBytes
denyTools
enableRunInBackground
backgroundMode
provider
toolName
maxDepth
suppressRoots
A few verified configuration/limit notes:
setDefaultdefaults tofalse; it creates amemflowpreset during installation but does not change existing defaults; it is only set as default via the settings service when explicitly set totrue.memoryPerFileBytescorresponds to the verified single file inline cap of 8192 bytes.memoryTotalBytescorresponds to the verified total snapshot cap of 65536 bytes.maxInlineBytescorresponds to the verified delegate dossier single file inline cap of 32768 bytes.denyToolsdefault deny list issubagent,subagent_fork,delegate, used to prevent recursion.- The project roots specified in
suppressRootsdo not have protocol injected, nor are memory snapshots injected.
Implementation Notes¶
- Zero
@deepseek-aidependency, avoiding module shadowing and symbol splitting caused by name conflicts with combination rows. - Sub-agent related tools are controlled by the deny list by default to prevent recursion.
- Both memory snapshots and delegate dossiers have inline size limits; if the limit is exceeded, do not assume complete injection will occur.
- The plugin runs with the current dsh process permissions; check source code and license before installation.
Use Cases¶
Suitable for users who need to retain project-level session memory in DSH, especially for the following situations:
- The same project continues across multiple sessions, needing to restore task status, decisions, and pitfall records.
- Multiple projects running in parallel, needing project memory to be isolated from each other.
- Using
delegateto start a sub-agent, needing to bring project memory and essential files as context. - Enabling “Memory Flow Mode” as needed in web or headless profiles.
Links¶
Verified GitHub address:
https://github.com/crwsr124/dsh-memflow