mem0ai/mem0 · error · ValueError
Extra fields not allowed: {', '.join(extra_fields)}. Please
Error message
Extra fields not allowed: {', '.join(extra_fields)}. Please input only the following fields: {', '.join(allowed_fields)} What it means
TurbopufferConfig enforces a closed field set via a `before` model_validator: only the declared Turbopuffer fields (api_key, region, collection_name, embedding_model_dims, distance_metric, batch_size, extra_params, and similar) may appear in the config dict. Any other key raises this error with the offending and allowed key lists in the message.
Source
Thrown at mem0/configs/vector_stores/turbopuffer.py:39
@model_validator(mode="before")
@classmethod
def check_api_key(cls, values: Dict[str, Any]) -> Dict[str, Any]:
api_key = values.get("api_key")
if not api_key and "TURBOPUFFER_API_KEY" not in os.environ:
raise ValueError(
"Either 'api_key' must be provided or TURBOPUFFER_API_KEY environment variable must be set."
)
return values
@model_validator(mode="before")
@classmethod
def validate_extra_fields(cls, values: Dict[str, Any]) -> Dict[str, Any]:
allowed_fields = set(cls.model_fields.keys())
input_fields = set(values.keys())
extra_fields = input_fields - allowed_fields
if extra_fields:
raise ValueError(
f"Extra fields not allowed: {', '.join(extra_fields)}. "
f"Please input only the following fields: {', '.join(allowed_fields)}"
)
return values
model_config = ConfigDict(arbitrary_types_allowed=True)
View on GitHub (pinned to 001c235229)
Solutions
- Remove the extra keys named in the message; keep only the allowed fields listed
- Move arbitrary Turbopuffer client tunables into extra_params={'...': ...} which exists for that purpose
- Fix misspellings against the allowed list in the error text
Example fix
# before
config = {"api_key": "tpuf_...", "namespace": "mem0", "retries": 3}
# after
config = {"api_key": "tpuf_...", "collection_name": "mem0", "extra_params": {"retries": 3}} Defensive patterns
Strategy: validation
Validate before calling
from mem0.configs.vector_stores.turbopuffer import TurbopufferConfig
extra = set(cfg) - set(TurbopufferConfig.model_fields)
if extra:
raise ConfigError(f"move/remove unknown keys: {sorted(extra)}; tunables go in extra_params") Prevention
- Route arbitrary client options through extra_params
- Use the error's allowed-fields list as the source of truth when writing the config
When it happens
Trigger: Passing keys like namespace, api_key_id, or provider-level keys (e.g. 'provider' nested inside 'config'); copying a config template from another vector store; misspelling an allowed field (e.g. 'batchsize' instead of 'batch_size').
Common situations: TurboPuffer docs calling collections 'namespaces' and the config using that word; passing provider tunables that belong in extra_params as top-level keys; stale field names from an older mem0 version.
Related errors
- Extra fields not allowed: {', '.join(extra_fields)}. Please
- Extra fields not allowed: {', '.join(extra_fields)}. Please
- A valid PostgreSQL connection string must be provided
- Extra fields not allowed: {', '.join(extra_fields)}. Please
- Either 'api_key' must be provided or TURBOPUFFER_API_KEY env
AI-assisted analysis of mem0ai/mem0@001c235229 (2026-08-15).
Data as JSON: /api/errors/6cd2499e36a1d4a1.
Report an issue: GitHub.