Interface ChatMemory

All Known Implementing Classes:
MessageWindowChatMemory

@Deprecated(since="2.1.0", forRemoval=true) public interface ChatMemory
Deprecated, for removal: This API element is subject to removal in a future version.
since 2.1.0, for removal in 3.0.0, in favor of session memory, org.springframework.ai.session.SessionService in spring-ai-session; the context key is MemoryAdvisor.CONVERSATION_ID in spring-ai-client-chat
The contract for storing and managing the memory of chat conversations.
Since:
1.0.0
Author:
Christian Tzolov, Thomas Vitale
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Deprecated, for removal: This API element is subject to removal in a future version.
    The key to retrieve the chat memory conversation id from the context.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(String conversationId, List<Message> messages)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Save the specified messages in the chat memory for the specified conversation.
    default void
    add(String conversationId, Message message)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Save the specified message in the chat memory for the specified conversation.
    void
    clear(String conversationId)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Clear the chat memory for the specified conversation.
    get(String conversationId)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the messages in the chat memory for the specified conversation.
  • Field Details

    • CONVERSATION_ID

      static final String CONVERSATION_ID
      Deprecated, for removal: This API element is subject to removal in a future version.
      The key to retrieve the chat memory conversation id from the context.
      See Also:
  • Method Details

    • add

      default void add(String conversationId, Message message)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Save the specified message in the chat memory for the specified conversation.
    • add

      void add(String conversationId, List<Message> messages)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Save the specified messages in the chat memory for the specified conversation.
    • get

      List<Message> get(String conversationId)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the messages in the chat memory for the specified conversation.
    • clear

      void clear(String conversationId)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Clear the chat memory for the specified conversation.