{"record":{"id":"faf87ea582d180eb","repo":"mem0ai/mem0","slug":"the-decay-parameter-is-not-supported-by-the-oss-me-faf87e","errorCode":null,"errorMessage":"The decay parameter is not supported by the OSS Memory SDK.","messagePattern":"The decay parameter is not supported by the OSS Memory SDK\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"mem0/memory/main.py","lineNumber":470,"sourceCode":"\n\nsetup_config()\nlogger = logging.getLogger(__name__)\n\n_UNSET = object()\n_PROJECT_UPDATE_UNSUPPORTED_ERROR = \"Project updates are not supported by the OSS Memory SDK.\"\n\n\nclass _OSSProject:\n    def update(\n        self,\n        custom_instructions: Optional[str] = None,\n        custom_categories: Optional[list] = None,\n        multilingual: Optional[bool] = None,\n        decay: Optional[bool] = None,\n    ):\n        if decay is True:\n            raise ValueError(get_decay_feature_error_message(\"sync\", \"project.update\", \"decay\"))\n        raise ValueError(_PROJECT_UPDATE_UNSUPPORTED_ERROR)\n\n\nclass _AsyncOSSProject:\n    async def update(\n        self,\n        custom_instructions: Optional[str] = None,\n        custom_categories: Optional[list] = None,\n        multilingual: Optional[bool] = None,\n        decay: Optional[bool] = None,\n    ):\n        if decay is True:\n            raise ValueError(await get_decay_feature_error_message_async(\"async\", \"project.update\", \"decay\"))\n        raise ValueError(_PROJECT_UPDATE_UNSUPPORTED_ERROR)\n\n\nclass Memory(MemoryBase):\n    def __init__(self, config: MemoryConfig = MemoryConfig()):","sourceCodeStart":452,"sourceCodeEnd":488,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0/memory/main.py#L452-L488","documentation":"Raised by the sync _OSSProject.update stub: the OSS (self-hosted) Memory SDK does not implement platform project settings, and while any call to update() is unsupported, passing decay=True gets this dedicated ValueError first (via get_decay_feature_error_message) so developers copying platform-client code get a pointed message instead of the generic one. 'decay' (automatic memory decay) is a hosted-platform feature only.","triggerScenarios":"Calling m.project.update(decay=True) on a Memory instance created with from mem0 import Memory; copy-pasting MemoryClient (hosted) example code into an OSS deployment; enabling decay via project config programmatically.","commonSituations":"Migrating from the hosted mem0 platform to the self-hosted SDK and reusing platform snippets; following docs for the wrong product tier; AI assistants generating platform-flavored code against the OSS package.","solutions":["Remove the decay argument; it is a hosted-platform-only feature.","If you need decay-like behavior in OSS, schedule your own cleanup that deletes old memories using expiration_date at add() time and filtering expired items on read.","Switch to the hosted platform client (from mem0 import MemoryClient) if project-level decay is a hard requirement.","Do not call project.update() at all in OSS — every variant raises."],"exampleFix":"# before\nm.project.update(custom_instructions=\"...\", decay=True)\n\n# after\nm.project.update(custom_instructions=\"...\")  # any OSS call still unsupported; drop project.update entirely and configure via MemoryConfig","handlingStrategy":"type-guard","validationCode":"if \"decay\" in project_kwargs:\n    raise ValueError(\"decay is platform-only; not available in the OSS SDK\")","typeGuard":"def is_oss_supported_project_kwarg(k: str) -> bool:\n    return k not in {\"decay\"}","tryCatchPattern":null,"preventionTips":["Do not call project.update() in OSS code at all — every path raises.","Keep a set of platform-only kwargs and strip them before calling OSS methods.","Pin your docs to the OSS package version you actually use."],"tags":["oss-limitation","decay","project","platform-parity"],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}