Interface ChatMemoryAccess


public interface ChatMemoryAccess
Allow to access the ChatMemory of any AI service extending it.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Evicts the ChatMemory with the given id.
    dev.langchain4j.memory.ChatMemory
    Returns the ChatMemory with the given id for this AI service or null if such memory doesn't exist.
  • Method Details

    • getChatMemory

      dev.langchain4j.memory.ChatMemory getChatMemory(Object memoryId)
      Returns the ChatMemory with the given id for this AI service or null if such memory doesn't exist.
      Parameters:
      memoryId - The id of the chat memory.
      Returns:
      The ChatMemory with the given memoryId or null if such memory doesn't exist.
    • evictChatMemory

      boolean evictChatMemory(Object memoryId)
      Evicts the ChatMemory with the given id.
      Parameters:
      memoryId - The id of the chat memory to be evicted.
      Returns:
      true if ChatMemory with the given id existed, and it was successfully evicted, false otherwise.