Skip to content

memory_collection_dao

Memory collection data access object (DAO)

Attributes

Classes

MemoryCollectionDao

MemoryCollectionDao(session: Session)

Bases: BaseDao

Memory collection data access object (DAO)

Attributes

model_class property
model_class: Type[MemoryCollection]

Functions

get_by_name
get_by_name(
    name: str,
    filter_deleted: bool = True,
    filter_disabled: bool = True,
) -> Optional[MemoryCollection]
get_by_namespace_pkid
get_by_namespace_pkid(
    namespace_pkid: str,
    include_deleted: bool = False,
    include_disabled: bool = False,
) -> List[MemoryCollection]

Retrieve a list of MemoryCollection objects filtered by namespace primary key ID.

Parameters:

  • namespace_pkid (str) –

    The primary key ID of the namespace to filter by.

  • filter_deleted (bool) –

    If True, exclude collections marked as deleted. Defaults to True.

  • filter_disabled (bool) –

    If True, exclude collections marked as disabled. Defaults to True.

Returns: List[MemoryCollection]: A list of MemoryCollection objects that match the specified filters.

get_in_namespace
get_in_namespace(
    *,
    namespace_key: str,
    resource_key: str,
    include_deleted: bool = True,
    include_disabled: bool = True
) -> MemoryCollection | None

Retrieve an MemoryCollection in a specified namespace by its primary key ID or name.

Parameters:

  • namespace_key (str) –

    The primary key ID of the namespace.

  • resource_key (str) –

    The primary key ID or name of the memory collection.

  • filter_deleted (bool) –

    Whether to filter out deleted activity sessions. Defaults to True.

  • filter_disabled (bool) –

    Whether to filter out disabled activity sessions. Defaults to True.

Returns:

  • MemoryCollection | None

    MemoryCollection | None: The matching MemoryCollection or None if not found.

hard_delete_by_pkid
hard_delete_by_pkid(pkid: str) -> int

Hard delete a memory collection by its primary key identifier.

Parameters:

  • pkid (str) –

    Memory collection primary key identifier

Returns:

  • int ( int ) –

    Number of rows deleted