fix: GH-3690, enhance RedisVectorStore with RedisVectorStoreBuilderCustomizer #3809
+151
−5
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.
Description
This PR introduces a generic extension point for customizing
VectorStore.Builder
viaVectorStoreBuilderCustomizer
and fixes retrieval failures inRedisVectorStore
.Background
Previously, when using
VectorStoreChatMemoryAdvisor
withRedisVectorStore
andinitialize-schema=true
, metadata fields likeconversationId
(used infilterExpression
) weren't registered in the Redis schema. This occurred becauseRedisVectorStoreProperties
didn't support settingmetadataFields
during auto-configuration, causing retrieval failures during similarity search.Related issue: #3690
Changes
VectorStoreBuilderCustomizer<T extends VectorStore.Builder<T>>
interfaceRedisVectorStoreBuilderCustomizer
VectorStoreBuilderCustomizer<RedisVectorStore.Builder>
RedisVectorStoreAutoConfiguration
RedisVectorStore.Builder
as dependencyNew Customization Pattern
Developers can now customize metadata fields non-invasively:
Impact
initialize-schema=true
functionalityRedisVectorStore
wiringSpecial Thanks
🙌 To @Acacian for test contributions and valuable feedback.
Closes: #3690
Looking forward to your review!