Skip to content

Refresh retrieval Q cache after single memory updates - #16

Draft
Frankie-Xu wants to merge 1 commit into
MemTensor:mainfrom
Frankie-Xu:fix/single-update-q-cache
Draft

Frankie-Xu wants to merge 1 commit into
MemTensor:mainfrom
Frankie-Xu:fix/single-update-q-cache

Conversation

@Frankie-Xu

Copy link
Copy Markdown

MemoryService.update_value persists a new Q value but leaves an already populated retrieval Q cache unchanged. A retrieve → single update → retrieve sequence can therefore keep ranking memories with the old Q value.

After a successful non-None updater result, refresh the cache using the same FIFO capacity policy as update_values. Disabled/null actions, None results, and persistence failures leave the cache unchanged. The Q-learning formula and retrieval policy are unchanged.

Validation:

  • Five unittest regressions: two fail on main c1b322c and all pass with this change.
  • The same five tests pass with pytest and from a clean git archive export.
  • Tests import the real service, retrieval, normalization, batch update, and Q updater code, using in-memory persistence and fixed embeddings; only external MemOS import types are stubbed.
  • compileall and git diff --check pass.

No live MemOS integration, LLM benchmark, or Python version matrix was run. This change is independent of the finite-value validation in PR #14.

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