openclaw - ✅(Solved) Fix QMD memory search fans out one subprocess per collection [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#72484Fetched 2026-04-27 05:29:49
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×1

QMD-backed memory search currently fans out one qmd search/qmd query subprocess per managed collection when more than one collection is configured. For agents with many QMD memory collections, a single memory_search tool call can spend most of its latency serially starting QMD processes.

This is especially visible in realtime lanes such as Google Meet/Gemini Live owner-consult flows: the live model waits while the owner agent executes memory tools, so one user question can appear to stall for a long time.

Error Message

On an OpenClaw 2026.4.24 runtime with Jay configured for QMD memory:

Root Cause

QMD-backed memory search currently fans out one qmd search/qmd query subprocess per managed collection when more than one collection is configured. For agents with many QMD memory collections, a single memory_search tool call can spend most of its latency serially starting QMD processes.

This is especially visible in realtime lanes such as Google Meet/Gemini Live owner-consult flows: the live model waits while the owner agent executes memory tools, so one user question can appear to stall for a long time.

Fix Action

Fix / Workaround

  • memory backend: qmd
  • memory source: memory
  • QMD collections exposed in status: 11
  • query: openclaw memory search --agent jay "most recent OpenClaw PR" --max-results 1 --json
  • before patch: 14.578s total

A local runtime patch applying source-grouped collection filters reduced the same Jay search from:

PR fix notes

PR #72485: Optimize QMD multi-collection memory search

Description (problem / solution / changelog)

Summary

  • group local QMD CLI memory searches by OpenClaw source instead of running once per collection
  • pass all collection filters for same-source searches in one QMD invocation
  • keep separate invocations for mixed source groups so memory/session diversification still has input from both sources
  • update memory-core tests for same-source multi-collection calls and mixed session/memory behavior

Fixes #72484.

Why

Realtime owner-consult lanes can block while the owner agent runs tools. In a Google Meet/Gemini Live consult, Jay made four memory_search calls while answering a tool-backed question; the old QMD path spawned one QMD subprocess per configured collection, producing long voice pauses.

Runtime measurement on OpenClaw 2026.4.24 with Jay's QMD memory config:

  • before patch: openclaw memory search --agent jay "most recent OpenClaw PR" --max-results 1 --json took 14.578s total
  • after source-grouped runtime patch: 7.261s total, then 5.637s total

Validation

  • pnpm exec oxfmt --check extensions/memory-core/src/memory/qmd-manager.ts extensions/memory-core/src/memory/qmd-manager.test.ts
  • node scripts/test-projects.mjs extensions/memory-core/src/memory/qmd-manager.test.ts
  • pnpm tsgo:extensions:test

Notes

This intentionally keeps the mcporter path unchanged. The patch only changes local QMD CLI execution, where QMD already accepts multiple -c/--collection filters.

Changed files

  • extensions/memory-core/src/memory/qmd-manager.test.ts (modified, +63/-21)
  • extensions/memory-core/src/memory/qmd-manager.ts (modified, +31/-12)

Code Example

qmd search "..." --json -n <limit> -c collection-a -c collection-b ...
RAW_BUFFERClick to expand / collapse

Summary

QMD-backed memory search currently fans out one qmd search/qmd query subprocess per managed collection when more than one collection is configured. For agents with many QMD memory collections, a single memory_search tool call can spend most of its latency serially starting QMD processes.

This is especially visible in realtime lanes such as Google Meet/Gemini Live owner-consult flows: the live model waits while the owner agent executes memory tools, so one user question can appear to stall for a long time.

Observed behavior

On an OpenClaw 2026.4.24 runtime with Jay configured for QMD memory:

  • memory backend: qmd
  • memory source: memory
  • QMD collections exposed in status: 11
  • query: openclaw memory search --agent jay "most recent OpenClaw PR" --max-results 1 --json
  • before patch: 14.578s total

Trajectory evidence from a Google Meet consult showed four memory_search tool calls in one answer, each taking roughly 16-18 seconds end to end. That made the voice lane appear unresponsive even though the consult eventually succeeded.

Expected behavior

When all selected collections belong to the same OpenClaw memory source, OpenClaw can pass all collection filters to one QMD invocation:

qmd search "..." --json -n <limit> -c collection-a -c collection-b ...

For mixed memory/session searches, OpenClaw should still avoid session results crowding out memory hits before its existing source-diversification step. A good compromise is one QMD invocation per source group, not one per collection.

Runtime validation

A local runtime patch applying source-grouped collection filters reduced the same Jay search from:

  • before: 14.578s total
  • after run 1: 7.261s total
  • after run 2: 5.637s total

This does not make QMD instant, but it removes the serial per-collection subprocess fanout for common single-source searches.

extent analysis

TL;DR

Passing all collection filters to one QMD invocation per source group can significantly reduce latency in memory searches.

Guidance

  • Identify the memory source for each collection and group them accordingly to minimize the number of QMD invocations.
  • Modify the memory_search tool to accept multiple collection filters for a single QMD invocation, using the -c option multiple times, as shown in the expected behavior example.
  • Test the modified tool with a local runtime patch to measure the reduction in latency, similar to the runtime validation described.
  • Consider implementing source-diversification to prevent session results from crowding out memory hits.

Example

qmd search "..." --json -n <limit> -c collection-a -c collection-b ...

This example demonstrates how to pass multiple collection filters to a single QMD invocation.

Notes

The proposed solution assumes that the QMD search functionality can handle multiple collection filters in a single invocation. Additionally, the performance benefits may vary depending on the specific use case and the number of collections involved.

Recommendation

Apply the workaround of passing all collection filters to one QMD invocation per source group, as it has been shown to reduce latency in memory searches. This approach can help improve the responsiveness of the voice lane in Google Meet consults.

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…

FAQ

Expected behavior

When all selected collections belong to the same OpenClaw memory source, OpenClaw can pass all collection filters to one QMD invocation:

qmd search "..." --json -n <limit> -c collection-a -c collection-b ...

For mixed memory/session searches, OpenClaw should still avoid session results crowding out memory hits before its existing source-diversification step. A good compromise is one QMD invocation per source group, not one per collection.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING