feat: add vector store configuration properties with migration support #3498
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
Implements vector store configuration properties to address issue #3447, making vector_store configs as accessible as LLM and Embedder configs.
Changes Made
collection_name
,embedding_model_dims
,api_key
host
,port
,url
,path
for connection parametersget_migration_config()
for database migration operationsrebuild_config()
for rebuilding vector databasesto_dict()
for serialization to API responsesImplementation Details
✅ Enhanced
VectorStoreConfig
class with property accessors✅ Added helper methods for migration and rebuild operations
✅ Fixed package import issue in
__init__.py
✅ Added comprehensive test suite with 9 test cases
✅ All tests passing (8 passed, 1 skipped)
✅ All linting checks pass with ruff
✅ Pre-commit hooks installed and working
✅ No regression - existing tests continue to pass
Code Example
Before: Nested config access
After: Direct property access
Testing
pytest tests/configs/test_vector_store_config.py -v # Result: 8 passed, 1 skipped, 1 warning
Files Changed
mem0/vector_stores/configs.py
- Enhanced VectorStoreConfig classmem0/__init__.py
- Fixed package import for developmenttests/configs/test_vector_store_config.py
- Comprehensive test suiteCloses #3447