openclaw - ✅(Solved) Fix Feature: per-plugin QMD searchMode override for Active Memory [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#64829Fetched 2026-04-12 13:26:29
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
closed ×1cross-referenced ×1

Fix Action

Fixed

PR fix notes

PR #65068: feat: default active memory QMD recall to search

Description (problem / solution / changelog)

Summary

  • add an active-memory-specific QMD search mode override
  • default Active Memory to QMD search for lower-latency recall while keeping inherit available
  • add tests covering the new default and the inherit path

Refs #64829

Testing

  • pnpm vitest run extensions/active-memory/index.test.ts src/memory-host-sdk/host/backend-config.test.ts

Changed files

  • extensions/active-memory/index.test.ts (modified, +89/-4)
  • extensions/active-memory/index.ts (modified, +216/-10)
  • extensions/active-memory/openclaw.plugin.json (modified, +15/-1)
  • extensions/memory-core/src/memory-tool-manager-mock.ts (modified, +16/-2)
  • extensions/memory-core/src/memory/manager.ts (modified, +4/-0)
  • extensions/memory-core/src/memory/qmd-manager.ts (modified, +19/-2)
  • extensions/memory-core/src/memory/search-manager.ts (modified, +15/-2)
  • extensions/memory-core/src/tools.test.ts (modified, +68/-2)
  • extensions/memory-core/src/tools.ts (modified, +65/-2)
  • src/memory-host-sdk/engine-storage.ts (modified, +1/-0)
  • src/memory-host-sdk/host/types.ts (modified, +14/-1)
  • src/memory-host-sdk/runtime-files.ts (modified, +1/-1)

Code Example

{
  "plugins": {
    "entries": {
      "active-memory": {
        "config": {
          "qmd": {
            "searchMode": "search"
          }
        }
      }
    }
  }
}

---

{
  "agents": {
    "defaults": {
      "memorySearch": {
        "qmd": {
          "searchMode": "search"
        }
      }
    }
  }
}
RAW_BUFFERClick to expand / collapse

Problem

Active Memory plugin uses the global memory.qmd.searchMode setting (currently "query" ~4s) when calling memory_search. There is no way to configure a different (faster) search mode specifically for Active Memory while keeping the main agent on the highest-quality "query" mode.

Current behavior

  • memory.qmd.searchMode is a global singleton, read once at startup
  • All callers (memory_search from main agent, sub-agents, and Active Memory) share the same mode
  • memory_search tool schema has no searchMode parameter
  • Active Memory plugin config has no QMD-related fields
  • Per-agent memorySearch.qmd only supports extraCollections (schema is strict())

Impact

Active Memory runs a 2-turn LLM cycle (generate tool call → synthesize result). Adding ~4s for query mode QMD search on top of LLM latency pushes total time to 20-25s, which significantly delays first response. Using global "search" mode (~0.2s) would speed up Active Memory but degrade search quality for the main agent.

Proposed Solution

Add a qmd.searchMode override in one or more of these locations (in order of preference):

Option A: Active Memory plugin config (simplest)

{
  "plugins": {
    "entries": {
      "active-memory": {
        "config": {
          "qmd": {
            "searchMode": "search"
          }
        }
      }
    }
  }
}

Active Memory would pass the overridden searchMode when calling runEmbeddedPiAgent, modifying config.memory.qmd.searchMode in the config snapshot.

Option B: Per-agent memorySearch.qmd.searchMode

{
  "agents": {
    "defaults": {
      "memorySearch": {
        "qmd": {
          "searchMode": "search"
        }
      }
    }
  }
}

Requires relaxing the strict() schema on memorySearch.qmd.

Option C: Per-call searchMode parameter on memory_search tool

Add optional searchMode parameter to MemorySearchSchema, allowing any caller to override per-call.

Use Case

  • Main agent: searchMode: "query" (highest quality, ~4s acceptable for interactive use)
  • Active Memory: searchMode: "search" (BM25 ~0.2s, sufficient for pre-prompt recall hints)
  • Research sub-agents: could also benefit from configurable search quality/speed tradeoffs

Environment

  • OpenClaw 2026.4.10
  • QMD backend with searchMode: "query"
  • Active Memory plugin with bailian/qwen3.5-27barcee/Trinity-Large-Thinking

extent analysis

TL;DR

To fix the issue, add a qmd.searchMode override in the Active Memory plugin config to use a faster search mode without degrading the main agent's search quality.

Guidance

  • Consider implementing Option A: Add a qmd.searchMode override in the Active Memory plugin config to use the "search" mode, which has a significantly faster response time of ~0.2s.
  • Evaluate the trade-offs between search quality and speed for different use cases, such as the main agent, Active Memory, and research sub-agents.
  • If Option A is not feasible, explore Option B or Option C, which require relaxing the strict() schema or adding an optional searchMode parameter to the MemorySearchSchema.
  • Verify the effectiveness of the chosen solution by measuring the response time of the Active Memory plugin and ensuring that the main agent's search quality remains unaffected.

Example

{
  "plugins": {
    "entries": {
      "active-memory": {
        "config": {
          "qmd": {
            "searchMode": "search"
          }
        }
      }
    }
  }
}

Notes

The proposed solutions require careful consideration of the trade-offs between search quality and speed. The chosen solution should balance the needs of different use cases and ensure that the main agent's search quality remains unaffected.

Recommendation

Apply Option A workaround by adding a qmd.searchMode override in the Active Memory plugin config, as it is the simplest and most straightforward solution that addresses the issue without degrading the main agent's search quality.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING