rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:nonenameless/dsh-hybrid-memory
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Transparent Markdown long-term memory for DeepSeek Harness.
Markdown you can read. A background loop you can trust. On-demand retrieval instead of full prompt stuffing.
Long-term memory in agent systems usually fails in one of three ways:
AGENTS.md or system prompt is written once and never updated, so stable preferences and decisions are lost between sessions.dsh-hybrid-memory treats memory as a user-owned Markdown folder with a background maintenance loop and on-demand retrieval:
SOUL.md, USER.md, AGENT.md, AGENTS.md are silently injected as a bounded system-prompt section.MEMORY.md is not injected in full; it is indexed and queried through memory_search / memory_read.| Storage | Plain Markdown under $DSH_HOME/hybrid_memory/ (or ~/.dsh/hybrid_memory/) |
| Memory tiers | Core → Important → General, with editable budgets |
| Retrieval | Local BM25 with Chinese single-character/bigram and English word tokenization |
| Injection | SOUL + USER + AGENT + AGENTS; MEMORY.md stays on-demand |
| Extraction | Async, single-concurrency, retry/backoff, threshold + idle + session-end triggers |
| Tools | memory_read, memory_search, memory_update, persona_update |
| UI | Settings section + optional sidebar quick-access panel |
| Heartbeat | Maintenance, idle extraction, optional proactive wake with cooldown |
| Dependencies | None beyond Node.js built-ins and the DSH Host/Web runtime |
Core is reserved for important facts and explicit “remember this” requests; pinned entries are never auto-demoted.Session events
│
│ async, single worker, bounded transcript
▼
Extraction worker ──────────────► USER.md / MEMORY.md
│
├── SOUL / USER / AGENT / AGENTS ──► system prompt section
├── MEMORY ──► BM25 index ──► memory_search / memory_read
├── memory_update / persona_update ──► atomic file writes
└── heartbeat ──► maintenance / optional proactive wake
The plugin creates these files on first use:
| File | Purpose | Default |
|---|---|---|
SOUL.md |
Agent persona: identity, values, voice, boundaries | Injected |
USER.md |
User profile, preferences, boundaries | Injected; updated in background |
AGENT.md |
Operating rules and self-model for this agent | Injected |
AGENTS.md |
Multi-agent / team collaboration conventions | Injected |
MEMORY.md |
Tiered long-term facts | Search-only; not injected in full |
MEMORY.archive.md |
Old entries archived after General overflow |
Not injected or searched; audit only |
HEARTBEAT.md |
Proactive checklist used when a heartbeat wakes the agent | Search-only |
settings.json |
Per-file switches, extraction, heartbeat, budgets | Auto-created |
state.json |
Turn counters, last extraction, last heartbeat, errors | Auto-created |
Every Markdown file has independent Load and Inject switches:
The default is “all files loaded”; only persona/profile files are injected by default.
## Core
- ⭐ 用户明确要求永久记住:回答先给结论。
## Important
- 项目使用 TypeScript 与 Node.js。
## General
- 用户常在晚上工作。
Rules:
Core is for important facts and explicit “remember this” requests. The extraction prompt only promotes items with high importance or a pin.Core exceeds its budget, the oldest unpinned entry is demoted to Important.Important exceeds its budget, the oldest unpinned entry moves to General.General exceeds its budget, the oldest unpinned entry is appended to MEMORY.archive.md instead of being dropped silently.⭐ pinned entries are never moved automatically; when a tier is entirely pinned, lower tiers are still refined.Core entries plus the newest lower-tier entries, not just the head of the file.Default budgets: Core 8, Important 40, General 80, plus a 12,000 character total cap. All are editable in the UI.
The worker reads only committed user/message and assistant/message events, processing them in count- and character-bounded batches. Each batch starts at the oldest unprocessed message and commits only through the last message it actually processed, so anything that does not fit waits for the next batch instead of being skipped. It skips plugin notices, tool noise, and subagent sessions by default.
Triggers:
N completed turns (default 10);The extraction prompt asks for strict JSON:
{
"user_preferences": [
{ "text": "…", "importance": 1, "pinned": false }
],
"facts": [
{ "text": "…", "tier": "core|important|general", "importance": 1, "pinned": false }
]
}
The merge path:
USER.md / MEMORY.md entries;throughSeq only after success, so failures are retried without losing messages.Model route selection: last request header → live agent model → extraction.provider + extraction.model in settings. If no route exists, extraction is skipped and the error is recorded; the conversation is unaffected.
memory_search uses a local BM25 index over enabled files:
Core and Important results receive a small boost.memory_read returns numbered lines with offset / limit paging. MEMORY.md is intentionally never injected in full.
| Tool | What it does |
|---|---|
memory_read |
Read one memory file with line numbers, paged with offset / limit. |
memory_search |
BM25 search over enabled files with file/tier/line results. |
memory_update |
append, replace, delete, or move one memory entry; supports tiers and pinning. |
persona_update |
Replace SOUL.md or append a section under a heading. |
All tool schemas use a single string type per node, string descriptions, and object-root required arrays. Registration is individually guarded so a schema or duplicate-name problem cannot take down the Host.

