{"record":{"id":"ce5b63fe8dbe5563","repo":"mem0ai/mem0","slug":"invalid-memory-type-please-pass-memorytype-pro","errorCode":null,"errorMessage":"Invalid 'memory_type'. Please pass {MemoryType.PROCEDURAL.value} to create procedural memories.","messagePattern":"Invalid 'memory_type'\\. Please pass (.+?) to create procedural memories\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"mem0/memory/main.py","lineNumber":2481,"sourceCode":"            they reject top-level `user_id`/`agent_id`/`run_id` arguments. `add()` accepts them top-level, but passing\n            the same arguments to `search()`/`get_all()` raises a `ValueError`; use the `filters` form there instead.\n\n        Returns:\n            dict: A dictionary containing the result of the memory addition operation.\n        \"\"\"\n        if timestamp is not None:\n            raise ValueError(await get_temporal_feature_error_message_async(\"async\", \"add\", \"timestamp\"))\n\n        normalized_expiration_date = _normalize_expiration_date(expiration_date)\n        temporal_usage_notice = detect_temporal_usage_from_metadata(metadata)\n        processed_metadata, effective_filters = _build_filters_and_metadata(\n            user_id=user_id, agent_id=agent_id, run_id=run_id, input_metadata=metadata\n        )\n        if normalized_expiration_date is not None:\n            processed_metadata[\"expiration_date\"] = normalized_expiration_date\n\n        if memory_type is not None and memory_type != MemoryType.PROCEDURAL.value:\n            raise ValueError(\n                f\"Invalid 'memory_type'. Please pass {MemoryType.PROCEDURAL.value} to create procedural memories.\"\n            )\n\n        if isinstance(messages, str):\n            messages = [{\"role\": \"user\", \"content\": messages}]\n\n        elif isinstance(messages, dict):\n            messages = [messages]\n\n        elif not isinstance(messages, list):\n            raise Mem0ValidationError(\n                message=\"messages must be str, dict, or list[dict]\",\n                error_code=\"VALIDATION_003\",\n                details={\"provided_type\": type(messages).__name__, \"valid_types\": [\"str\", \"dict\", \"list[dict]\"]},\n                suggestion=\"Convert your input to a string, dictionary, or list of dictionaries.\"\n            )\n\n        if agent_id is not None and memory_type == MemoryType.PROCEDURAL.value:","sourceCodeStart":2463,"sourceCodeEnd":2499,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0/memory/main.py#L2463-L2499","documentation":"Error \"Invalid 'memory_type'. Please pass {MemoryType.PROCEDURAL.value} to create procedural memories.\" thrown in mem0ai/mem0.","triggerScenarios":"Thrown at mem0/memory/main.py:2481 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass memory_type=MemoryType.PROCEDURAL.value when creating procedural memories."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}