Skip to content

[Feature]: expose QMD no-rerank for memory.qmd query mode #61834

@kouka-t0yohei

Description

@kouka-t0yohei

Summary

Expose QMD 2.1.0's no-rerank capability from OpenClaw's QMD memory backend so users can run searchMode: "query" without the reranking step.

Problem to solve

OpenClaw already supports:

  • memory.backend = "qmd"
  • memory.qmd.searchMode = "query" | "search" | "vsearch"

But when searchMode: "query" is used, there is currently no config or tool-level way to disable reranking.

Upstream QMD 2.1.0 added:

  • CLI: qmd query --no-rerank
  • MCP query tool: rerank: false

So OpenClaw currently cannot expose a useful middle ground between:

  • search = fast but BM25-only
  • query = best recall but slower
  • desired = query without rerank, for faster hybrid results

Proposed solution

Expose the rerank toggle in one or both of these forms.

Option A: config-level

{
  "memory": {
    "backend": "qmd",
    "qmd": {
      "searchMode": "query",
      "noRerank": true
    }
  }
}

Expected behavior:

  • ignore when searchMode !== "query"
  • in direct CLI mode, append --no-rerank
  • in MCP-backed query mode, pass rerank: false if supported

Option B: request-level

Expose a request-level toggle on memory_search, for example:

{
  "query": "QMD 2.1.0 rerank false",
  "maxResults": 5,
  "rerank": false
}

This would be more flexible than config-only support.

Alternatives considered

  • Use memory.qmd.searchMode = "search": faster, but loses hybrid query behavior
  • Keep using searchMode = "query": better recall, but slower than necessary when reranking is not needed
  • Call qmd query --no-rerank manually outside OpenClaw: workable as a local workaround, but bypasses the normal memory_search path

Impact

Affected: users running memory.backend = "qmd", especially on CPU-only or latency-sensitive systems
Severity: Medium
Frequency: any interactive use of searchMode: "query"
Consequence: users must choose between BM25-only search and full reranked query mode, with no supported middle ground even though upstream QMD now provides one

Evidence/examples

QMD 2.1.0 release notes:
https://github.com/tobi/qmd/releases/tag/v2.1.0

Relevant excerpt:

--no-rerank flag skips the reranking step in qmd query
useful when you want fast results or don't have a GPU
also exposed as rerank: false on the MCP query tool

In local verification, qmd query --no-rerank worked as expected and provided a useful speed/quality tradeoff compared with full reranked query mode.

Additional information

This is separate from warm-process / MCP-caching work. Even if QMD is kept warm through MCP, a rerank toggle is still useful as an explicit latency vs quality control.

Metadata

Metadata

Assignees

Labels

P2Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions