{"record":{"id":"b0750af40b6bb4b1","repo":"mem0ai/mem0","slug":"the-parameter-use-compression-is-no-longer-suppo","errorCode":null,"errorMessage":"The parameter 'use_compression' is no longer supported. Please use 'compression_type=\"scalar\"' instead of 'use_compression=True' or 'compression_type=None' instead of 'use_compression=False'.","messagePattern":"The parameter 'use_compression' is no longer supported\\. Please use 'compression_type=\"scalar\"' instead of 'use_compression=True' or 'compression_type=None' instead of 'use_compression=False'\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"mem0/configs/vector_stores/azure_ai_search.py","lineNumber":34,"sourceCode":"        description=\"Whether to store vectors in half precision (Edm.Half) instead of full precision (Edm.Single)\",\n    )\n    hybrid_search: bool = Field(\n        False, description=\"Whether to use hybrid search. If True, vector_filter_mode must be 'preFilter'\"\n    )\n    vector_filter_mode: Optional[str] = Field(\n        \"preFilter\", description=\"Mode for vector filtering. Options: 'preFilter', 'postFilter'\"\n    )\n\n    @model_validator(mode=\"before\")\n    @classmethod\n    def validate_extra_fields(cls, values: Dict[str, Any]) -> Dict[str, Any]:\n        allowed_fields = set(cls.model_fields.keys())\n        input_fields = set(values.keys())\n        extra_fields = input_fields - allowed_fields\n\n        # Check for use_compression to provide a helpful error\n        if \"use_compression\" in extra_fields:\n            raise ValueError(\n                \"The parameter 'use_compression' is no longer supported. \"\n                \"Please use 'compression_type=\\\"scalar\\\"' instead of 'use_compression=True' \"\n                \"or 'compression_type=None' instead of 'use_compression=False'.\"\n            )\n\n        if extra_fields:\n            raise ValueError(\n                f\"Extra fields not allowed: {', '.join(extra_fields)}. \"\n                f\"Please input only the following fields: {', '.join(allowed_fields)}\"\n            )\n\n        # Validate compression_type values\n        if \"compression_type\" in values and values[\"compression_type\"] is not None:\n            valid_types = [\"scalar\", \"binary\"]\n            if values[\"compression_type\"].lower() not in valid_types:\n                raise ValueError(\n                    f\"Invalid compression_type: {values['compression_type']}. \"\n                    f\"Must be one of: {', '.join(valid_types)}, or None\"","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0/configs/vector_stores/azure_ai_search.py#L16-L52","documentation":"The Azure AI Search vector store config rejects the legacy use_compression boolean, which was replaced by a compression_type field ('scalar', 'binary', or None). A dedicated branch in the model_validator(mode='before') detects use_compression among the extra fields and raises a ValueError with explicit migration instructions.","triggerScenarios":"Configuring the azure_ai_search vector store with use_compression=True or use_compression=False in the vector_store.provider.config dict (self-hosted Memory). Any presence of the key triggers it, even with the new compression_type also set.","commonSituations":"Upgrading mem0ai from an older release where use_compression was valid; copy-pasted YAML/JSON configs from old examples or blog posts; env-var-driven config templates that still include the flag.","solutions":["Replace use_compression=True with compression_type=\"scalar\"","Replace use_compression=False with compression_type=None (or omit the key)","Grep your config files and env templates for 'use_compression' after upgrading mem0ai"],"exampleFix":"# before\nvector_store={\n    \"provider\": \"azure_ai_search\",\n    \"config\": {\"service_name\": S, \"api_key\": K, \"use_compression\": True},\n}\n\n# after\nvector_store={\n    \"provider\": \"azure_ai_search\",\n    \"config\": {\"service_name\": S, \"api_key\": K, \"compression_type\": \"scalar\"},\n}","handlingStrategy":"validation","validationCode":"cfg = {\"service_name\": S, \"api_key\": K}\nif legacy_config.get(\"use_compression\"):\n    cfg[\"compression_type\"] = \"scalar\"\ndel legacy_config[\"use_compression\"]","typeGuard":"def config_is_migrated(cfg: dict) -> bool:\n    return \"use_compression\" not in cfg","tryCatchPattern":"try:\n    Memory.from_config(config)\nexcept ValueError as e:\n    if \"use_compression\" in str(e):\n        raise ConfigError(\"run the use_compression -> compression_type migration\") from e\n    raise","preventionTips":["After upgrading mem0ai, grep configs and env templates for removed keys","Pin the mem0ai version in deployments and read release notes before bumping"],"tags":["configuration","azure-ai-search","vector-store","migration","deprecation"],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}