Skip to content

armgit / mem0

Public Imported from GitHub
0

The Memory Layer for AI Agents - Drop-in memory infrastructure for AI agents and apps. Context that persists. Built for production.

docs(memory): note filters-based scoping for search/get_all on add() (#6758)

Diwakar Ray Yadavb05dc2740f9f
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.
"""