fix(configs): add missing ConfigDict to vector store configs#4656
Merged
kartik-mem0 merged 2 commits intomem0ai:mainfrom Apr 2, 2026
Merged
Conversation
Following up on mem0ai#4646, five more vector store config classes were missing `model_config = ConfigDict(arbitrary_types_allowed=True)` despite using pydantic v2 constructs (model_validator, Field). One config (neptune.py) used a raw dict instead of ConfigDict. One (valkey.py) had bare field annotations with no Field() descriptions or validate_extra_fields guard. Changes: - elasticsearch.py: add ConfigDict import + model_config (required: has Callable field type) - mongodb.py: add ConfigDict import + model_config - opensearch.py: add ConfigDict import + model_config (required: has Optional[object] and Optional[Type] fields) - pgvector.py: add ConfigDict import + model_config (required: has Optional[Any] connection_pool field) - supabase.py: add ConfigDict import + model_config - valkey.py: add ConfigDict import + model_config + Field descriptions + validate_extra_fields (was the only config with bare annotations and no extra-field guard, inconsistent with all peers) - neptune.py: replace raw dict `model_config = {...}` with `model_config = ConfigDict(...)` per pydantic v2 convention No behaviour change. All configs now consistently use ConfigDict.
kartik-mem0
approved these changes
Apr 2, 2026
rainfd
pushed a commit
to rainfd/mem0
that referenced
this pull request
Apr 8, 2026
…4656) Co-authored-by: kartik-mem0 <kartik.labhshetwar@mem0.ai>
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
Follow-up to #4646 — five more vector store config classes were missing
model_config = ConfigDict(arbitrary_types_allowed=True)despite already using pydantic v2 constructs (model_validator,Field). Two additional inconsistencies were also found and fixed.Changes
elasticsearch.pyConfigDict— required: hasCallablefield typemodel_configmongodb.pyConfigDictmodel_configopensearch.pyConfigDict— required: hasOptional[object]andOptional[Type]fieldsmodel_configpgvector.pyConfigDict— required: hasOptional[Any]connection_pool fieldmodel_configsupabase.pyConfigDictmodel_configvalkey.pyField()), novalidate_extra_fields, noConfigDict— only config class inconsistent with all peersConfigDict,Fieldwith descriptions,validate_extra_fieldsvalidatorneptune.pymodel_config = {"arbitrary_types_allowed": False}instead ofConfigDict(...)ConfigDict(arbitrary_types_allowed=False)Why This Matters
Pydantic v2 silently ignores a raw dict
model_config. WithoutConfigDict(arbitrary_types_allowed=True), configs that hold non-pydantic types (likeCallable,object,Type, connection pool objects) will raisePydanticSchemaGenerationErrorin stricter environments.valkey.pyhad no extra-field guard at all — passing a typo'd config key would silently be ignored.No behaviour change
All changes are consistency fixes. Existing valid configs continue to work identically.
Closes the remaining
class Config:/ raw dict / missing-ConfigDict inconsistencies after #4646.