MemOS icon indicating copy to clipboard operation
MemOS copied to clipboard

feat(memos-local): make auto-recall Phase 1 search parameters configurable

Open yongren-del opened this issue 7 months ago • 1 comments

Motivation

Auto-recall Phase 1 was using hardcoded maxResults=10 and minScore=0.45 for the quick local search pass before the LLM dedup step. These values are not configurable, which forces users who want different recall behavior to patch the source directly.

Changes

Three files changed in apps/memos-local-openclaw/:

src/types.ts

  • Added two new optional fields to the recall{} config interface:
    • autoRecallMaxResults?: number
    • autoRecallMinScore?: number
  • Added corresponding defaults: 3 and 0.50

src/config.ts

  • Both new fields are resolved from cfg.recall with the new defaults as fallback.

index.ts

  • Replaced hardcoded maxResults: 10, minScore: 0.45 in the Phase 1 engine.search() call with ctx.config.recall.autoRecallMaxResults and ctx.config.recall.autoRecallMinScore.

Behavior change

Parameter Before (hardcoded) After (default) Config path
Phase 1 max results 10 3 recall.autoRecallMaxResults
Phase 1 min score 0.45 0.50 recall.autoRecallMinScore

Lowering Phase 1 from 10→3 results and raising minScore from 0.45→0.50 reduces noise passed to the LLM dedup step, improving both precision and token efficiency.

Example config

memos-local-openclaw:
  recall:
    autoRecallMaxResults: 3
    autoRecallMinScore: 0.50

yongren-del avatar Apr 14 '26 08:04 yongren-del

Thanks for the PR — making these Phase 1 parameters configurable is the right thing to do.

Two issues before this can be merged:

  1. The default value changes are a silent breaking change

Dropping maxResults from 10 → 3 and raising minScore from 0.45 → 0.50 isn't just a configurable default — it changes behavior for all existing users. Phase 1 is intentionally a wide-net pass before LLM dedup, so cutting candidates from 10 to 3 risks discarding relevant memories before the LLM ever sees them. Please revert the defaults to match the previous hardcoded values (10 / 0.45), or provide benchmark data justifying the change.

  1. New defaults belong in DEFAULTS (src/types.ts)

All defaults are centralized in the DEFAULTS constant. Please move autoRecallMaxResults and autoRecallMinScore there to stay consistent.

Happy to approve once these are addressed.

Hun-ger avatar Apr 17 '26 08:04 Hun-ger

⚠️ Automated Test Results: NO TEST SCOPE

Automated tests were not run because the changed files do not map to an executable test scope.

Details: No executable test scope maps to the changed files. Automated tests were not run; add env.yaml source_mapping + execution for this path family, then rerun. Changed files: (none detected) Manual review or env.yaml source_mapping/execution coverage is required before merge.

Branch: feat/auto-recall-config

Memtensor-AI avatar Jul 09 '26 03:07 Memtensor-AI