Skip to content

Commit a285a39

Browse files
committed
refac
1 parent 75df948 commit a285a39

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

backend/open_webui/tools/builtin.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ async def search_memories(
606606
:param query: Optional query to search memory content and path
607607
:param count: Number of memories to return (default 5)
608608
:param type: "user", "context", or "all"
609-
:param path: Optional logical memory path prefix
609+
:param path: Optional memory path prefix
610610
:param memory_id: Optional exact memory ID to read
611611
:return: JSON with matching memories and their dates
612612
"""
@@ -661,7 +661,7 @@ async def add_memory(
661661
662662
:param content: The memory content to store
663663
:param type: Use "user" for facts/preferences about the user, or "context" for other durable context
664-
:param path: Optional logical memory path
664+
:param path: Optional memory path
665665
:return: Confirmation that the memory was stored
666666
"""
667667
if __request__ is None:
@@ -695,6 +695,7 @@ async def update_memory(
695695
696696
Use type "user" for facts, preferences, or instructions about the user.
697697
Use type "context" for other durable context that may help future chats.
698+
Use path when there is a clear path for the memory. Leave path empty when unsure.
698699
699700
Operation shapes:
700701
- {"action": "add", "content": "...", "type": "user"|"context", "path": "..."}
@@ -735,7 +736,7 @@ async def replace_memory_content(
735736
:param memory_id: The ID of the memory to update
736737
:param content: The new content for the memory
737738
:param type: Optional "user" or "context" type for the updated memory
738-
:param path: Optional logical memory path
739+
:param path: Optional memory path
739740
:return: Confirmation that the memory was updated
740741
"""
741742
if __request__ is None:

backend/open_webui/utils/memory.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,8 @@ async def _generate_memory_operations(
313313
Rules:
314314
- Save only information likely to matter in future chats.
315315
- Do not save secrets, credentials, transient task steps, or unsupported guesses.
316+
- Use path when there is a clear path for the memory.
317+
- Leave path empty when there is no clear place for the memory.
316318
- Prefer replace/move/remove over duplicate add when an existing memory should change.
317319
- Do not invent type, status, trait, score, importance, or stability schemas.
318320
- Return only JSON in this shape:

0 commit comments

Comments
 (0)