From b05dc2740f9f7696d94ea06c3e04c64aac55997b Mon Sep 17 00:00:00 2001 From: Diwakar Ray Yadav Date: Fri, 7 Aug 2026 14:18:09 +0545 Subject: [PATCH] docs(memory): note filters-based scoping for search/get_all on add() (#6758) --- mem0/memory/main.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mem0/memory/main.py b/mem0/memory/main.py index 1e0fc0c44..2a7b1b52d 100644 --- a/mem0/memory/main.py +++ b/mem0/memory/main.py @@ -791,6 +791,11 @@ class Memory(MemoryBase): are treated as general conversational/factual memories. prompt (str, optional): Prompt to use for the memory creation. Defaults to None. + Note: + `search()` and `get_all()` scope queries via `filters={"user_id": "...", "agent_id": "...", "run_id": "..."}` — + they reject top-level `user_id`/`agent_id`/`run_id` arguments. `add()` accepts them top-level, but passing + the same arguments to `search()`/`get_all()` raises a `ValueError`; use the `filters` form there instead. + Returns: dict: A dictionary containing the result of the memory addition operation, typically @@ -2447,6 +2452,12 @@ class AsyncMemory(MemoryBase): Pass "procedural_memory" to create procedural memories. prompt (str, optional): Prompt to use for the memory creation. Defaults to None. llm (BaseChatModel, optional): LLM class to use for generating procedural memories. Defaults to None. Useful when user is using LangChain ChatModel. + + Note: + `search()` and `get_all()` scope queries via `filters={"user_id": "...", "agent_id": "...", "run_id": "..."}` — + they reject top-level `user_id`/`agent_id`/`run_id` arguments. `add()` accepts them top-level, but passing + the same arguments to `search()`/`get_all()` raises a `ValueError`; use the `filters` form there instead. + Returns: dict: A dictionary containing the result of the memory addition operation. """