Interface ChatMemoryStore

  • All Implemented Interfaces:

    
    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.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract List<ChatMessage> getMessages(Object memoryId) Retrieves messages for a specified chat memory.
      abstract void updateMessages(Object memoryId, List<ChatMessage> messages) Updates messages for a specified chat memory.
      abstract void deleteMessages(Object memoryId) Deletes all messages for a specified chat memory.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • 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.