fix(agent): align AgentMemory decay with EbbinghausAlgorithm - #1150
Open
knqiufan wants to merge 2 commits into
Open
fix(agent): align AgentMemory decay with EbbinghausAlgorithm#1150knqiufan wants to merge 2 commits into
knqiufan wants to merge 2 commits into
Conversation
…se#1149) Replace the hard-coded linear decay in MultiAgent/MultiUser update_memory_decay() and cleanup_forgotten_memories() with shared Ebbinghaus retention helpers. Sync metadata.intelligence on decay passes, persist via storage.update_memory, and add regression tests.
Keep storage-loaded legacy string memory IDs from being coerced to Snowflake ints when synchronizing Agent caches, while retaining normalized cache variants for modern IDs.
Member
|
LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MultiAgentMemoryManager.update_memory_decay()andMultiUserMemoryManager.update_memory_decay()withEbbinghausAlgorithm.calculate_current_retention(), keeping Agent cacheretention_scorein sync withmetadata.intelligence.src/powermem/agent/utils/retention.pyfor retention calculation, cache/metadata synchronization, cleanup classification, and persistence.cleanup_forgotten_memories()in both managers to use Ebbinghausshould_forget()/should_archive()instead of fixed linear thresholds on stale cache scores.storage.update_memory()so scheduled decay passes do not re-trigger the intelligence plugin.Test plan
python -m pytest tests/unit/test_issue_925_agent_memory_share.py::test_multi_agent_loads_legacy_agent_scope_as_agent_group -qpython -m pytest tests/unit/agent/test_memory_id_normalize.py -qpython -m pytest tests/unit/agent/test_agent_retention_decay.py -qFixes #1149