memories
Classes
MemoriesClient
MemoriesClient(client: OWUIClientBase)
Bases: ResourceBase
Client for the Memories endpoints.
- Code Reference client Classes OpenWebUI Attributes memories
Source code in src/owui_client/client_base.py
Functions
get_memories
get_memories() -> List[MemoryModel]
Retrieve all memories associated with the authenticated user.
Returns:
| Type | Description |
|---|---|
List[MemoryModel]
|
List[MemoryModel]: A list of the user's memories. |
Source code in src/owui_client/routers/memories.py
add_memory
add_memory(
form_data: AddMemoryForm,
) -> Optional[MemoryModel]
Create a new memory for the authenticated user and add it to the vector database.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
form_data
|
AddMemoryForm
|
The content of the memory to create. |
required |
Returns:
| Type | Description |
|---|---|
Optional[MemoryModel]
|
Optional[MemoryModel]: The created memory object, or None if creation failed. |
Source code in src/owui_client/routers/memories.py
query_memory
query_memory(form_data: QueryMemoryForm) -> Any
Search for memories using vector similarity search.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
form_data
|
QueryMemoryForm
|
The query parameters, including the search text and limit (k). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Any |
Any
|
The search results from the vector database. |
Source code in src/owui_client/routers/memories.py
reset_memory_from_vector_db
Reset the vector database collection for the user's memories.
This deletes the existing collection and regenerates embeddings for all current memories.
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if the reset was successful. |
Source code in src/owui_client/routers/memories.py
delete_memory_by_user_id
Delete all memories for the authenticated user.
This removes all memories from both the primary database and the vector database.
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if the deletion was successful. |
Source code in src/owui_client/routers/memories.py
update_memory_by_id
update_memory_by_id(
memory_id: str, form_data: MemoryUpdateModel
) -> Optional[MemoryModel]
Update a specific memory by its ID.
Updates the content in both the primary database and the vector database.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
memory_id
|
str
|
The unique identifier of the memory to update. |
required |
form_data
|
MemoryUpdateModel
|
The data to update (e.g., new content). |
required |
Returns:
| Type | Description |
|---|---|
Optional[MemoryModel]
|
Optional[MemoryModel]: The updated memory object, or None if the memory was not found. |
Source code in src/owui_client/routers/memories.py
delete_memory_by_id
Delete a specific memory by its ID.
Removes the memory from both the primary database and the vector database.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
memory_id
|
str
|
The unique identifier of the memory to delete. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if the deletion was successful. |
Source code in src/owui_client/routers/memories.py
get_embeddings
Test the embedding function.
Generates an embedding for the text "hello world" to verify the embedding function is working.
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
A dictionary containing the embedding result. |