Settings → Hybrid memory gives you:
An optional sidebar quick-access panel uses the same component. It is disabled by default and can be enabled in settings.
| Approach | Strength | Typical limitation | What this plugin adds |
|---|---|---|---|
| Vector-memory agents | Strong semantic recall | Opaque, not directly editable, embedding dependency | Transparent files, tiers, BM25, manual editing |
Static AGENTS.md / system prompt |
Simple and stable | Static, no extraction, no retrieval | Background updates, tiers, search, heartbeat |
| OpenClaw-style file memory | Transparent and user-owned | Often manual/static | Background loop, BM25, UI, heartbeat |
| Hermes-style background loop | Automatic, low-friction | Memory can be a black box | Markdown results, auditability, on-demand retrieval |
| Cloud memory assistants | Cross-device convenience | Cloud-owned, not local-first | Local files, native tools, user control |
| MemGPT / Letta-style frameworks | Rich memory runtime | Heavy architecture, opaque to end users | Lightweight DSH-native bundle, readable files |
Trade-off: BM25 does not generalize paraphrases as well as embeddings. For “that thing we discussed last time”, use keywords or let the agent read the relevant file.
AGENTS.mdUSER.md and MEMORY.md.It keeps OpenClaw’s file transparency and Hermes’s background closure, then adds tiering, BM25 retrieval, DSH-native tools, a settings page, a sidebar entry, and crash-safe writes.
dsh plugin --profile web add @jasper_alaric/dsh-hybrid-memory
Or install the bundle through the DSH Plugin Manager / DSH Market once the catalog entry is published.
For local development:
plugin_manager install_bundle
target: E:\path\to\dsh-hybrid-memory-release
After installation:
SOUL.md, USER.md, AGENT.md, and AGENTS.md are injected silently.memory_search or memory_read when the agent needs older facts.The DSH Market catalog requires a PR to
awesome-dsh-plugin; the exact entry is indocs/awesome-dsh-plugin.md.
The loader row only carries storageDir:
- insert:
- id: hybrid-memory
name: '@jasper_alaric/dsh-hybrid-memory'
config:
storageDir: ''
Everything else lives in settings.json and is editable in the UI:
{
"files": {
"soul": { "enabled": true, "inject": true },
"user": { "enabled": true, "inject": true },
"agent": { "enabled": true, "inject": true },
"agents": { "enabled": true, "inject": true },
"memory": { "enabled": true, "inject": false },
"heartbeat": { "enabled": true, "inject": false }
},
"injection": { "maxChars": 12000 },
"extraction": {
"enabled": true,
"everyTurns": 10,
"idleMinutes": 10,
"maxTranscriptChars": 14000,
"maxMessages": 40,
"provider": "",
"model": "",
"maxTokens": 1400,
"retryMinutes": 10,
"includeSubagents": false
},
"heartbeat": {
"enabled": true,
"intervalMinutes": 30,
"proactive": true,
"wakeCooldownMinutes": 180,
"prompt": ""
},
"budgets": { "core": 8, "important": 40, "general": 80, "totalChars": 12000 },
"ui": { "sidebar": false }
}
copyFile.settings.json / state.json fall back to defaults and record an error.connection.requestRejection(req) before dispatch, applying DSH's Host/Origin fence and browser-session authentication; no CORS, no token in the page.state.json and retried with backoff; they never reject a conversation turn.node --test tests/*.test.mjs
The suite covers:
Current release: 17 tests passing.
awesome-dsh-plugin.MIT © 2026 jasper_alaric
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek。