Class InfinispanChatMemoryStore

java.lang.Object
dev.langchain4j.store.memory.chat.infinispan.InfinispanChatMemoryStore
All Implemented Interfaces:
ChatMemoryStore

public class InfinispanChatMemoryStore extends Object implements ChatMemoryStore
A ChatMemoryStore backed by an Infinispan cache.

Messages are serialized to JSON using ChatMessageSerializer and stored as strings, following the same approach as the other ChatMemoryStore implementations (Coherence, Cassandra, Oracle). The cache uses application/x-protostream encoding since strings are a native ProtoStream type.

  • Field Details

  • Constructor Details

    • InfinispanChatMemoryStore

      public InfinispanChatMemoryStore(org.infinispan.client.hotrod.RemoteCacheManager remoteCacheManager, String cacheName, boolean createCache, String cacheConfig)
      Creates an InfinispanChatMemoryStore from a pre-configured RemoteCacheManager.
      Parameters:
      remoteCacheManager - the already configured remote cache manager
      cacheName - the cache name to use
      createCache - whether to create the cache if it doesn't exist. When false, the cache must already exist on the server
      cacheConfig - optional custom cache configuration XML
    • InfinispanChatMemoryStore

      public InfinispanChatMemoryStore(org.infinispan.client.hotrod.configuration.ConfigurationBuilder builder, String cacheName, boolean createCache, String cacheConfig)
      Creates an InfinispanChatMemoryStore from a ConfigurationBuilder.
      Parameters:
      builder - the Infinispan configuration builder
      cacheName - the cache name to use
      createCache - whether to create the cache if it doesn't exist. When false, the cache must already exist on the server
      cacheConfig - optional custom cache configuration XML
  • Method Details