Package akka.javasdk.impl.agent
Class SessionMemoryClient
Object
akka.javasdk.impl.agent.SessionMemoryClient
- All Implemented Interfaces:
SessionMemory
INTERNAL USE Not for user extension or instantiation
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionSessionMemoryClient
(ComponentClient componentClient, SessionMemoryClient.MemorySettings memorySettings) SessionMemoryClient
(ComponentClient componentClient, com.typesafe.config.Config memoryConfig) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addInteraction
(String sessionId, SessionMessage.UserMessage userMessage, List<SessionMessage> messages) Adds an interaction between a user and an AI model to the session history for the specified session.getHistory
(String sessionId) Retrieves the complete session history for the specified session.
-
Constructor Details
-
SessionMemoryClient
public SessionMemoryClient(ComponentClient componentClient, com.typesafe.config.Config memoryConfig) -
SessionMemoryClient
public SessionMemoryClient(ComponentClient componentClient, SessionMemoryClient.MemorySettings memorySettings)
-
-
Method Details
-
addInteraction
public void addInteraction(String sessionId, SessionMessage.UserMessage userMessage, List<SessionMessage> messages) Description copied from interface:SessionMemory
Adds an interaction between a user and an AI model to the session history for the specified session.- Specified by:
addInteraction
in interfaceSessionMemory
- Parameters:
sessionId
- The unique identifier for the contextual sessionuserMessage
- The content of the user messagemessages
- All other messages generated during this interaction, typically AiMessage but also Tool Call responses.
-
getHistory
Description copied from interface:SessionMemory
Retrieves the complete session history for the specified session. For very long sessions, this might return a compacted version of the history.- Specified by:
getHistory
in interfaceSessionMemory
- Parameters:
sessionId
- The unique identifier for the contextual session- Returns:
- The complete session history containing all messages
-