Interface ChatMemoryStore
- All Known Implementing Classes:
CassandraChatMemoryStore
,CoherenceChatMemoryStore
,InMemoryChatMemoryStore
,RedisChatMemoryStore
,TablestoreChatMemoryStore
public interface ChatMemoryStore
Represents a store for the
Currently, the only implementation available is
More documentation can be found here.
ChatMemory
state.
Allows for flexibility in terms of where and how chat memory is stored.
Currently, the only implementation available is
InMemoryChatMemoryStore
.
Over time, out-of-the-box implementations will be added for popular stores like SQL databases, document stores, etc.
In the meantime, you can implement this interface to connect to any storage of your choice.
More documentation can be found here.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
deleteMessages
(Object memoryId) Deletes all messages for a specified chat memory.getMessages
(Object memoryId) Retrieves messages for a specified chat memory.void
updateMessages
(Object memoryId, List<ChatMessage> messages) Updates messages for a specified chat memory.
-
Method Details
-
getMessages
Retrieves messages for a specified chat memory.- Parameters:
memoryId
- The ID of the chat memory.- Returns:
- List of messages for the specified chat memory. Must not be null. Can be deserialized from JSON using
ChatMessageDeserializer
.
-
updateMessages
Updates messages for a specified chat memory.- Parameters:
memoryId
- The ID of the chat memory.messages
- List of messages for the specified chat memory, that represent the current state of theChatMemory
. Can be serialized to JSON usingChatMessageSerializer
.
-
deleteMessages
Deletes all messages for a specified chat memory.- Parameters:
memoryId
- The ID of the chat memory.
-