openclaw-memory-optimizer

自动优化 OpenClaw 4.2 记忆搜索参数。当用户提到记忆不准确、搜索结果太少、MMR 关闭、时间衰减未启用、session 同步阈值过高,或者要求优化 OpenClaw 记忆系统时触发。也用于定期检查和调整 memory-search 配置。

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "openclaw-memory-optimizer" with this command: npx skills add nicshliu/openclaw-memory-optimizer

OpenClaw Memory Optimizer

优化 OpenClaw 4.2 内置记忆搜索系统的参数配置,提升记忆检索精度。

快速诊断

运行以下命令检查当前配置:

openclaw config get agents.defaults.memorySearch 2>/dev/null || echo "未设置"
cat ~/.openclaw/openclaw.json | python3 -c "import json,sys; c=json.load(sys.stdin); print(json.dumps(c.get('agents',{}).get('defaults',{}).get('memorySearch',{}), indent=2))"

核心参数(OpenClaw 当前保守默认值)

参数默认值问题推荐值
maxResults6结果太少10–15
minScore0.35过于宽松0.25
mmr.enabledfalseMMR 可提升多样性true
mmr.lambda0.70.6
temporalDecay.enabledfalse旧记忆权重过高true
temporalDecay.halfLifeDays3014
sessionDeltaMessages50同步太慢15
sessionDeltaBytes100KB阈值过高20KB

详见 references/defaults.md

优化流程

1. 扫描当前配置

读取 ~/.openclaw/openclaw.json,找到 agents.defaults.memorySearch 节。

2. 选择优化级别

轻度优化(保守,推荐首次使用):

{
  "memorySearch": {
    "maxResults": 10,
    "minScore": 0.30,
    "sessionDeltaMessages": 25,
    "sessionDeltaBytes": 50000
  }
}

中度优化(平衡精度与召回):

{
  "memorySearch": {
    "maxResults": 12,
    "minScore": 0.25,
    "mmr": { "enabled": true, "lambda": 0.65 },
    "temporalDecay": { "enabled": true, "halfLifeDays": 14 },
    "sessionDeltaMessages": 15,
    "sessionDeltaBytes": 30000
  }
}

深度优化(高精度):

{
  "memorySearch": {
    "maxResults": 15,
    "minScore": 0.20,
    "mmr": { "enabled": true, "lambda": 0.60 },
    "temporalDecay": { "enabled": true, "halfLifeDays": 7 },
    "sessionDeltaMessages": 10,
    "sessionDeltaBytes": 20000,
    "experimental": { "sessionMemory": true }
  }
}

3. 应用配置

openclaw config set agents.defaults.memorySearch.maxResults 12
openclaw config set agents.defaults.memorySearch.mmr.enabled true
# ... 逐条设置

或直接编辑 ~/.openclaw/openclaw.jsonagents.defaults.memorySearch 节。

4. 验证

openclaw memory status --deep
openclaw doctor --memory-search

Feature Flag 快速开关

通过环境变量快速切换(无需重启 Gateway):

# 启用 MMR
OPENCLAW_MEMORY_MMR=true openclaw gateway restart

# 启用时间衰减
OPENCLAW_MEMORY_TEMPORAL_DECAY=true openclaw gateway restart

何时使用轻度 vs 深度

  • 轻度:个人项目、短期任务、上下文简单
  • 中度:多模块项目、有多位协作者
  • 深度:大型代码库、长期维护、需要高精度记忆

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Huo15 Openclaw Enhance

火一五·克劳德·龙虾增强插件 v5.7.8 — 全面适配 openclaw 2026.4.24:peerDep ^4.24 + build/compat 同步到 4.24 + 14 处 api.on 全部去掉 as any 改成 typed hook(hookName 联合类型 + handler 自动推断 Pl...

Registry SourceRecently Updated
General

Content Trend Analyzer

Aggregates and analyzes content trends across platforms to identify hot topics, user intent, content gaps, and generates data-driven article outlines.

Registry SourceRecently Updated
General

Prompt Debugger

Debug prompts that produce unexpected AI outputs — diagnose failure modes, identify ambiguity and conflicting instructions, test variations, compare model re...

Registry SourceRecently Updated
General

Indie Maker News

独行者 Daily - 变现雷达。读对一条新闻,少走一年弯路。每天5分钟,给创业者装上商业雷达。聚焦一人公司、副业、创业变现资讯,智能分类,行动导向。用户下载即能用,无需本地部署!

Registry SourceRecently Updated