← 返回
未分类 中文

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...
基于 Markdown 的记忆连续系统,代理使用本地 Markdown 文件作为主要记忆源。适用于构建或运行本地 Markdown 记忆系统。
durugy durugy 来源
未分类 clawhub v0.1.0 1 版本 99670 Key: 无需
★ 0
Stars
📥 302
下载
💾 0
安装
1
版本
#latest

概述

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-memory manages the Markdown files, conventions, and maintenance workflow
  • built-in memory_search and memory_get are the primary recall/read tools during normal assistant operation
  • memory-core indexes and retrieves from the same Markdown tree
  • active-memory is 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

  1. Load memory/CORE/hard-rules.md and memory/CORE/current-state.md.
  2. Load recent daily logs from memory/daily/ (default: last 2 days).
  3. Before answering context-dependent questions, prefer built-in memory_search first.
  4. Use scripts/memory-search.sh "" when you want explicit file-level control, debugging, maintenance, or a second opinion against built-in recall.
  5. Update current-state.md when project/task state changes.
  6. Append a state diff entry in state-changelog.md for every meaningful state update.
  7. 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 | invalid
  • polarity: positive | negative
  • confidence: high | medium | low
  • avoid_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, embedding dimension, and pipeline_version
  • Threshold: SEMANTIC_MIN_SCORE (default 0.48)
  • Fusion rerank mode: FUSION_MODE=rrf|linear (default rrf)
  • RRF parameter: RRF_K (default 60)
  • Keyword boost in RRF mode: KEYWORD_BOOST (default 0.006)
  • Linear fallback weights: FUSION_SEM_WEIGHT + FUSION_KEY_WEIGHT (defaults 0.65/0.35)
  • Daily warmup: session-start.sh runs memory-semantic-search.py --build-only once per day
  • Negative memory handling: entries with polarity=negative or status in {invalid,superseded} are excluded from positive ranking and surfaced in a dedicated ⚠ Avoided Pitfalls warning 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.md and memory/*.md
  • Keep memory/CORE/current-state.md as the execution truth for active work
  • Let OpenClaw memory-core index the same tree
  • Treat built-in memory_search and memory_get as the default runtime recall path
  • Consider active-memory optional 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 hints
  • scripts/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/embeddings
  • scripts/memory-auto-tag.py: local-model auto-tagger (model from config.yaml, default gemma4:e4b) for incremental memory changes (--mode tag|review, --files, --force)
  • scripts/memory-write-tag.sh: write/append helper that immediately tags the target file
  • scripts/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 review first, then daily log append + state freshness check
  • scripts/auto-commit.sh: optional git safety-net commit

References

  • references/templates.md: canonical templates for state/daily/project/handoff files

版本历史

共 1 个版本

  • v0.1.0 当前
    2026-05-07 23:14 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-agent

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,379 📥 320,415
ai-agent

self-improving agent

pskoett
捕获经验教训、错误及修正内容,以实现持续改进。适用于以下场景:(1)命令或操作意外失败;(2)用户纠正Claude(如“不,那不对……”“实际上……”);(3)用户请求的功能不存在;(4)外部API或工具出现故障;(5)Claude发现自身
★ 4,082 📥 810,014
ai-agent

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,227 📥 267,818