{"record":{"id":"1adf4bc1da859fa3","repo":"mem0ai/mem0","slug":"the-reference-date-parameter-is-not-supported-by-t","errorCode":null,"errorMessage":"The reference_date parameter is not supported by the OSS Memory SDK.","messagePattern":"The reference_date parameter is not supported by the OSS Memory SDK\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"mem0/memory/main.py","lineNumber":1433,"sourceCode":"                - {\"AND\": [filter1, filter2]} - logical AND\n                - {\"OR\": [filter1, filter2]} - logical OR\n                - {\"NOT\": [filter1]} - logical NOT\n            threshold (float, optional): Minimum score for a memory to be included. Defaults to 0.1.\n            rerank (bool, optional): Whether to rerank results. Defaults to False.\n            explain (bool, optional): Whether to include score_details for each result. Defaults to False.\n            reference_date (Any, optional): Platform-only temporal parameter. Not supported in OSS.\n            show_expired (bool, optional): Include expired memories. Defaults to False.\n\n        Returns:\n            dict: A dictionary containing the search results under a \"results\" key.\n                  Example for v1.1+: `{\"results\": [{\"id\": \"...\", \"memory\": \"...\", \"score\": 0.8, ...}]}`\n\n        Raises:\n            ValueError: If filters doesn't contain at least one of user_id, agent_id, run_id,\n                or if threshold/top_k values are invalid.\n        \"\"\"\n        if reference_date is not None:\n            raise ValueError(get_temporal_feature_error_message(\"sync\", \"search\", \"reference_date\"))\n\n        # Reject top-level entity params - must use filters instead\n        _reject_top_level_entity_params(kwargs, \"search\")\n\n        # Validate search parameters (before applying defaults)\n        _validate_search_params(threshold=threshold, top_k=top_k)\n        query = _validate_and_trim_search_query(query)\n        temporal_usage_notice = detect_temporal_usage_from_search(query, filters)\n\n        # Validate and trim entity IDs in filters\n        effective_filters = filters.copy() if filters else {}\n        if \"user_id\" in effective_filters:\n            effective_filters[\"user_id\"] = _validate_and_trim_entity_id(\n                effective_filters[\"user_id\"], \"user_id\"\n            )\n        if \"agent_id\" in effective_filters:\n            effective_filters[\"agent_id\"] = _validate_and_trim_entity_id(\n                effective_filters[\"agent_id\"], \"agent_id\"","sourceCodeStart":1415,"sourceCodeEnd":1451,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0/memory/main.py#L1415-L1451","documentation":"Raised at the top of Memory.search() when reference_date is not None: like timestamp on add(), reference_date is a hosted-platform temporal feature (evaluating memories relative to a point in time) that the OSS SDK rejects explicitly rather than ignoring. The error text comes from get_temporal_feature_error_message and names the offending parameter so you can find it fast.","triggerScenarios":"m.search(query, filters={'user_id':'u1'}, reference_date='2026-01-01'); shared search wrappers that forward **kwargs including platform-only params; copying platform SDK examples for time-travel queries into an OSS deployment.","commonSituations":"Code shared between hosted and self-hosted deployments; platform-to-OSS migrations; agents whose tool schema includes reference_date from platform docs.","solutions":["Remove reference_date from the call when using the OSS Memory class.","Store temporal anchors in metadata at add() time and post-filter results yourself.","Use the hosted MemoryClient if reference_date semantics are required.","Filter kwargs to the OSS-supported set (query, filters, threshold, top_k, show_expired) before forwarding."],"exampleFix":"# before\nm.search(\"projects\", filters={\"user_id\": \"u1\"}, reference_date=\"2026-01-01\")\n\n# after\nresults = m.search(\"projects\", filters={\"user_id\": \"u1\"})\nresults = [r for r in results[\"results\"] if r[\"metadata\"].get(\"as_of\", \"\") <= \"2026-01-01\"]","handlingStrategy":"validation","validationCode":"platform_only = {\"reference_date\", \"timestamp\"}\nkwargs = {k: v for k, v in kwargs.items() if k not in platform_only}\nresults = m.search(query, **kwargs)","typeGuard":"OSS_SEARCH_ALLOWED = {\"query\", \"filters\", \"threshold\", \"top_k\", \"show_expired\"}\ndef is_oss_search_kwarg(k: str) -> bool:\n    return k in OSS_SEARCH_ALLOWED","tryCatchPattern":null,"preventionTips":["Keep separate wrappers for OSS Memory vs hosted MemoryClient; do not forward shared **kwargs.","Store time anchors in metadata and post-filter results yourself in OSS.","Strip platform-only kwargs at the adapter boundary."],"tags":["oss-limitation","temporal","search","reference-date"],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}