← Back to library

QMD 记忆检索加权:按路径提升 MEMORY.md、下调 archive 噪音

问题/场景:QMD 语义检索会把 archive 噪音与核心记忆混排,导致命中质量波动。前置条件:使用 memory.qmd 且有多层记忆路径。实施步骤:配置 `memory.qmd.weights`(如 `MEMORY.md: 2.0`、`memory/archive/**: 0.5`)→回归同一批检索问题→比较排序稳定性。关键配置:path-based weights。验证:核心记忆在结果前列,归档噪音下降。风险:权重过高会压制真正相关但低权重文件(需验证)。

GITHUBDiscovered 2026-02-19Author FradSer
Prerequisites
  • QMD memory search is enabled and your workspace has both canonical memory and archive folders.
  • You can edit memory config and rerun a repeatable set of recall queries.
Steps
  1. Add `memory.qmd.weights` map in config with explicit path patterns and numeric multipliers.
  2. Restart gateway/memory service so search pipeline picks up the new weights.
  3. Run 10-20 fixed memory queries and capture top-k result paths before/after weighting.
  4. Tune multipliers iteratively (small steps) until precision/recall tradeoff is acceptable.
Commands
openclaw gateway status
openclaw gateway restart
openclaw status
Verify

For repeated recall prompts, top results include boosted canonical files more often while archived noise drops.

Caveats
  • PR indicates basic glob support; confirm edge-case matching semantics in your path layout(需验证).
  • Over-weighting one file may reduce retrieval diversity and hurt rare-case recall.
Source attribution

This tip is aggregated from community/public sources and preserved with attribution.

Open original source ↗
Visit original post