From 80af65c24adac5140a39a2b5687a3b669b86719f Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Wed, 1 Jul 2026 03:35:46 -0500 Subject: [PATCH] refac --- backend/open_webui/tools/builtin.py | 10 ++++++++-- backend/open_webui/utils/memory.py | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/backend/open_webui/tools/builtin.py b/backend/open_webui/tools/builtin.py index 6193c10c53..f6631691d3 100644 --- a/backend/open_webui/tools/builtin.py +++ b/backend/open_webui/tools/builtin.py @@ -726,7 +726,11 @@ async def add_memory( __user__: dict = None, ) -> str: """ - Save a user-provided preference, fact, or instruction as memory for future chats. + Save enduring information that can improve future chats. + + Save stable preferences, goals, projects, relationships, habits, and standing instructions. + Do not save one-off activity, meals, routine daily events, temporary mood, or other short-lived details + unless the user explicitly asks you to remember them. :param content: The memory content to store :param type: Use "user" for facts/preferences about the user, or "context" for other durable context @@ -760,10 +764,12 @@ async def update_memory( __user__: dict = None, ) -> str: """ - Apply a batch of memory changes after learning durable information. + Apply a batch of memory changes after learning enduring information. Use type "user" for facts, preferences, or instructions about the user. Use type "context" for other durable context that may help future chats. + Do not save one-off activity, meals, routine daily events, temporary mood, or other short-lived details + unless the user explicitly asks you to remember them. Path is optional. Use it as a stable memory address to group related memories. Prefer an existing path from list_memory_paths when one fits. Leave path empty when no useful grouping is clear. diff --git a/backend/open_webui/utils/memory.py b/backend/open_webui/utils/memory.py index 78d58f950e..5cec5153ff 100644 --- a/backend/open_webui/utils/memory.py +++ b/backend/open_webui/utils/memory.py @@ -535,7 +535,8 @@ Memory types: - context: other durable context that may help future chats for this user account. Rules: -- Save only information likely to matter in future chats. +- Save enduring details that can improve future conversations. +- Do not save one-off activity, meals, temporary mood, routine daily events, or other short-lived details unless the user explicitly asks to remember them. - Do not save secrets, credentials, transient task steps, or unsupported guesses. - Use path when there is a clear path for the memory. - Leave path empty when there is no clear place for the memory.