mem0ai/mem0 · error · ValueError

Both 'pod_config' and 'serverless_config' cannot be specifie

Error message

Both 'pod_config' and 'serverless_config' cannot be specified. Choose one deployment option.

What it means

Error "Both 'pod_config' and 'serverless_config' cannot be specified. Choose one deployment option." thrown in mem0ai/mem0.

Source

Thrown at mem0/configs/vector_stores/pinecone.py:38

    extra_params: Optional[Dict[str, Any]] = Field(None, description="Additional parameters for Pinecone client")
    namespace: Optional[str] = Field(None, description="Namespace for the collection")

    @model_validator(mode="before")
    @classmethod
    def check_api_key_or_client(cls, values: Dict[str, Any]) -> Dict[str, Any]:
        api_key, client = values.get("api_key"), values.get("client")
        if not api_key and not client and "PINECONE_API_KEY" not in os.environ:
            raise ValueError(
                "Either 'api_key' or 'client' must be provided, or PINECONE_API_KEY environment variable must be set."
            )
        return values

    @model_validator(mode="before")
    @classmethod
    def check_pod_or_serverless(cls, values: Dict[str, Any]) -> Dict[str, Any]:
        pod_config, serverless_config = values.get("pod_config"), values.get("serverless_config")
        if pod_config and serverless_config:
            raise ValueError(
                "Both 'pod_config' and 'serverless_config' cannot be specified. Choose one deployment option."
            )
        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)}. 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

  1. Specify only one of pod_config or serverless_config in the Pinecone config.

When it happens

Trigger: Thrown at mem0/configs/vector_stores/pinecone.py:38 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of mem0ai/mem0@001c235229 (2026-08-15). Data as JSON: /api/errors/6989c364b509bde4. Report an issue: GitHub.