Skip to main content
Back to plugins
P

dsh-memory-meow

phant0meow/dsh-memory-meow

Project-scoped cross-session memory: PROJECT.md snapshot injected into the first user message, a memory_remember tool, and auto-reflection after ReAct tasks; each project keeps its own memory file.

Install

dsh plugin --profile web add github:phant0meow/dsh-memory-meow

README

meow-memory ๐Ÿฑ๐Ÿ“

Cross-session project memory for DeepSeek Harness (DSH). Born from the "meow" fork โ€” hence the name โ€” but works on any DSH profile.

The idea: every workspace keeps one human-readable memory file (.dsh-meow/PROJECT.md). New sessions get it injected into the first user message (not the system prompt), so the prompt prefix โ€” and your LLM provider's KV/context cache โ€” stays untouched. When the model finishes a task (a ReAct turn that used tools), the plugin gently asks it to reflect and save what's worth remembering.

โœจ Features

  • Cache-friendly by design: memory is injected as a plain user-message suffix on the session's first user message. The system prompt never changes, and the snapshot is frozen for the whole session โ€” later memory updates cannot invalidate the request prefix.
  • Human-owned memory: .dsh-meow/PROJECT.md per workspace. Plain Markdown, human-editable, git-diffable, deletable with rm.
  • memory_remember tool: the model can write a memory anytime (categories: fact / mistake / preference / user_said / lesson / detail), appended atomically to the right section.
  • Automatic reflection: after a task turn ends (model stopped calling tools), the plugin steers a reflection prompt. The model decides whether anything is worth remembering โ€” and calls memory_remember only when there is. Chat-only turns never trigger reflection.
  • No recursion: reflection rounds are marked; a turn that already reflected, or whose last tool call was a memory_ tool, is never asked again.
  • Zero runtime dependencies: the host bundle is self-contained (esbuild bundles schemastery / dsh-tools / dsh-llm into lib/index.js).
  • Per-workspace isolation: different projects, different memory files.

๐Ÿ“ฆ Install

Via dsh plugin (requires the package to be published / linked)

dsh plugin --profile web add meow-memory
dsh web

By hand (any DSH install, no npm needed)

  1. Copy (or symlink) this package into the profile's node_modules:
    # e.g. for the web profile of a DSH home at ~/.dsh
    mkdir -p ~/.dsh/profiles/web/node_modules
    ln -s /path/to/meow-memory ~/.dsh/profiles/web/node_modules/meow-memory
    
    (On Windows: New-Item -ItemType Junction ... โ€” NTFS junction, no admin needed.)
  2. Register in the profile's cordis.patch.yml:
    - insert:
        - id: meow-memory
          name: 'meow-memory'
          config:
            enabled: true
    
  3. Restart dsh web. New sessions pick up the plugin automatically.

โš™๏ธ Configuration

All fields are optional (profile patch or cordis.patch.yml):

- id: meow-memory
  name: 'meow-memory'
  config:
    enabled: true          # master switch (false = no injection, no tool, no reflection)
    projectDir: '.dsh-meow' # memory directory, relative to the workspace
    projectFile: 'PROJECT.md' # memory file name
    maxInjectChars: 4000   # max chars injected into the first user message (truncated beyond)
    reflect: true          # auto-reflection after ReAct task turns

๐Ÿง  How it works

First user message            memory_remember tool             task end
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”            โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ [user text]      โ”‚          โ”‚ model calls it   โ”‚            โ”‚ agent/turn-stopping  โ”‚
โ”‚ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€    โ”‚          โ”‚ โ†’ append to       โ”‚            โ”‚ saw tool calls?      โ”‚
โ”‚ [PROJECT.md      โ”‚          โ”‚   .dsh-meow/      โ”‚            โ”‚ last tool memory_*?  โ”‚
โ”‚  snapshot]       โ”‚          โ”‚   PROJECT.md      โ”‚            โ”‚ already reflected?   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜          โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜            โ”‚ โ†’ agent.steer(reflectโ”‚
   injected once per                atomic write              โ”‚   prompt) if yes     โ”‚
   session, never again                                       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Memory content guidance (embedded in the tool description and the reflection prompt):

  • important facts, conclusions, decisions;
  • mistakes and corrections from the user (always worth keeping);
  • the user's own description of the project (quote them);
  • surprises;
  • lessons from repeated failed attempts;
  • user preferences (communication / working / coding style, project-related);
  • hard-won details that took many tool calls to find.

๐Ÿ›  Development

npm install
npm run build          # esbuild bundle โ†’ lib/index.js (self-contained)
npm run test           # 22 logic tests: tool, store, injection, reflection, recursion guard

The @deepseek-ai/* packages live in the dsh-meow pnpm workspace, not in this package's node_modules. On Windows, npm run link-workspace (or scripts/link-workspace.ps1) creates junction mirrors of the workspace packages so esbuild can resolve them; build.mjs uses nodePaths to pick them up. The links are build-time only.

๐Ÿ“„ License

MIT โ€” see LICENSE.

Related plugins