fix(memory): default context_min_score to 0.0 so FTS5 BM25 results aren't dropped on small corpora (#286)

SQLite FTS5 BM25 scores collapse toward zero on small corpora — when
every indexed document contains the query term, IDF approaches zero so
scores return ~1e-6. The default context_min_score = 0.1 silently
filters out every result before injection, so memory is stored but
never reaches the model on a fresh install.

Lowering both defaults to 0.0 lets retrieved context flow through;
users who want strict filtering can still set [memory]
context_min_score in config.toml.

Closes #262
This commit is contained in:
Robby Manihani
2026-04-26 17:07:52 -07:00
committed by GitHub
parent a26f7b2e48
commit 7ba095ebf1
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -764,7 +764,7 @@ class StorageConfig:
default_backend: str = "sqlite"
db_path: str = str(DEFAULT_CONFIG_DIR / "memory.db")
context_top_k: int = 5
context_min_score: float = 0.1
context_min_score: float = 0.0
context_max_tokens: int = 2048
chunk_size: int = 512
chunk_overlap: int = 64
+1 -1
View File
@@ -16,7 +16,7 @@ class ContextConfig:
enabled: bool = True
top_k: int = 5
min_score: float = 0.1
min_score: float = 0.0
max_context_tokens: int = 2048