Repository navigation
Conversation
This branch has not been deployed
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.
Problem
InMemoryLTMBackend(LongTermMemory(backend="local")) ignoresuser_id.save_memorywrites every user's events into one sharedVectorStoreIndex, andsearch_memorysearches that shared index, so one user's memories are returned to another user. The other backends (Redis, OpenSearch, ...) build a separate index perveadk-ltm/{index}/{user_id}.Reproduction
Fix
Keep one in-memory
VectorStoreIndexperuser_id. Searching for a user with no saved memories returns[].Verification
tests/memory/long_term_memory_backends/test_in_memory_ltm_backend.py(uses llama_indexMockEmbedding, no network): both tests fail on main and pass with the fix.uv run --extra dev pre-commit run --all-files: pass.uv run --extra dev pytest -n 4 -m "not codex_smoke and not piagent_smoke": 8054 passed. The same 24 failures and 2 collection errors (Codex runtime / self-host sandbox tests that need local tooling) occur on unmodified main in this environment.Impact
No public API change. Only the
localbackend's behavior changes: memories are now scoped per user, like the other backends.This PR was prepared with an AI coding agent; I authorized the submission.