ContentType Objects
Enum
specifies the type of data stored within an Episode. While it currently supports a single content type, it is designed to be extensible to accommodate other types like vectors or images in the future.
STRING
: Denotes that the content is a standard string.
SessionInfo Objects
SessionInfo
dataclass holds essential information about a single conversation session. It’s typically used to manage and retrieve session details from a database.
init
SessionInfo
instance.
Arguments:
id
(int
) - The unique database identifier for the session.user_ids
(list[str]
) - A list of user identifiers participating in the session.session_id
(str
) - A unique string identifier for the session.group_id
(str | None
) - The identifier for a group conversation, if applicable.agent_ids
(list[str] | None
) - A list of agent identifiers participating in the session.configuration
(dict | None
) - A dictionary containing any custom configuration for this session.
MemoryContext Objects
MemoryContext
dataclass defines the unique context for a memory instance. It’s used to isolate memories for different conversations, users, and agents, ensuring that data from one session doesn’t interfere with another. It also includes a pre-computed hash string for efficient lookup.
init
MemoryContext
instance.
Arguments:
group_id
(str
) - The identifier for the group context.agent_id
(set[str]
) - A set of agent identifiers for the context.user_id
(set[str]
) - A set of user identifiers for the context.session_id
(str
) - The identifier for the session context.hash_str
(str
) - A pre-computed string representation of the context for hashing.
hash
hash_str
.
Returns:
The integer hash of the context.
Episode Objects
Episode
represents a single, atomic event or piece of data in the memory system. This dataclass uses the kw_only=True
flag to ensure that all fields must be specified by keyword arguments during instantiation, improving code clarity.
init
Episode
instance.
Arguments:
uuid
(UUID
) - A unique identifier (UUID) for the episode.episode_type
(str
) - A string indicating the type of the episode (e.g., ‘message’, ‘thought’, ‘action’).content_type
(ContentType
) - The type of the data stored in the ‘content’ field.content
(Any
) - The actual data of the episode.timestamp
(datetime
) - The date and time when the episode occurred.group_id
(str
) - Identifier for the group.session_id
(str
) - Identifier for the session to which this episode belongs.producer_id
(str
) - The identifier of the user or agent that created this episode.produced_for_id
(str | None
) - The identifier of the intended recipient, if any.user_metadata
(JSONValue
) - A dictionary for any additional, user-defined metadata.