Skip to content

fix(intelligence): keep fresh zero-importance memories searchable - #1113

Merged
wayyoungboy merged 1 commit into
mainfrom
fix/native-hybrid-search-retention-ranking
Jun 29, 2026
Merged

fix(intelligence): keep fresh zero-importance memories searchable#1113
wayyoungboy merged 1 commit into
mainfrom
fix/native-hybrid-search-retention-ranking

Conversation

@wayyoungboy

Copy link
Copy Markdown
Member

Summary

  • Prevent freshly persisted zero-importance memories from receiving zero initial/current retention
  • Add a regression unit test covering relevant search hits with importance_score=0
  • Format the touched intelligence files with black

Root Cause

#1084 made search ranking multiply storage relevance by effective_retention. Fresh memories whose importance evaluator returned 0.0 were initialized with current_retention=0.0, which zeroed out otherwise relevant hybrid-search results. This caused main Regression Tests to fail in test_native_hybrid_search.py::TestNativeHybridSearch::test_tc005_hybrid_search_fusion_effect, where a Zhang San hit was demoted below an unrelated Wang Wu result.

Verification

  • pytest tests/unit/intelligence/test_retention_runtime.py tests/unit/intelligence/test_ebbinghaus_decay_rate.py tests/unit/intelligence/test_intelligent_memory_manager.py
  • uv run --no-project --python 3.11 --with-editable ".[dev]" black --check src/powermem/intelligence/ebbinghaus_algorithm.py tests/unit/intelligence/test_retention_runtime.py
  • git diff --check

Release Note

This should be merged before cutting the next release because latest main currently has a failing Regression Tests workflow.

@wayyoungboy
wayyoungboy merged commit 97bbbe7 into main Jun 29, 2026
26 checks passed
@wayyoungboy
wayyoungboy deleted the fix/native-hybrid-search-retention-ranking branch June 29, 2026 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant