Delete Memories
Deletes multiple memories based on the provided parameters. You can delete memories by specifying an identifier (user_id or agent_id) and optionally memory_ids.
If no
memory_idsare provided, all memories associated with the givenuser_idoragent_idwill be deleted.If
scopesormetadataare included, the deletion will respect these filters — only memories matching the specifiedscopesandmetadatawill be removed.When
memory_idsare provided, any IDs that do not belong to the specifieduser_idoragent_idwill be ignored; only valid and related memories will be deleted.
Parameters
memory_ids (list[str], optional) — List of memory ID.
user_id (str, optional) — User identifier for the memory.
agent_id (str, optional) — Agent identifier for the memory.
scopes (set[MemoryScope], optional) — Specifies the target for memory management, either for a specific participant or for combined access (USER or ASSISTANT). Default is [USER, ASSISTANT].
USER: Writes and retrieves memories targeting messages from user.
ASSISTANT: Writes and retrieves memories targeting messages from assistant.
USER, ASSISTANT: Writes and retrieves memories targeting messages from both the user and assistant.
metadata (dict[str, str], optional) — Extra metadata linked to the memory, which can be used to store any supplementary details or context related to it. Default is None.
Note: At least one of user_id or agent_id must be provided.
Returns
list[Chunk] — A list of deleted memory chunks. Each Chunk follows the GL SDK format and includes an id, content, metadata, and score.
Example
or
Expected Output
Last updated