aiq.memory.models#

Classes#

MemoryItem

Represents a single memory item consisting of structured content and associated metadata.

SearchMemoryInput

Represents a search memory input structure.

DeleteMemoryInput

Represents a delete memory input structure.

Module Contents#

class MemoryItem(/, **data: Any)#

Bases: pydantic.BaseModel

Represents a single memory item consisting of structured content and associated metadata.

Attributes#

conversationlist[dict[str, str]]

A list of dictionaries, each containing string key-value pairs.

user_idstr

Unique identifier for this MemoryItem’s user.

tagslist[str]

A list of strings representing tags attached to the item.

metadatadict[str, typing.Any]

Metadata providing context and utility for management operations.

memorystr or None

Optional memory string. Helpful when returning a memory.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

conversation: list[dict[str, str]] = None#
tags: list[str] = None#
metadata: dict[str, Any] = None#
user_id: str = None#
memory: str | None = None#
class SearchMemoryInput(/, **data: Any)#

Bases: pydantic.BaseModel

Represents a search memory input structure.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

query: str = None#
top_k: int = None#
user_id: str = None#
class DeleteMemoryInput(/, **data: Any)#

Bases: pydantic.BaseModel

Represents a delete memory input structure.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

user_id: str = None#