Problem
enrichMessageWithRuntime() runs FTS5 + BM25 recall on every incoming message, with hardcoded parameters:
DEFAULT_RECALL_LIMIT = 5
MAX_CONTEXT_BYTES = 4000
SCOPED_RECALL_CANDIDATE_LIMIT = 64
GLOBAL_RECALL_CANDIDATE_LIMIT = 64
There is no way to disable this behavior via config. auto_save: false prevents automatic memory writes, but recall still fires on every message — even when the memories table is empty, causing unnecessary SQLite queries.
Why this matters
-
Unnecessary overhead — FTS5 search runs even when memory is empty or the user does not need context injection. For high-throughput or professional use, this is wasted cycles.
-
Noisy context — Auto-recall can inject irrelevant memories into the prompt, degrading model quality. The user has no way to say "I will manage context myself."
-
Inconsistent with auto_save: false — If I can disable auto-writes, I should be able to disable auto-reads. Currently it is only half-controllable.
-
Hardcoded limits — recall_limit, max_context_bytes, and candidate limits are compile-time constants. Users with large memory stores or specific context budgets cannot tune them.
Proposal
Add config options under memory:
{
"memory": {
"auto_recall": true,
"recall_limit": 5,
"max_context_bytes": 4000
}
}
auto_recall: false — skip enrichMessageWithRuntime() entirely, no FTS5/LIKE queries
recall_limit — configurable max results (currently hardcoded to 5)
max_context_bytes — configurable context budget (currently hardcoded to 4000)
Manual memory_recall tool calls should still work regardless of auto_recall setting.
Problem
enrichMessageWithRuntime()runs FTS5 + BM25 recall on every incoming message, with hardcoded parameters:DEFAULT_RECALL_LIMIT = 5MAX_CONTEXT_BYTES = 4000SCOPED_RECALL_CANDIDATE_LIMIT = 64GLOBAL_RECALL_CANDIDATE_LIMIT = 64There is no way to disable this behavior via config.
auto_save: falseprevents automatic memory writes, but recall still fires on every message — even when thememoriestable is empty, causing unnecessary SQLite queries.Why this matters
Unnecessary overhead — FTS5 search runs even when memory is empty or the user does not need context injection. For high-throughput or professional use, this is wasted cycles.
Noisy context — Auto-recall can inject irrelevant memories into the prompt, degrading model quality. The user has no way to say "I will manage context myself."
Inconsistent with
auto_save: false— If I can disable auto-writes, I should be able to disable auto-reads. Currently it is only half-controllable.Hardcoded limits —
recall_limit,max_context_bytes, and candidate limits are compile-time constants. Users with large memory stores or specific context budgets cannot tune them.Proposal
Add config options under
memory:{ "memory": { "auto_recall": true, "recall_limit": 5, "max_context_bytes": 4000 } }auto_recall: false— skipenrichMessageWithRuntime()entirely, no FTS5/LIKE queriesrecall_limit— configurable max results (currently hardcoded to 5)max_context_bytes— configurable context budget (currently hardcoded to 4000)Manual
memory_recalltool calls should still work regardless ofauto_recallsetting.