- Notifications
You must be signed in to change notification settings - Fork5.3k
feat(vector-store): Add Valkey vector store support#3272
feat(vector-store): Add Valkey vector store support#3272parshvadaftari merged 15 commits intomem0ai:mainfrom
Conversation
Add support for Valkey, an open source (BSD) high-performance key/valuedatastore that supports vector search capabilities.Key features:- Full vector operations: insert, search, delete, update, get- Index management: create, list, delete, info, reset- HNSW and FLAT indexing algorithm support- Comprehensive filtering and search capabilities- Robust error handling and fallback mechanismsThis implementation provides users with an additional high-performancevector store option for their Mem0 deployments.Includes:- ValkeyDB connector implementation- Configuration management- Comprehensive unit tests- Documentation and examples
CLAassistant commentedAug 4, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
seaofawareness left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM
madolson left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Tried it out and worked. Just some suggestions based off my test.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
…cation- Remove unnecessary query fallbacks- Add context-aware logging for index operations- Extract shared index schema builder to eliminate duplication- Simplify schema by removing redundant SEPARATOR clauses- Make index type validation explicit and defensive- Update tests for new idempotent behaviorReduces codebase by ~60 lines while improving maintainability.
Uh oh!
There was an error while loading.Please reload this page.
meet-bhagdev commentedAug 14, 2025
any ETA on when this PR can be merged? |
parshvadaftari commentedSep 3, 2025
@swarnaprakash@acarbonetto@meet-bhagdev Can you resolve merge conflicts? |
parshvadaftari left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Please incorporate the requested changes inorder to get things started.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
| {"name": "run_id", "type": "tag"}, | ||
| {"name": "user_id", "type": "tag"}, | ||
| {"name": "memory", "type": "tag"}, # Using TAG instead of TEXT for Valkey compatibility | ||
| {"name": "metadata", "type": "tag"}, # Using TAG instead of TEXT for Valkey compatibility |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Why metadata is explicitly used here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This is needed so that metadata can be returned in the output without needing to issue an additional HGET query (i.e just relying on FT.SEARCH command output). If you have recommendation to index specific fields of metadata in addition let me know
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
tests/vector_stores/test_valkey.py Outdated
| assert "@agent_id:{test_agent}" in query | ||
| def test_format_timestamp(valkey_db): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Why are we having this test explicitly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
added it originally to get coverage in unit-test. removed it, assuming the test is too specific and mocked out to be useful
meet-bhagdev commentedSep 3, 2025
parshvadaftari@ - thank you for the comments. we will review and resolve the merge conflicts |
- Add _convert_bytes() method to recursively decode bytes from hgetall()- Fix get() method to return properly decoded string data- Implement list() method using dummy vector search approach- Update documentation to clarify filter behavior (no validation, wildcards allowed)- All three methods (search, get, list) now work correctly with proper string data
- Replace bare except with specific UnicodeDecodeError- Remove dead code after return statement- Format code with ruff
- Fix test_list to expect full search query with KNN part- Update test_list_with_missing_fields_and_defaults with valid mock data- Add missing vector_score attribute to mocks- All 43 tests now pass with 95% coverage
- Added Valkey support alongside new Databricks integration- Updated changelog to include Valkey in v0.1.117 release- Resolved dependency and factory conflicts
swarnaprakash commentedSep 9, 2025
I have resolved all conflicts and incorporated all review comments (new outputdata format and fixes in get, get_all methods) |
parshvadaftari commentedSep 9, 2025
@swarnaprakash Can you update the |
- Added Valkey to docs.json navigation structure- Added valkey dependency to Makefile install_all target
swarnaprakash commentedSep 9, 2025
done@parshvadaftari |
parshvadaftari left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Rest of the integration looks good. Do make the changes in the documentation for better consistency.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
parshvadaftari commentedSep 9, 2025
@swarnaprakash Thanks for the integration. Can you please incorporate the changes requested. Most of them revolve around docs for better readability and consistency. |
- Removed Valkey entries from changelog- Keep changelog clean for separate release planning
- Updated configuration example to use Memory.from_config() pattern- Added proper Python/TypeScript tabs with conversation examples- Replaced feature-focused content with parameter documentation- Follows same structure as Qdrant and Pinecone docs
parshvadaftari left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Rest looks good to me.
Uh oh!
There was an error while loading.Please reload this page.
- Remove TypeScript support (not available for Valkey)- Add link to valkey.io in introduction- Rename Configuration to Usage section for clarity
meet-bhagdev commentedSep 9, 2025
@parshvadaftari - thanks for the quick review. what's the next step here? |
e3f0277 intomem0ai:mainUh oh!
There was an error while loading.Please reload this page.
parshvadaftari commentedSep 9, 2025
Thanks a lot for the Valkey integration! |
swarnaprakash commentedSep 9, 2025
@parshvadaftari Thanks for all the review feedback and accepting this PR! |
Description
Add support for Valkey vector store to mem0. Valkey is an open source (BSD) high-performance key/value datastore that supports vector search capabilities. This implementation provides users with an additional vector store option alongside existing options like Qdrant, Redis, and others.
This contribution adds:
Fixes # (no specific issue - new feature contribution)
Type of change
How Has This Been Tested?
tests/vector_stores/test_valkey.pyTest Configuration:
Testing Details:
make testsuccessfully on Python 3.9, 3.10, and 3.11Test Results:
Checklist:
Maintainer Checklist