/install duru-memory
Duru Memory
Use this skill to run a high-traceability memory system based on plain Markdown files.
This skill is complementary to OpenClaw's built-in memory stack:
duru-memorymanages the Markdown files, conventions, and maintenance workflow- built-in
memory_searchandmemory_getare the primary recall/read tools during normal assistant operation memory-coreindexes and retrieves from the same Markdown treeactive-memoryis an optional pre-reply recall layer for eligible interactive sessions, not a guaranteed default for every deployment
Treat the Markdown files as the source of truth, and OpenClaw's built-in memory stack as the main retrieval and recall layer.
Core workflow
- Load
memory/CORE/hard-rules.mdandmemory/CORE/current-state.md. - Load recent daily logs from
memory/daily/(default: last 2 days). - Before answering context-dependent questions, prefer built-in
memory_searchfirst. - Use
scripts/memory-search.sh "\x3Cquery>"when you want explicit file-level control, debugging, maintenance, or a second opinion against built-in recall. - Update
current-state.mdwhen project/task state changes. - Append a state diff entry in
state-changelog.mdfor every meaningful state update. - At session close, run
scripts/session-close.sh.
Directory contract
memory/
CORE/
hard-rules.md
current-state.md
state-changelog.md
daily/
projects/
people/
concepts/
handoff/
archive/raw/
INDEX.md
Memory admission rules
Record only high-value memory:
- decisions
- commitments
- deadlines
- preferences
- blockers
- postmortem conclusions
Add attributes when possible:
status: active | superseded | invalidpolarity: positive | negativeconfidence: high | medium | lowavoid_reason: ...(required for negative/pitfall entries)
Avoid logging casual chat unless it impacts future execution.
Retrieval policy (built-in first, local deterministic second, optional semantic third)
For normal assistant recall, built-in memory_search is the default path. It integrates with memory-core, can include indexed session transcripts, and follows the configured OpenClaw memory backend.
Use this skill's local retrieval scripts when you want explicit file-level control, debugging, maintenance, reproducible inspections, or a second opinion against built-in recall.
Local deterministic retrieval uses weighted matching:
- exact keyword / phrase in headings
- tags and fields (
decision,todo,blocker,preference) - recency boost for recent daily logs
- path boost for likely directories (
projects,people,CORE)
Optional local semantic retrieval is an experimental supplement, not the primary OpenClaw memory path. When local Ollama embedding is available, it can be added as a second pass after deterministic retrieval (default embedding model in config.yaml: qwen3-embedding:0.6b). This local semantic layer can coexist with built-in retrieval, but it does not replace OpenClaw's built-in memory_search contract.
This skill's semantic mode uses a local SQLite + sqlite-vec path with incremental indexing:
- DB path:
memory/.semantic-index.db - Vector extension:
sqlite-vec(loaded via APSW) - Incremental policy: file mtime/size/hash detection + chunk-level embedding cache
- Consistency keys: fixed
model, embeddingdimension, andpipeline_version - Threshold:
SEMANTIC_MIN_SCORE(default0.48) - Fusion rerank mode:
FUSION_MODE=rrf|linear(defaultrrf) - RRF parameter:
RRF_K(default60) - Keyword boost in RRF mode:
KEYWORD_BOOST(default0.006) - Linear fallback weights:
FUSION_SEM_WEIGHT+FUSION_KEY_WEIGHT(defaults0.65/0.35) - Daily warmup:
session-start.shrunsmemory-semantic-search.py --build-onlyonce per day - Negative memory handling: entries with
polarity=negativeorstatus in {invalid,superseded}are excluded from positive ranking and surfaced in a dedicated⚠ Avoided Pitfallswarning block
Failure and degraded mode guidance
Do not assume semantic retrieval is available.
If built-in vector search, sqlite-vec, Ollama embeddings, or the skill's local semantic service is unavailable, fall back to built-in memory_search in its degraded lexical mode or to this skill's deterministic local retrieval. In degraded mode:
- prefer exact facts from
MEMORY.md,memory/CORE/current-state.md, and recent daily logs - treat semantic hits as optional enrichment, not a dependency
- explicitly report uncertainty when no strong hit exists
- avoid presenting local semantic indexing behavior as part of OpenClaw's guaranteed built-in memory contract
Coexistence guidance
Recommended division of labor:
- Write and maintain long-term notes in
MEMORY.mdandmemory/*.md - Keep
memory/CORE/current-state.mdas the execution truth for active work - Let OpenClaw
memory-coreindex the same tree - Treat built-in
memory_searchandmemory_getas the default runtime recall path - Consider
active-memoryoptional and deployment-dependent, especially if pre-reply recall causes latency or timeout issues - Use local scripts for maintenance, audits, tagging, and deterministic investigations
Avoid creating separate parallel memory trees for built-in memory and Markdown memory. One shared Markdown tree is the cleanest setup.
Scripts
scripts/session-start.sh: startup checklist + quick context load hintsscripts/memory-search.sh: hybrid retrieval entry (keyword first, semantic optional)config.yaml: centralized model/runtime tuning (ollama.base_url,models.*,semantic.*,fusion.*)scripts/memory-semantic-search.py: semantic recall via Ollama/api/embeddingsscripts/memory-auto-tag.py: local-model auto-tagger (model fromconfig.yaml, defaultgemma4:e4b) for incremental memory changes (--mode tag|review,--files,--force)scripts/memory-write-tag.sh: write/append helper that immediately tags the target filescripts/memory-compact.py: weekly compaction (daily -> summaries, mark stale, re-sync vectors)scripts/memory-forget.py: monthly forgetting (archive old stale daily logs, keep negative pitfalls)scripts/session-close.sh: runs auto-tagger in--mode reviewfirst, then daily log append + state freshness checkscripts/auto-commit.sh: optional git safety-net commit
References
references/templates.md: canonical templates for state/daily/project/handoff files
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install duru-memory - 安装完成后,直接呼叫该 Skill 的名称或使用
/duru-memory触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Duru Memory 是什么?
Markdown-based memory continuity system for agents using local Markdown files as the primary memory source. Use when building or operating local Markdown mem... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 66 次。
如何安装 Duru Memory?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install duru-memory」即可一键安装,无需额外配置。
Duru Memory 是免费的吗?
是的,Duru Memory 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Duru Memory 支持哪些平台?
Duru Memory 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Duru Memory?
由 Duru(@durugy)开发并维护,当前版本 v0.1.0。