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
docs - replace session_id with run_id (#4742)
szinvas789cc9d6073b
diff --git a/docs/core-concepts/memory-operations/add.mdx b/docs/core-concepts/memory-operations/add.mdxindex 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.mdxindex 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 whMem0 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 contextresults = memory.search("Any hotel preferences?",user_id="alex",- session_id="trip-planning-2025",+ run_id="trip-planning-2025",)```<Tip>- 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.</Tip>## When should you use each layer?