The FactRetriever's _fts_candidates passed the raw query string directly to FTS5's MATCH operator. FTS5 defaults to AND-between-tokens, which means any multi-word prose query like 'what happened with the deployment rollback' required every single token to co-occur in a fact — dropping recall to zero on the kind of queries agents actually issue via prefetch(). Fix: add _sanitize_fts_query() that: - tokenizes the query and drops English stopwords - strips FTS5 operator characters per token - OR-joins the remaining content tokens as phrase literals For pathological inputs (all stopwords, empty), falls back to the raw query so the caller sees zero results instead of a SQL error. This is a pure-retrieval-quality fix — the HRR + Jaccard reranking stages still keep precision high. Ships with 10 tests covering the sanitizer and retrieval integration. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| test_byterover_provider.py | ||
| test_hindsight_provider.py | ||
| test_holographic_retrieval.py | ||
| test_holographic_shutdown_closes_db.py | ||
| test_mem0_backend.py | ||
| test_mem0_providers.py | ||
| test_mem0_setup.py | ||
| test_mem0_v3.py | ||
| test_memory_lazy_install.py | ||
| test_openviking_provider.py | ||
| test_supermemory_provider.py | ||