hme-plugin

August 17, 2026 · View on GitHub

English | 中文

Give your DeepSeek a mind of its own.

Current version v0.5.1 · requires DeepSeek Harness dsh-* >=0.1.0-rc.6 <0.2.0

Changelog

VersionHighlights
v0.5.1Core-layer convergence: banner and hme-status promoted to the core layer (alongside memory/archive/recall); enableBanner / enableStatus toggles removed — always on
v0.5.0Startup banner + status dashboard: a dashboard banner lights up on start; a hme-status tool and /hme-status command report version, memory usage, archive counts, and rules
v0.3.0TTL expiry + value tiers: memories can expire (V1 identity/lessons never; V2/V3 default 365d/90d, rules editable); entries carry [v:N] tier markers so the precious 1/10 is kept
v0.2.0Tag-indexed archive: per-topic files + tag overwrite (same tag replaces old entry, self-consolidating); multi-tier architecture doc
v0.1.0Initial: core memory (USER/MEMORY) + archive overflow + recall

Dependency matrix

PackageRange
@deepseek-ai/cordis>=4.0.0 <5.0.0
@deepseek-ai/dsh-agent / dsh-home-paths / dsh-llm / dsh-scope / dsh-system-prompt / dsh-tools>=0.1.0-rc.6 <0.2.0
@deepseek-ai/schemastery3.18.1

DeepSeek Harness is formidable — yet it harbors one flaw: the moment a session ends, the memory resets. Preferences, conventions, hard-won lessons all evaporate, and the next session starts from blank.

Enter HME (Harness-Memory-Evolution).

The Whale's Threefold Memory

  1. Who you are — your identity, your preferences, your habits, remembered across every project.
  2. What this project is — the irreplaceable tech stack, conventions, and core points of each workspace.
  3. The pits you've fallen into — proven lessons and core methodology; anything genuinely useful, commit to memory.

Yet it never grows bloated. Core memory is sealed by bounded caps to keep only the essence; the flood of experience sinks into an archive tier, retrieved on demand and pruned by suggestion when full — like a CPU's multi-level cache: the small and fast stay resident, the vast stay within reach.

Drawing on the strengths of Codex, Claude Code, OpenClaw, and Hermes Agent, HME lets your whale never forget — and never be distracted by trivia.

How it stacks up

DimensionCodex CLIClaude CodeOpenClawHME
Memory shapeMEMORY + USER two filesCLAUDE.md + skillslayered memoryUSER + MEMORY + archive three-tier
Against bloathard cap (reject)unboundedvector storebounded core + elastic archive
Retrievalnone (full injection)skills on demandvector searchrecall keyword search
Expertise inmodel writes manuallyhuman hand-writesautomaticmodel writes + 4 distillation criteria
Auditabilityplain textplain textstructured / black-boxplain text §-delimited

Install in 30 seconds

Once installed, every DeepSeek Harness start lights up a status dashboard in the terminal:

╭──────────────────────────────────────────────────────────╮
│                                                          │
│   HME · Harness-Memory-Evolution                  v0.5.1 │
│ Give your DeepSeek a mind of its own.                    │
│                                                          │
├──────────────────────────────────────────────────────────┤
│ core memory                                              │
│   USER.md                               210 / 1597 chars │
│   C:\Users\demo\.dsh\hme\USER.md                      │
│   MEMORY.md                              91 / 2584 chars │
│   .dsh/hme/MEMORY.md                                     │
│ archive                                                  │
│   dir                                   .dsh/hme/archive │
│   entries                              0 across 0 topics │
│ rules                                                    │
│   V1 never · V2 365d · V3 90d                            │
╰──────────────────────────────────────────────────────────╯

Step 1 · Install the plugin

From GitHub (recommended, works right now):

dsh plugin --profile web add github:weopenfire-git/hme-plugin

Or from npm (released):

dsh plugin --profile web add @yinging/dsh-hme

Step 2 · Add one loader row

Open the profile's cordis.patch.yml and add a host row:

- insert:
    - id: hme-plugin
      name: '@yinging/dsh-hme'  # package name for npm; use github:weopenfire-git/hme-plugin for GitHub
      config:
        memoryCharLimit: 2584
        userCharLimit: 1597

Step 3 · Restart and behold

Restart dsh — the banner means it's working. At any time, ask for hme-status or type /hme-status to inspect memory state.

Give your DeepSeek a mind of its own.


