SessionSummaryManager

Attributes and methods of SessionSummaryManager, which generates session summaries with optional topic extraction.

The SessionSummaryManager is responsible for generating and managing session summaries. It uses a model to analyze conversations and create concise summaries with optional topic extraction.

SessionSummaryManager Attributes

ParameterTypeDefaultDescription
idOptional[str]NoneUnique identifier for this manager. Auto-generated if not provided
nameOptional[str]NoneHuman-readable name for this manager
owner_idOptional[str]NoneID of the agent or team that owns this manager (set when registered in the OS)
owner_typeOptional[str]NoneType of the owner: "agent" or "team" (set when registered in the OS)
modelOptional[Model]NoneModel used for session summary generation
session_summary_promptOptional[str]NoneCustom prompt for session summary generation. If not provided, uses default prompt
summary_request_messagestr"Provide the summary of the conversation."User message prompt for requesting the summary
summaries_updatedboolFalseSet to True after a successful summary; remains true on later calls unless explicitly reset
last_n_runsOptional[int]NonePositive number of recent runs to include in the summary. None means all runs
conversation_limitOptional[int]NonePositive maximum number of messages to include in the summary conversation. None means no limit

SessionSummaryManager Methods

create_session_summary(session: Union[AgentSession, TeamSession], run_metrics: Optional[RunMetrics] = None) -> Optional[SessionSummary]

Creates a summary of the session synchronously.

Parameters:

  • session: The agent or team session to summarize
  • run_metrics: Optional RunMetrics collector. When provided, the summary model's token usage is accumulated under the session_summary_model key

Returns:

  • Optional[SessionSummary]: A SessionSummary object containing the summary text, topics, and timestamp, or None when there is no usable summary result. Provider exceptions propagate to the caller

acreate_session_summary(session: Union[AgentSession, TeamSession], run_metrics: Optional[RunMetrics] = None) -> Optional[SessionSummary]

Creates a summary of the session asynchronously.

Parameters:

  • session: The agent or team session to summarize
  • run_metrics: Optional RunMetrics collector. When provided, the summary model's token usage is accumulated under the session_summary_model key

Returns:

  • Optional[SessionSummary]: A SessionSummary object containing the summary text, topics, and timestamp, or None when there is no usable summary result. Provider exceptions propagate to the caller

SessionSummary Object

The SessionSummary object returned by the summary manager contains:

AttributeTypeDescription
summarystrConcise summary of the session focusing on important information
topicsOptional[List[str]]List of topics discussed in the session
updated_atOptional[datetime]Timestamp when the summary was created