Interface ChatMemoryStore

All Known Implementing Classes:
CassandraChatMemoryStore, CoherenceChatMemoryStore, InMemoryChatMemoryStore, RedisChatMemoryStore, TablestoreChatMemoryStore

public interface ChatMemoryStore
Represents 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 Details

    • getMessages

      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

      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. Can be serialized to JSON using ChatMessageSerializer.
    • deleteMessages

      void deleteMessages(Object memoryId)
      Deletes all messages for a specified chat memory.
      Parameters:
      memoryId - The ID of the chat memory.