Preface¶
When running multi-round, cross-session tasks in DeepSeek Harness (DSH), the model relies solely on the current context by default. Closing the window or starting a new session often requires re-explaining the project structure, user preferences, and lessons learned from previous corrections. Common approaches include stuffing long documents into the system prompt or manually pasting notes from external sources—the former can disrupt KV cache, while the latter makes on-demand retrieval difficult.
meow-memory is a memory plugin for DSH maintained by Phant0Meow. It uses SQLite in each workspace to maintain a structured memory store, preserving seven layers of information—soul, user, project, and others—across sessions through initial snapshot injection, per-message keyword matching, and idle-time dream consolidation. Below, we introduce its positioning, capabilities, and installation process.
What Is This¶
meow-memory (npm package name meow-memory, repository Phant0Meow/dsh-meow-memory) is designed for DeepSeek Harness cross-session memory scenarios. Memory data is stored in .dsh-meow/memory.db under the workspace, based on Node’s built-in node:sqlite, with no additional native dependencies.
The core philosophy follows two lines: static memory guides (data overview, tool usage, writing guidelines) are registered in the system prompt as fixed sections with constant text, beneficial for the provider’s KV cache; dynamic content (full soul/user, design principles, memory guidance) is injected as a prefix to the first real user message, with keyword matching applied to each subsequent user message starting from the second round. When the model needs to delve deeper into the content, it invokes tools like memory_search or memory_project for retrieval.
Current version: 0.17.0, MIT license. Approximately 37 stars on GitHub. Community directory page: SkillHub — dsh-meow-memory.
Seven-Layer Memory and Storage Structure¶
Memory is stored in tables by layer, with each record containing a UUID and timestamp prefix. The ID order corresponds to creation order:
| Layer | Meaning |
|---|---|
soul |
AI’s own related information |
user |
User’s basic information and preferences |
project |
Project information, including subcategory (overview/structure/decisions/quotes/ops/todo) |
fact |
Atomic facts |
lesson |
Lessons and corrections |
topic |
Ongoing discussion topics, can include goal sentences |
rules |
Design principles and behavioral guidelines |
For globally applicable entries, project is set to "全局" (distinguished from leaving it blank). When applicable to multiple projects, separate them with English commas, such as "dsh, femwa". Retrieval and matching are based on “contains the current project name or global”.
Seen records at the session level are written to .dsh-meow/sessions/<id>.json: injected IDs are not re-injected; when a session compaction signal (compaction/*) is received, seen records are released and can be hit again after compaction.
Injection and Retrieval Mechanism¶
First-round long-term memory block: A fixed format is injected before the first real user message—===== Long-Term Memory ===== → 【About You】 (full soul) → 【About User】 (full user) → 【Design Principles】 (global rules with importance≥2) → 【Memory Guidance】 (usage instructions + user’s project list) → ===== End of Long-Term Memory ===== + Current user prompt:. No keyword matching is performed in the first round; even if the first user message arrives with a plugin notification, the snapshot is still attached to the real user message.
Per-message keyword matching: Starting from the second user message, a search is performed across fact/lesson/rules/topic (scope = global + current project anchor), with the top-2 hits injected with the prefix “Memories that may be relevant, for reference only:”. Scoring is based on entry keywords (LLM-extracted or automatic bigrams), combined with IDF, coverage, time-based Ebbinghaus decay, importance weight, and title boost. When no project is anchored, hits only search the global scope to avoid unintended impact on project memory from casual conversation.
Current project anchoring: memory_remember, memory_search, memory_update, and memory_project with the project parameter anchor the current session to that project.
Cache-friendly: The static meow-memory:guide section (order 130) is registered once in the system prompt; memory_search defaults to returning top 10, with the first 5 based on relevance (including seen) and the last 5 excluding seen to complete the set.
Tool Set¶
The plugin exposes a set of memory_* tools to the model, with common capabilities as follows:
memory_remember: Writes a memory. Required fields:content,project,keywords,importance; missing fields prompt for re-entry; supports automatic deduplication and merging, returning a read-back confirmation.memory_search: BM25 retrieval, supportinglevel,project,status,daysfilters; defaults to top 10, returning ownership, full ID, relative time, and keyword list (excluding original text).memory_project: Requires theprojectparameter. Outputs the project panorama grouped by sub-categories, with the todo section displaying “Completed:” for the latest 5 and “To do list:”, followed by explanations of memory store and session history positioning.memory_find_similar: Duplicate checking and conflict detection.memory_read/memory_update: Reading and updating, including fields likestatus(active/archived/stale),importance,goal,keywords.memory_dream: Manually triggers memory consolidation for the current window.
Memory timestamps are based on updated_at (last update time); updated during dream sealing or memory_update refreshes.
Per-Window Dream Consolidation¶
When a window is idle for idleMinutes (default 180 minutes) and not during peak suppression periods, the window’s main agent consolidates memories during idle time. The scope includes memories created or accessed (injected, retrieved, memory_read) in this window, with knowledge frozen at the timestamp of the last conversation in the window.
Consolidation occurs in three rounds: Round 1 processes project/fact/lesson/rules/soul/user; Round 2 processes topic; Round 3 adds project summaries when projects involve specific projects (calls memory_project to review and condense, archiving old entries). Long-term stable rules default to entering the review list only if updated within 2 days (dream.rulesReviewDays), avoiding unnecessary refreshes.
Peak suppression is calculated based on timeZone (default Asia/Shanghai): by default, no auto-trigger from 09:00–12:00 and 14:00–18:00, plus the 15 minutes (suppressLeadMinutes) before each period; ongoing dreams are not interrupted. Old windows with no live agent and over 24 hours old, or archived sessions, are not processed.
If you don’t want to wait for idle triggers, enter /dream in the input box to immediately invoke this window’s consolidation (same semantics as memory_dream, not subject to peak suppression). The left session line “…” menu allows setting “Skip dream memory consolidation”; skipped windows are no longer auto-dreamed by the idle timer, but manual /dream and memory_dream remain available.
Dream anti-duplication mechanisms include: DB atomic 60-second check throttling, dream_pending idempotent preemption, uncompleted dreams automatically finalized, and orphan finalization across instances.
Reflection and Client UI¶
After ≥7 consecutive tool steps (default reflectTurns), the plugin asks the model if there’s anything worth remembering since the last consolidation; if the last step was already a memory_* call, it’s considered already proactively remembered, avoiding redundant reflection.
The client also provides:
- First-round long-term memory and keyword match injections collapsed into a “▸ Injected Memory” bar; clicking opens the full text, with the user prompt displayed directly as a bubble.
- Reflection and dream rounds default to collapsed bars (e.g., “Added N memories”, “Memory dream task”), expandable to view details like Think, tool calls, etc.
- In the session list, after dream consolidation, sessions with no new activity display a pale yellow crescent moon icon; during dream consolidation, it’s a breathing crescent moon. Status is pushed via
/meow-memory/dream-eventsSSE.
Installation and Enablement¶
The plugin runs with the permissions of the current DSH process. Before installation, it’s recommended to read the source code and MIT license. DSH adopts an “everything is a plugin” assembly approach; SkillHub is a community directory site with no official affiliation with DeepSeek / High-Flyer.
Via npm (Recommended)¶
Install in the profile’s node_modules (the loader resolves plugins here):
cd $DSH_HOME/profiles/web # Default home: ~/.dsh/profiles/web
npm install meow-memory
Add the package to the assembly bundles in the profile’s package.json (recommended since v0.9.0):
"dsh": {
"profile": {
"bundles": ["@deepseek-ai/dsh-base", "@deepseek-ai/dsh-web-app", "meow-memory"]
}
}
The plugin includes dsh.bundle.patch, and the bundle mechanism assembles it automatically. New plugins should use the bundles array; do not rely on profile patch insert addressing.
Restart dsh web, and new sessions will automatically load the plugin.
Manual Installation¶
- Copy or symlink the package to the profile’s
node_modules:
mkdir -p ~/.dsh/profiles/web/node_modules
ln -s /path/to/meow-memory ~/.dsh/profiles/web/node_modules/meow-memory
- Similarly add
meow-memorytodsh.profile.bundles. - Restart
dsh web.
Configuration Options¶
All fields are optional and can be overridden via profile patch or cordis.patch.yml:
- id: meow-memory
name: 'meow-memory'
config:
enabled: true # Master switch
projectDir: '.dsh-meow' # Memory directory (relative to workspace)
hitTopK: 2 # Keyword hit limit per user message
reflect: true # Auto-reflect after consecutive tool rounds
reflectTurns: 7 # Consecutive tool rounds required to trigger reflection
dream:
enabled: true
idleMinutes: 180 # Idle ≥180 minutes allows dream
suppressWindows: # Peak suppression periods (based on timeZone)
- start: '09:00'
end: '12:00'
- start: '14:00'
end: '18:00'
suppressLeadMinutes: 15
checkMinutes: 15
timeZone: 'Asia/Shanghai'
Runtime Requirements¶
Zero runtime dependencies: node:sqlite (available by default in Node ≥22.13; requires --experimental-sqlite for 22.5–22.12) plus a self-contained esbuild product lib/index.js, no native modules.
Applicable Scenarios and Considerations¶
Suitable for DSH workflows that need to preserve project context, user preferences, and lesson corrections across sessions—such as long-term maintenance of the same repository or multi-window parallel setups sharing a memory store. When two instances share the same memory store, skipped dream states persist consistently.
Note: Memory quality depends on the model actively calling memory_remember and dream consolidation; keyword matching is based on entry keywords rather than full text, so the keywords field is worth filling carefully when writing. Dream will not auto-trigger during peak suppression periods; use /dream for urgent consolidation.
Links¶
- Community Directory: https://www.skillhub.cn/plugins/Phant0Meow/dsh-meow-memory
- GitHub Repository: https://github.com/Phant0Meow/dsh-meow-memory
- DeepSeek Harness: https://github.com/deepseek-ai/deepseek-harness