feat: add valkey memory#3
Merged
Merged
Conversation
Signed-off-by: Edward Liang <edward.liang@improving.com>
Signed-off-by: Edward Liang <edward.liang@improving.com>
atao2004
reviewed
Jun 5, 2026
atao2004
left a comment
Collaborator
There was a problem hiding this comment.
Hey the code looks pretty good I didn't find any bugs. The implementation follows the same patterns as Mem0Memory and GLIDE API usage seems correct.
Just two things; wondering if we need to filter by agent_role as per the spec and to check if it would be helpful to use tls.
Signed-off-by: Edward Liang <edward.liang@improving.com>
Collaborator
|
LGTM! |
atao2004
added a commit
that referenced
this pull request
Jun 8, 2026
…ValkeyMemory implementation). (#4)
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
Adds a working ValkeyMemory implementation backed by Valkey Search (HNSW vector index) and switches the optional dependency from the async
valkey-glideto the synchronousvalkey-glide-syncclient, which fits the current runtime's blocking call patterns.Issue
N/A
Changes
runtime/node/agent/memory/valkey_memory.py— new file implementingValkeyMemory. Stores each memory item as a Valkey Hash with content, embedding (float32), agent role, and timestamp. Creates an FT index with HNSW COSINE metric at init. Retrieval uses KNN search and converts cosine distance to similarity for threshold filtering.entity/configs/node/memory.py— added optionalusernamefield toValkeyMemoryConfigfor ACL-based auth; wired it throughfrom_dictandfield_specs.pyproject.toml— changed optional dep fromvalkey-glide>=2.4tovalkey-glide-sync>=2.4.tests/test_valkey_memory.py— replaced the skip-always integration skeleton with unit tests covering instantiation, update, retrieve (threshold, ordering, errors), count, load/save no-ops, and the lazy import error path. All tests use mocked glide_sync.uv.lock— lock file updated for valkey-glide-sync 2.4.1.Tests
Unit tests in
tests/test_valkey_memory.pycover:update()hash storage, float32 encoding, TTL expire calls, empty-input short circuitretrieve()result parsing, similarity threshold filtering, descending sort, empty query, search errorscount_memories()via ft.info_get_glide_sync()ImportError when the package is missingRun with
pytest tests/test_valkey_memory.py -v.