openclaw - 💡(How to fix) Fix feat(active-memory): make recall budget split configurable (maxMemoryResults, snippet length, wiki max chars) [1 comments, 2 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#75607Fetched 2026-05-02 05:32:51
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
2
Timeline (top)
mentioned ×2subscribed ×2commented ×1

Root Cause

  • maxMemoryResults = 5 × 400 char snippets → memory consumes ~997 of 1000 chars
  • wikiTopK = 3 × 2500 char budget → gets truncated to almost zero because memory eats the budget first
  • wikiMaxChars = 2500 (internal budget for wiki formatting)

Fix Action

Fix / Workaround

  • Users with active-memory + wikis integration lose wiki context injection entirely
  • Hardcoded values in compiled JS are fragile (local patches get overwritten on update)
  • No way to tune the trade-off between memory recall depth and wiki coverage

Code Example

{
  "plugins": {
    "entries": {
      "active-memory": {
        "config": {
          "maxMemoryResults": 3,
          "memorySnippetChars": 200,
          "wikiTopK": 3,
          "wikiMaxChars": 2500
        }
      }
    }
  }
}
RAW_BUFFERClick to expand / collapse

Problem

The active-memory recall budget (maxSummaryChars, default 1000) is shared between memory search and wiki (vectordb) search results. Currently the allocation is hardcoded in the recall function:

  • maxMemoryResults = 5 × 400 char snippets → memory consumes ~997 of 1000 chars
  • wikiTopK = 3 × 2500 char budget → gets truncated to almost zero because memory eats the budget first
  • wikiMaxChars = 2500 (internal budget for wiki formatting)

Result: Wiki search results are effectively never injected into the prompt because memory fills the entire 1000-char summary budget.

Reproduction

  1. Configure maxSummaryChars: 1000 (default)
  2. Have both memory and wiki search return results
  3. Observe that only memory snippets appear in the <active_memory_plugin> block
  4. Wiki search returns valid hits (verified independently) but they never make it into the injected summary

Proposed Fix

Move the hardcoded values into plugin config:

{
  "plugins": {
    "entries": {
      "active-memory": {
        "config": {
          "maxMemoryResults": 3,
          "memorySnippetChars": 200,
          "wikiTopK": 3,
          "wikiMaxChars": 2500
        }
      }
    }
  }
}

Or alternatively: implement a proportional budget split (e.g., 50/50 between memory and wiki) instead of first-come-first-served.

Impact

  • Users with active-memory + wikis integration lose wiki context injection entirely
  • Hardcoded values in compiled JS are fragile (local patches get overwritten on update)
  • No way to tune the trade-off between memory recall depth and wiki coverage

Environment

  • OpenClaw 2026.4.29 (a448042)
  • active-memory plugin with local vectordb.py integration
  • maxSummaryChars: 1000 (default, enforced by latest update)

extent analysis

TL;DR

Move the hardcoded values into plugin config to allow for adjustable budget allocation between memory and wiki search results.

Guidance

  • Review the proposed fix and consider implementing a proportional budget split (e.g., 50/50) between memory and wiki search results.
  • Update the plugin configuration to include maxMemoryResults, memorySnippetChars, wikiTopK, and wikiMaxChars to fine-tune the budget allocation.
  • Verify that wiki search results are injected into the prompt by checking the <active_memory_plugin> block after applying the configuration changes.
  • Consider testing different budget allocation ratios to find the optimal balance between memory recall depth and wiki coverage.

Example

{
  "plugins": {
    "entries": {
      "active-memory": {
        "config": {
          "maxMemoryResults": 3,
          "memorySnippetChars": 200,
          "wikiTopK": 3,
          "wikiMaxChars": 2500
        }
      }
    }
  }
}

Notes

The proposed fix assumes that the plugin configuration can be updated to include the necessary parameters. If this is not possible, an alternative approach may be needed.

Recommendation

Apply the proposed workaround by moving the hardcoded values into plugin config, as this will allow for adjustable budget allocation and provide a more flexible solution.

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

openclaw - 💡(How to fix) Fix feat(active-memory): make recall budget split configurable (maxMemoryResults, snippet length, wiki max chars) [1 comments, 2 participants]