feat(memos-local): make auto-recall Phase 1 search parameters configurable
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?: numberautoRecallMinScore?: number
- Added corresponding defaults:
3and0.50
src/config.ts
- Both new fields are resolved from
cfg.recallwith the new defaults as fallback.
index.ts
- Replaced hardcoded
maxResults: 10, minScore: 0.45in the Phase 1engine.search()call withctx.config.recall.autoRecallMaxResultsandctx.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
Thanks for the PR — making these Phase 1 parameters configurable is the right thing to do.
Two issues before this can be merged:
- 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.
- 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.
⚠️ 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