fix(agent): use config max_tool_iterations, add memory relevance filtering, rebalance search weights

Three fixes for conversation quality issues:

1. loop_.rs and channels now read max_tool_iterations from AgentConfig
   instead of using a hardcoded constant of 10, making it configurable.

2. Memory recall now filters entries below a configurable
   min_relevance_score threshold (default 0.4), preventing unrelated
   memories from bleeding into conversation context.

3. Default hybrid search weights rebalanced from 70/30 vector/keyword
   to 40/60, reducing cross-topic semantic bleed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Edvard 2026-02-17 20:09:06 -05:00 committed by Chummy
parent 21c5f58363
commit 8a1e7cc7ef
6 changed files with 90 additions and 24 deletions

View file

@ -274,8 +274,9 @@ fn memory_config_defaults_for_backend(backend: &str) -> MemoryConfig {
embedding_provider: "none".to_string(),
embedding_model: "text-embedding-3-small".to_string(),
embedding_dimensions: 1536,
vector_weight: 0.7,
keyword_weight: 0.3,
vector_weight: 0.4,
keyword_weight: 0.6,
min_relevance_score: 0.4,
embedding_cache_size: if profile.uses_sqlite_hygiene {
10000
} else {