Problem
The auto-recall feature in the before_prompt_build hook currently hardcodes maxResults: 10 for both local and Hub memory searches:
https://github.com/MemTensor/MemOS/blob/main/apps/memos-local-openclaw/index.ts#L1893-L1896
This means the recall.maxResultsDefault configuration option is effectively ignored during automatic recall, even though users may set it to a lower value (e.g., 3 or 5) to reduce token consumption.
Current Behavior
memory_search tool correctly respects maxResultsDefault (default 6)
- Auto-recall always fetches 10 results from local + 10 from Hub, regardless of config
- After LLM filtering and deduplication, this still injects ~5-10 memory entries into every system prompt
- At ~300-500 tokens per entry, this adds ~2,000-5,000 tokens per turn
Expected Behavior
Auto-recall should either:
- Read from
recall.maxResultsDefault config instead of hardcoding 10, OR
- Support a separate
recall.autoRecallMaxResults config key for independent control
Suggested Fix
// index.ts ~1893
const recallCfg = ctx.config.recall ?? {};
const autoRecallMax = recallCfg.maxResultsDefault ?? 10;
const arLocalP = engine.search({
query,
maxResults: autoRecallMax,
minScore: 0.45,
ownerFilter: recallOwnerFilter
});
Environment
- Plugin version: 1.0.8
- OpenClaw version: 2026.4.x
Thank you for the excellent plugin!
Problem
The auto-recall feature in the
before_prompt_buildhook currently hardcodesmaxResults: 10for both local and Hub memory searches:https://github.com/MemTensor/MemOS/blob/main/apps/memos-local-openclaw/index.ts#L1893-L1896
This means the
recall.maxResultsDefaultconfiguration option is effectively ignored during automatic recall, even though users may set it to a lower value (e.g., 3 or 5) to reduce token consumption.Current Behavior
memory_searchtool correctly respectsmaxResultsDefault(default 6)Expected Behavior
Auto-recall should either:
recall.maxResultsDefaultconfig instead of hardcoding 10, ORrecall.autoRecallMaxResultsconfig key for independent controlSuggested Fix
Environment
Thank you for the excellent plugin!