Interface MemoryProvider

All Known Implementing Classes:
MemoryProvider.CustomMemoryProvider, MemoryProvider.Disabled, MemoryProvider.FromConfig, MemoryProvider.LimitedWindowMemoryProvider

Interface for configuring memory management in agent systems.

MemoryProvider defines how session history is stored and retrieved during agent interactions. It offers several implementation strategies:

  • Method Details

    • fromConfig

      static MemoryProvider fromConfig()
      Creates a configuration-based memory provider based on configuration defaults.
      Returns:
      A configuration-based model provider
    • fromConfig

      static MemoryProvider fromConfig(String configPath)
      Creates a memory provider based on configuration settings.
      Parameters:
      configPath - Path to the configuration. If empty, uses the default path "akka.javasdk.agent.memory"
      Returns:
      A configuration-based model provider
    • none

      static MemoryProvider.Disabled none()
      Disabled memory provider, which does not store or retrieve contextual history.
      Returns:
      A memory provider without memory.
    • limitedWindow

      Creates a limited window memory provider with default settings.

      The default settings are:

      • Include all session history in each interaction with the model
      • Record all interactions into memory
      Returns:
      A new limited window memory provider with default settings
    • custom

      static MemoryProvider.CustomMemoryProvider custom(SessionMemory sessionMemory)
      Creates a custom memory provider using the specified SessionMemory implementation.

      This allows for complete customization of memory management behavior.

      Parameters:
      sessionMemory - The custom SessionMemory implementation
      Returns:
      A new custom memory provider