Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(vector-store): Add Valkey vector store support#3272

Merged
parshvadaftari merged 15 commits intomem0ai:mainfrom
swarnaprakash:valkey
Sep 9, 2025
Merged

feat(vector-store): Add Valkey vector store support#3272
parshvadaftari merged 15 commits intomem0ai:mainfrom
swarnaprakash:valkey

Conversation

@swarnaprakash
Copy link
Contributor

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:

  • ValkeyDB connector with full vector operations (insert, search, delete, update, get)
  • Support for both HNSW and FLAT indexing algorithms
  • Comprehensive configuration management
  • Complete documentation and examples
  • Extensive unit tests

Fixes # (no specific issue - new feature contribution)

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • Unit Test - Comprehensive test suite intests/vector_stores/test_valkey.py
  • Test Script - Integration tests and benchmark scripts

Test Configuration:

  • Valkey server with search module enabled
  • Tested across multiple Python versions: 3.9, 3.10, and 3.11
  • All existing mem0 tests continue to pass

Testing Details:

  • Unit Tests: Ranmake test successfully on Python 3.9, 3.10, and 3.11
  • Integration Tests: Executed comprehensive integration tests with real Valkey instance
  • Benchmark Tests: Performance benchmarks comparing HNSW vs FLAT indexing across all Python versions
  • Benchmark Scripts:Available here (HNSW performance comparison and AWS Bedrock integration tests)

Test Results:

  • All unit tests pass across Python 3.9, 3.10, 3.11
  • Integration tests verify full functionality with live Valkey instance
  • Benchmark tests confirm performance characteristics and compatibility
  • No regressions in existing vector store functionality

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Maintainer Checklist

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Made sure Checks passed

madolson reacted with rocket emoji
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
Copy link

CLAassistant commentedAug 4, 2025
edited
Loading

CLA assistant check
All committers have signed the CLA.

Copy link

@seaofawarenessseaofawareness left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM

Copy link

@madolsonmadolson left a 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.

swarnaprakashand others added2 commitsAugust 5, 2025 14:35
…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.
@meet-bhagdev
Copy link

any ETA on when this PR can be merged?

@parshvadaftari
Copy link
Contributor

@swarnaprakash@acarbonetto@meet-bhagdev Can you resolve merge conflicts?

Copy link
Contributor

@parshvadaftariparshvadaftari left a 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.

swarnaprakash reacted with thumbs up emoji
{"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
Copy link
Contributor

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?

Copy link
ContributorAuthor

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

parshvadaftari reacted with thumbs up emoji
assert "@agent_id:{test_agent}" in query


def test_format_timestamp(valkey_db):
Copy link
Contributor

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?

Copy link
ContributorAuthor

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
Copy link

parshvadaftari@ - thank you for the comments. we will review and resolve the merge conflicts

parshvadaftari reacted with thumbs up emoji

- 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
Copy link
ContributorAuthor

@swarnaprakash@acarbonetto@meet-bhagdev Can you resolve merge conflicts?

I have resolved all conflicts and incorporated all review comments (new outputdata format and fixes in get, get_all methods)

meet-bhagdev reacted with hooray emoji

@parshvadaftari
Copy link
Contributor

@swarnaprakash Can you update thedocs.json for the changes to show up in the frontend and also update the dependency in theMakefile.

- Added Valkey to docs.json navigation structure- Added valkey dependency to Makefile install_all target
@swarnaprakash
Copy link
ContributorAuthor

@swarnaprakash Can you update thedocs.json for the changes to show up in the frontend and also update the dependency in theMakefile.

done@parshvadaftari

parshvadaftari reacted with thumbs up emoji

Copy link
Contributor

@parshvadaftariparshvadaftari left a 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.

@parshvadaftari
Copy link
Contributor

@swarnaprakash Thanks for the integration. Can you please incorporate the changes requested. Most of them revolve around docs for better readability and consistency.

swarnaprakashand others added3 commitsSeptember 9, 2025 10:32
- 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
Copy link
Contributor

@parshvadaftariparshvadaftari left a 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.

- Remove TypeScript support (not available for Valkey)- Add link to valkey.io in introduction- Rename Configuration to Usage section for clarity
@meet-bhagdev
Copy link

@parshvadaftari - thanks for the quick review. what's the next step here?

@parshvadaftariparshvadaftari merged commite3f0277 intomem0ai:mainSep 9, 2025
6 of 7 checks passed
@parshvadaftari
Copy link
Contributor

Thanks a lot for the Valkey integration!

swarnaprakash and madolson reacted with hooray emoji

@swarnaprakash
Copy link
ContributorAuthor

@parshvadaftari Thanks for all the review feedback and accepting this PR!

jamesnavinhill pushed a commit to jamesnavinhill/ltm that referenced this pull requestSep 25, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

4 more reviewers

@madolsonmadolsonmadolson left review comments

@acarbonettoacarbonettoacarbonetto left review comments

@parshvadaftariparshvadaftariparshvadaftari approved these changes

@seaofawarenessseaofawarenessseaofawareness approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

7 participants

@swarnaprakash@CLAassistant@meet-bhagdev@parshvadaftari@madolson@acarbonetto@seaofawareness

Comments


[8]ページ先頭

©2009-2026 Movatter.jp