From 789cc9d6073b9801f812fef8f01357b0455c35b5 Mon Sep 17 00:00:00 2001 From: szinvas <38113937+SZemse@users.noreply.github.com> Date: Fri, 10 Apr 2026 10:36:59 -0400 Subject: [PATCH] docs - replace session_id with run_id (#4742) --- docs/core-concepts/memory-operations/add.mdx | 2 +- docs/core-concepts/memory-types.mdx | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/core-concepts/memory-operations/add.mdx b/docs/core-concepts/memory-operations/add.mdx index 0dcfcad32..6b2c9deeb 100644 --- a/docs/core-concepts/memory-operations/add.mdx +++ b/docs/core-concepts/memory-operations/add.mdx @@ -21,7 +21,7 @@ Adding memory is how Mem0 captures useful details from a conversation so your ag - **Messages** – The ordered list of user/assistant turns you send to `add`. - **Infer** – Controls whether Mem0 extracts structured memories (`infer=True`, default) or stores raw messages. - **Metadata** – Optional filters (e.g., `{"category": "movie_recommendations"}`) that improve retrieval later. -- **User / Session identifiers** – `user_id`, `session_id`, or `run_id` that scope the memory for future searches. +- **User / Session identifiers** – `user_id`, `agent_id`, or `run_id` that scope the memory for future searches. ## How does it work? diff --git a/docs/core-concepts/memory-types.mdx b/docs/core-concepts/memory-types.mdx index a3fb5eb6a..8ab425eae 100644 --- a/docs/core-concepts/memory-types.mdx +++ b/docs/core-concepts/memory-types.mdx @@ -52,7 +52,7 @@ Mem0 maps these classic categories onto its layered storage so you can decide wh Mem0 stores each layer separately and merges them when you query: 1. **Capture** – Messages enter the conversation layer while the turn is active. -2. **Promote** – Relevant details persist to session or user memory based on your `user_id`, `session_id`, and metadata. +2. **Promote** – Relevant details persist to session or user memory based on your `user_id`, `run_id`, and metadata. 3. **Retrieve** – The search pipeline pulls from all layers, ranking user memories first, then session notes, then raw history. ```python @@ -66,19 +66,19 @@ memory = Memory(api_key=os.environ["MEM0_API_KEY"]) memory.add( ["I'm Alex and I prefer boutique hotels."], user_id="alex", - session_id="trip-planning-2025", + run_id="trip-planning-2025", ) # Later in the session, pull long-term + session context results = memory.search( "Any hotel preferences?", user_id="alex", - session_id="trip-planning-2025", + run_id="trip-planning-2025", ) ``` - Use `session_id` when you want short-term context to expire automatically; rely on `user_id` for lasting personalization. + Use `run_id` when you want short-term context to expire automatically; rely on `user_id` for lasting personalization. ## When should you use each layer?