VanturaMemory class
Manages agent memory including short-term history and long-term summarization.
Handles message lifecycle, persistence integration, and context compression.
Constructors
- VanturaMemory(VanturaLogger logger, LlmClient client, {int shortLimit = 10, int longLimit = 5, VanturaPersistence? persistence})
- Creates a VanturaMemory with summarization and persistence capabilities.
Properties
- client → LlmClient
-
Client used for generating conversation summaries.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- logger → VanturaLogger
-
Logger instance for memory operations.
final
- longLimit → int
-
Maximum number of summaries to keep in long-term memory.
final
- persistence → VanturaPersistence?
-
Optional persistence provider for cross-session memory.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shortLimit → int
-
Maximum number of messages to keep in short-term memory before summarizing.
final
Methods
-
addMessage(
String role, String content, {List< Map< ? toolCalls, String? toolCallId}) → Future<String, dynamic> >void> - Adds a new message to short-term memory and optionally persists it.
-
clear(
) → void - Wipes all memory and clears associated persistence storage.
-
getMessages(
) → List< Map< String, dynamic> > - Returns the combination of long-term summaries and current short-term history.
-
init(
) → Future< void> - Initializes memory by loading history from persistence.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited