Interface ChatMemoryStore
-
- All Implemented Interfaces:
public interface ChatMemoryStoreRepresents a store for the 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 Type Method Description abstract List<ChatMessage>getMessages(Object memoryId)Retrieves messages for a specified chat memory. abstract voidupdateMessages(Object memoryId, List<ChatMessage> messages)Updates messages for a specified chat memory. abstract voiddeleteMessages(Object memoryId)Deletes all messages for a specified chat memory. -
-
Method Detail
-
getMessages
abstract List<ChatMessage> getMessages(Object memoryId)
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
abstract void updateMessages(Object memoryId, List<ChatMessage> messages)
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 the ChatMemory.
-
deleteMessages
abstract void deleteMessages(Object memoryId)
Deletes all messages for a specified chat memory.
- Parameters:
memoryId- The ID of the chat memory.
-
-
-
-