SessionMemoryService class
Session memory service — manages background extraction of conversation notes into a structured summary file.
Constructors
- SessionMemoryService({required String sessionId, required String projectDir, SessionMemoryConfig config = const SessionMemoryConfig()})
Properties
- config → SessionMemoryConfig
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- projectDir → String
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sessionId → String
-
final
- state → ({int extractionCount, bool inProgress, bool initialized, String? lastSummarizedId, int tokensSinceLast, int toolCallsSinceLast})
-
Current extraction state (read-only).
no setter
- summaryPath → String
-
Path to the session memory file.
no setter
Methods
-
extract(
List< Message> messages) → Future<String> - Extract session memory from conversation messages. Returns the extracted markdown summary.
-
getLastSummarizedIndex(
List< Message> messages) → int - Get the index of the last summarized message in a list. Returns -1 if no message has been summarized.
-
getUnsummarizedMessages(
List< Message> messages) → List<Message> - Get unsummarized messages (those after lastSummarizedMessageId).
-
load(
) → Future< String?> - Load existing session memory from disk.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
shouldExtract(
) → bool - Whether extraction should be triggered based on current state.
-
toString(
) → String -
A string representation of this object.
inherited
-
trackMessage(
Message message) → void - Track a new message for extraction threshold tracking.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited