{"record":{"id":"08173f808ca3997c","repo":"mem0ai/mem0","slug":"the-timestamp-parameter-is-not-supported-by-the-os-08173f","errorCode":null,"errorMessage":"The timestamp parameter is not supported by the OSS Memory SDK.","messagePattern":"The timestamp parameter is not supported by the OSS Memory SDK\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"mem0/memory/main.py","lineNumber":818,"sourceCode":"            `search()` and `get_all()` scope queries via `filters={\"user_id\": \"...\", \"agent_id\": \"...\", \"run_id\": \"...\"}` —\n            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\n        Returns:\n            dict: A dictionary containing the result of the memory addition operation, typically\n                  including a list of memory items affected (added, updated) under a \"results\" key.\n                  Example for v1.1+: `{\"results\": [{\"id\": \"...\", \"memory\": \"...\", \"event\": \"ADD\"}]}`\n\n        Raises:\n            Mem0ValidationError: If input validation fails (invalid memory_type, messages format, etc.).\n            VectorStoreError: If vector store operations fail.\n            EmbeddingError: If embedding generation fails.\n            LLMError: If LLM operations fail.\n            DatabaseError: If database operations fail.\n        \"\"\"\n        if timestamp is not None:\n            raise ValueError(get_temporal_feature_error_message(\"sync\", \"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,\n            agent_id=agent_id,\n            run_id=run_id,\n            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 Mem0ValidationError(\n                message=f\"Invalid 'memory_type'. Please pass {MemoryType.PROCEDURAL.value} to create procedural memories.\",\n                error_code=\"VALIDATION_002\",\n                details={\"provided_type\": memory_type, \"valid_type\": MemoryType.PROCEDURAL.value},\n                suggestion=f\"Use '{MemoryType.PROCEDURAL.value}' to create procedural memories.\"","sourceCodeStart":800,"sourceCodeEnd":836,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0/memory/main.py#L800-L836","documentation":"Raised at the top of Memory.add() when the timestamp keyword is not None: temporal parameters like timestamp are hosted-platform-only and are deliberately rejected by the OSS SDK (via get_temporal_feature_error_message) rather than silently ignored. This fail-fast design prevents code that works on OSS from producing different memory timelines than intended on the platform. Any non-None value triggers it.","triggerScenarios":"m.add(messages, user_id='u1', timestamp=1771070000) or timestamp='2026-08-14T10:00:00Z' — backfilling memories with historical times; importing platform example code that includes timestamp; a wrapper that forwards **kwargs including timestamp unconditionally.","commonSituations":"Migrating platform code to self-hosted; trying to backdate memories during a data import; shared helper functions written for both clients that pass platform-only kwargs to the OSS Memory class.","solutions":["Remove the timestamp argument when using the OSS Memory class.","For historical backfills in OSS, record the original time in metadata (e.g. metadata={'occurred_at': ...}) and filter on it yourself.","If timestamp semantics are required, use the hosted MemoryClient.","Strip platform-only kwargs before forwarding: pass only messages, user_id/agent_id/run_id, metadata, expiration_date."],"exampleFix":"# before\nm.add(\"Met at conference\", user_id=\"u1\", timestamp=\"2026-01-15T09:00:00Z\")\n\n# after\nm.add(\"Met at conference\", user_id=\"u1\", metadata={\"occurred_at\": \"2026-01-15T09:00:00Z\"})","handlingStrategy":"validation","validationCode":"platform_only = {\"timestamp\", \"reference_date\"}\nkwargs = {k: v for k, v in kwargs.items() if k not in platform_only}\nm.add(messages, **kwargs)","typeGuard":"OSS_ADD_ALLOWED = {\"messages\", \"user_id\", \"agent_id\", \"run_id\", \"metadata\", \"filters\", \"prompt\", \"memory_type\", \"expiration_date\", \"infer\", \"output_format\"}\ndef is_oss_add_kwarg(k: str) -> bool:\n    return k in OSS_ADD_ALLOWED","tryCatchPattern":null,"preventionTips":["Keep separate call helpers for hosted vs OSS clients instead of sharing **kwargs forwarding.","Record historical times in metadata, not the timestamp parameter, in OSS.","Filter platform-only kwargs at your adapter boundary."],"tags":["oss-limitation","temporal","timestamp","add"],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}