Skip to content

types

Type objects for cognitive service

Attributes

Classes

AddMemoryRequest

Bases: BaseDataModel

Add memory request object

Attributes

agent_pkid class-attribute instance-attribute
agent_pkid: str = Field(
    ...,
    title="Agent PKID",
    description="Primary key of the owning Agent",
)
child_memory_pkids class-attribute instance-attribute
child_memory_pkids: List[str] = Field(
    default_factory=list,
    title="Child Memory PKIDs",
    description="List of child memory PKIDs for integrated memories only",
)
collection_pkid class-attribute instance-attribute
collection_pkid: str = Field(
    ...,
    title="Collection PKID",
    description="Primary key of the owning Collection",
)
importance_score class-attribute instance-attribute
importance_score: int = Field(
    default=5,
    title="Importance Score",
    description="Importance score of the memory as determined by the agent. Derived via LLM call.",
)
memo class-attribute instance-attribute
memo: str | None = Field(
    default=None,
    title="Memo",
    description="Optional memo for the memory",
)
memory_txt class-attribute instance-attribute
memory_txt: str = Field(
    ...,
    title="Memory Text",
    description="Text / content of the memory",
)
memory_type class-attribute instance-attribute
memory_type: MemoryType = Field(
    ..., title="Memory Type", description="Type of memory"
)
session_pkid class-attribute instance-attribute
session_pkid: str = Field(
    ...,
    title="Session PKID",
    description="Primary key of the owning Session",
)
vector_txt class-attribute instance-attribute
vector_txt: str | None = Field(
    default=None,
    title="Vector Text",
    description="When not None, this is vectorized instead of memory_txt to optimize lookups. Derived via LLM call.",
)

GetMemoriesResponse

Bases: BaseDataModel

Get memories response object

Attributes

all_memories class-attribute instance-attribute
all_memories: List[RetrievedMemory] = Field(
    default_factory=list,
    title="All Memories",
    description="List of all retrieved memories prior to filtering.",
)
collection_summary class-attribute instance-attribute
collection_summary: List[
    Dict[str, Dict[str, Union[float, int, List[float]]]]
] = Field(
    default_factory=list,
    title="Collection Summary",
    description="Descriptive statistics by collection on filtered_memories. The intended use case is to provide quantitative insights into how each memory collection contributed to the recalled memories. Collections are ranked in descending order by count.",
)
context class-attribute instance-attribute
context: str = Field(
    ...,
    title="Context",
    description="Input context used for recall",
)
context_chunks class-attribute instance-attribute
context_chunks: List[str] = Field(
    default_factory=list,
    title="Context Chunks",
    description="Context refers to the input used to lookup memory vectors. Large contexts that exceed the maximum size of the vector embedding need to be split into chunks before a lookup can be performed.",
)
filtered_memories class-attribute instance-attribute
filtered_memories: List[RetrievedMemory] = Field(
    default_factory=list,
    title="Filtered Memories",
    description="List of retrieved memories after filtering operations were performed. This is the list of memories that were used to derive the actual recalled memories",
)
importance_alpha class-attribute instance-attribute
importance_alpha: float = Field(
    ...,
    le=1.0,
    ge=0.0,
    title="Importance Alpha",
    description="Importance alpha",
)
max_memories class-attribute instance-attribute
max_memories: int = Field(
    ...,
    gt=0,
    title="Max Memories",
    description="Max memories to recall",
)
max_memory_strategy class-attribute instance-attribute
max_memory_strategy: str = Field(
    ...,
    title="Max Memory Strategy",
    description="Max memory strategy used for recall operation",
)
min_score class-attribute instance-attribute
min_score: float = Field(
    ...,
    le=1.0,
    gt=0.0,
    title="Minimum Score",
    description="Minimum score needed to be considered for recall",
)
recalled_memories class-attribute instance-attribute
recalled_memories: List[str] = Field(
    default_factory=list,
    title="Recalled Memories",
    description="List of recalled memories, derived from filtered_memories",
)
recency_alpha class-attribute instance-attribute
recency_alpha: float = Field(
    ...,
    le=1.0,
    ge=0.0,
    title="Recency Alpha",
    description="Recency alpha",
)
relevance_alpha class-attribute instance-attribute
relevance_alpha: float = Field(
    ...,
    le=1.0,
    ge=0.0,
    title="Relevance Alpha",
    description="Relevance alpha",
)
top_k_vectors class-attribute instance-attribute
top_k_vectors: int = Field(
    ...,
    gt=0,
    title="Top K Vectors",
    description="Soft maximum number of vectors to return per memory collection. This is a soft limit since the number of vectors requested is divided by the number of context chunks.",
)
top_k_vectors_derived class-attribute instance-attribute
top_k_vectors_derived: int = Field(
    default=-1,
    title="Top K Vectors Derived",
    description="",
)

RetrievedMemory

Bases: BaseDataModel

Retrieved memory object

Attributes

access_count class-attribute instance-attribute
access_count: int = Field(
    ...,
    title="Access Count",
    description="Number of times the memory has been accessed",
)
access_dt class-attribute instance-attribute
access_dt: datetime = Field(
    ...,
    title="Access Date",
    description="Date and time of the last access",
)
collection_name class-attribute instance-attribute
collection_name: str = Field(
    ...,
    title="Collection Name",
    description="Name of the collection which the memory belongs to",
)
importance class-attribute instance-attribute
importance: int = Field(
    ...,
    title="Importance",
    description="Importance score of the memory",
)
importance_score class-attribute instance-attribute
importance_score: float = Field(
    default=0.0,
    title="Importance Score",
    description="Calculated importance score of the memory",
)
memory_txt class-attribute instance-attribute
memory_txt: str = Field(
    ...,
    title="Memory Text",
    description="Text / content of the memory",
)
overall_score class-attribute instance-attribute
overall_score: float = Field(
    default=0.0,
    title="Overall Score",
    description="Calculated overall score of the memory",
)
pkid class-attribute instance-attribute
pkid: str = Field(
    ...,
    title="Primary Key",
    description="Primary key of the retrieved memory",
)
recency_score class-attribute instance-attribute
recency_score: float = Field(
    default=0.0,
    title="Recency Score",
    description="Calculated recency score of the memory",
)
reduction_refs class-attribute instance-attribute
reduction_refs: int = Field(
    ...,
    title="Reduction References",
    description="Number of reduction references",
)
relevance class-attribute instance-attribute
relevance: float = Field(
    ...,
    title="Relevance",
    description="Calculated relevance score of the memory",
)
relevance_score class-attribute instance-attribute
relevance_score: float = Field(
    default=0.0,
    title="Relevance Score",
    description="Calculated relevance score of the memory",
)