The Memory Layer for AI Agents - Drop-in memory infrastructure for AI agents and apps. Context that persists. Built for production.
Python agentic-memoryagentic-memory-systemagentsaiai-agentschatgptgenaillmlong-term-memorymemorymemory-managementpythonragstate-management
chore: update user facing timestamp for a memory (#4066)
Mragank Shekhara14082939558
diff --git a/docs/changelog.mdx b/docs/changelog.mdxindex 7146a61c9..1568c4935 100644--- a/docs/changelog.mdx+++ b/docs/changelog.mdx@@ -7,6 +7,14 @@ mode: "wide"<Tabs><Tab title="Python">+<Update label="2026-02-17" description="v1.0.4">++**New Features & Updates:**+- **Memory Update:**+ - Added `timestamp` parameter to `update()` — accepts Unix epoch (int/float) or ISO 8601 string++</Update>+<Update label="2026-01-29" description="v1.0.3">**New Features & Updates:**@@ -716,6 +724,14 @@ mode: "wide"<Tab title="TypeScript">+<Update label="2026-02-17" description="v2.2.3">++**New Features & Updates:**+- **Memory Update:**+ - Added `timestamp` parameter to `update()` — accepts Unix epoch or ISO 8601 string++</Update>+<Update label="2026-01-29" description="v2.2.2">**New Features & Updates:**diff --git a/docs/core-concepts/memory-operations/update.mdx b/docs/core-concepts/memory-operations/update.mdxindex b53b6b562..51ea3c8e1 100644--- a/docs/core-concepts/memory-operations/update.mdx+++ b/docs/core-concepts/memory-operations/update.mdx@@ -21,6 +21,7 @@ Mem0’s update operation lets you fix or enrich an existing memory without dele- **memory_id** – Unique identifier returned by `add` or `search` results.- **text** / **data** – New content that replaces the stored memory value.- **metadata** – Optional key-value pairs you update alongside the text.+- **timestamp** – Unix epoch (int/float) or ISO 8601 string to override the memory's timestamp.- **batch_update** – Platform API that edits multiple memories in a single request.- **immutable** – Flagged memories that must be deleted and re-added instead of updated.@@ -50,7 +51,8 @@ memory_id = "your_memory_id"client.update(memory_id=memory_id,text="Updated memory content about the user",- metadata={"category": "profile-update"}+ metadata={"category": "profile-update"},+ timestamp="2025-01-15T12:00:00Z")```@@ -62,7 +64,8 @@ const memory_id = "your_memory_id";await client.update(memory_id, {text: "Updated memory content about the user",- metadata: { category: "profile-update" }+ metadata: { category: "profile-update" },+ timestamp: "2025-01-15T12:00:00Z"});```</CodeGroup>diff --git a/mem0-ts/package.json b/mem0-ts/package.jsonindex bee822f0b..7075ec765 100644--- a/mem0-ts/package.json+++ b/mem0-ts/package.json@@ -1,6 +1,6 @@{"name": "mem0ai",- "version": "2.2.2",+ "version": "2.2.3","description": "The Memory Layer For Your AI Apps","main": "./dist/index.js","module": "./dist/index.mjs",diff --git a/mem0-ts/src/client/mem0.ts b/mem0-ts/src/client/mem0.tsindex a57e3b0c5..1cd5a5aa4 100644--- a/mem0-ts/src/client/mem0.ts+++ b/mem0-ts/src/client/mem0.ts@@ -253,18 +253,32 @@ export default class MemoryClient {async update(memoryId: string,- { text, metadata }: { text?: string; metadata?: Record<string, any> },+ {+ text,+ metadata,+ timestamp,+ }: {+ text?: string;+ metadata?: Record<string, any>;+ timestamp?: number | string;+ },): Promise<Array<Memory>> {- if (text === undefined && metadata === undefined) {- throw new Error("Either text or metadata must be provided for update.");+ if (+ text === undefined &&+ metadata === undefined &&+ timestamp === undefined+ ) {+ throw new Error(+ "At least one of text, metadata, or timestamp must be provided for update.",+ );}if (this.telemetryId === "") await this.ping();this._validateOrgProject();- const payload = {- text: text,- metadata: metadata,- };+ const payload: Record<string, any> = {};+ if (text !== undefined) payload.text = text;+ if (metadata !== undefined) payload.metadata = metadata;+ if (timestamp !== undefined) payload.timestamp = timestamp;const payloadKeys = Object.keys(payload);this._captureEvent("update", [payloadKeys]);diff --git a/mem0/client/main.py b/mem0/client/main.pyindex f2869cd13..6f9304717 100644--- a/mem0/client/main.py+++ b/mem0/client/main.py@@ -2,7 +2,7 @@ import hashlibimport loggingimport osimport warnings-from typing import Any, Dict, List, Optional+from typing import Any, Dict, List, Optional, Unionimport httpximport requests@@ -300,29 +300,34 @@ class MemoryClient:memory_id: str,text: Optional[str] = None,metadata: Optional[Dict[str, Any]] = None,+ timestamp: Optional[Union[int, float, str]] = None,) -> Dict[str, Any]:"""Update a memory by ID.-+Args:memory_id (str): Memory ID.text (str, optional): New content to update the memory with.metadata (dict, optional): Metadata to update in the memory.-+ timestamp (int, float, or str, optional): Unix epoch timestamp or ISO 8601 string.+Returns:Dict[str, Any]: The response from the server.-+Example:>>> client.update(memory_id="mem_123", text="Likes to play tennis on weekends")+ >>> client.update(memory_id="mem_123", timestamp="2025-01-15T12:00:00Z")"""- if text is None and metadata is None:- raise ValueError("Either text or metadata must be provided for update.")+ if text is None and metadata is None and timestamp is None:+ raise ValueError("At least one of text, metadata, or timestamp must be provided for update.")payload = {}if text is not None:payload["text"] = textif metadata is not None:payload["metadata"] = metadata+ if timestamp is not None:+ payload["timestamp"] = timestampcapture_client_event("client.update", self, {"memory_id": memory_id, "sync_type": "sync"})params = self._prepare_params()@@ -1196,30 +1201,38 @@ class AsyncMemoryClient:@api_error_handlerasync def update(- self, memory_id: str, text: Optional[str] = None, metadata: Optional[Dict[str, Any]] = None+ self,+ memory_id: str,+ text: Optional[str] = None,+ metadata: Optional[Dict[str, Any]] = None,+ timestamp: Optional[Union[int, float, str]] = None,) -> Dict[str, Any]:"""Update a memory by ID asynchronously.-+Args:memory_id (str): Memory ID.text (str, optional): New content to update the memory with.metadata (dict, optional): Metadata to update in the memory.-+ timestamp (int, float, or str, optional): Unix epoch timestamp or ISO 8601 string.+Returns:Dict[str, Any]: The response from the server.-+Example:>>> await client.update(memory_id="mem_123", text="Likes to play tennis on weekends")+ >>> await client.update(memory_id="mem_123", timestamp="2025-01-15T12:00:00Z")"""- if text is None and metadata is None:- raise ValueError("Either text or metadata must be provided for update.")+ if text is None and metadata is None and timestamp is None:+ raise ValueError("At least one of text, metadata, or timestamp must be provided for update.")payload = {}if text is not None:payload["text"] = textif metadata is not None:payload["metadata"] = metadata+ if timestamp is not None:+ payload["timestamp"] = timestampcapture_client_event("client.update", self, {"memory_id": memory_id, "sync_type": "async"})params = self._prepare_params()diff --git a/pyproject.toml b/pyproject.tomlindex 279c81c4d..1915c4989 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -4,7 +4,7 @@ build-backend = "hatchling.build"[project]name = "mem0ai"-version = "1.0.3"+version = "1.0.4"description = "Long-term memory for AI Agents"authors = [{ name = "Mem0", email = "[email protected]" }