Technical reference

Cross-session long-term memory for DeepSeek Harness, as an out-of-tree plugin. It gives an agent two bounded plain-text memory files plus a memory tool, so user preferences and project facts survive across sessions instead of being relearned every time.

Status: v0.5 — core memory (Phase 1) + archive overflow layer (Phase 1.5) + status dashboard (startup banner, hme-status tool, /hme-status command). Developer preview: the Harness APIs this plugin builds on are still changing. See DESIGN.md and ARCHIVE.md.

What it ships

  • A memory tool that adds, replaces, and removes durable facts.
  • An archive tool (add/replace/remove/move) plus a recall tool over a larger per-workspace overflow layer.
  • An hme-status tool (plus an optional /hme-status slash command) reporting version, memory usage against caps, archive counts, and expiry rules.
  • Two context blocks, frozen at session start and injected into every turn of that session:
    • hme:user — the global user profile.
    • hme:memory — the current workspace's project facts.

Memory files

FileLocationHard cap
USER.md$DSH_HOME/hme/USER.md (global, shared across workspaces)1,597 chars (F₁₇)
MEMORY.md<workspace>/.dsh/hme/MEMORY.md (per workspace)2,584 chars (F₁₈)

Facts are one per line, §-terminated, and human-editable. Caps count Unicode code points. A write that would exceed the cap is rejected, never truncated. Every write re-reads the latest file and merges at the fact level, so concurrent sessions do not clobber each other's edits.

Install

Install from npm or Git into a profile, then reference it by package name:

dsh plugin --profile web add @yinging/dsh-hme
# or from Git: dsh plugin --profile web add github:weopenfire-git/hme-plugin

Add a host row to the profile's cordis.patch.yml (web, CLI, and headless alike):

- id: hme-plugin
  name: '@yinging/dsh-hme'
  config:
    memoryCharLimit: 2584
    userCharLimit: 1597

userMemoryFile and workspaceMemoryFile have sensible defaults; override them to relocate the files.

The memory tool

ParameterTypeRequiredMeaning
actionadd | replace | removeyesMutation to apply.
targetmemory | useryesmemory → workspace MEMORY.md; user → global USER.md.
contentstringfor add / replaceNew fact text.
old_textstringfor replace / removeSubstring that locates the fact to change or drop.

replace and remove locate a fact by substring; if several facts match, the tool reports ambiguity and asks for a narrower old_text. A write never changes the current session's injection — the next session re-reads the files.

Configuration

FieldDefaultMeaning
memoryCharLimit2584Hard character cap for MEMORY.md (F₁₈).
userCharLimit1597Hard character cap for USER.md (F₁₇).
userMemoryFile<dshHome>/hme/USER.mdGlobal user-profile path.
workspaceMemoryFile.dsh/hme/MEMORY.mdWorkspace-relative project-memory path.
archiveCharLimit131072Soft character cap for the archive (2¹⁷ ≈ one context window).
archiveMemoryFile.dsh/hme/archive.mdWorkspace-relative archive path.
archiveDirectory.dsh/hme/archiveWorkspace-relative directory holding per-topic archive files.

How it works

At agent/session-start the plugin freezes both files into a per-scope snapshot, and the two context blocks serve that snapshot for the whole session. Writes go straight to disk with read-merge-write, so the current session's view stays stable while the next session sees the latest facts. Injection uses systemPrompt.context(), which records the memory as a persistent user-role snapshot rather than re-reading the files each turn.

Develop / verify

hme-plugin is a pnpm workspace member for dependency resolution only, not a build target. Run pnpm install once so its @deepseek-ai/* dependencies link, then:

pnpm exec tsc -p hme-plugin
pnpm exec vitest run --config hme-plugin/vitest.config.ts

Developing alongside other plugins in the same repo

If you develop several independent plugins inside one workspace checkout (for example under DSHarness/prototypes/), follow the shared collaboration rules in DSHarness/prototypes/AGENTS.md — each plugin stays self-contained with its own node_modules, workspace entries append without touching others', and shared files such as pnpm-workspace.yaml / pnpm-lock.yaml are only appended, never rewritten.

Roadmap

  • Phase 1.5 — archive overflow layer (archive / recall tools); see ARCHIVE.md.
  • Phase 2 — skill evolution: generate, optimize, and curate skills.
  • Phase 3 — reflection and maintenance in background jobs.

License

MIT