Class MemoryStrategyConfiguration

java.lang.Object
software.amazon.awssdk.services.opensearchmemory.model.MemoryStrategyConfiguration
All Implemented Interfaces:
Serializable, SdkPojo, ToCopyableBuilder<MemoryStrategyConfiguration.Builder,MemoryStrategyConfiguration>

@Generated("software.amazon.awssdk:codegen") public final class MemoryStrategyConfiguration extends Object implements SdkPojo, Serializable, ToCopyableBuilder<MemoryStrategyConfiguration.Builder,MemoryStrategyConfiguration>

Settings for a memory strategy. The defaults described here apply when you create a strategy. In UpdateSpace, a member you omit for a kept strategy keeps its current value.

See Also:
  • Method Details

    • extractionPrompt

      public final String extractionPrompt()

      Instructions that define what a CUSTOM strategy extracts, up to 30,720 characters. Required for a CUSTOM strategy: CreateSpace and UpdateSpace fail with ValidationException if a CUSTOM strategy has none.

      Only CUSTOM strategies use it. SEMANTIC and SUMMARY strategies always extract with the service's built-in instructions: the service accepts and stores a prompt on them, and GetSpace returns it, but extraction doesn't use it.

      Returns:
      Instructions that define what a CUSTOM strategy extracts, up to 30,720 characters. Required for a CUSTOM strategy: CreateSpace and UpdateSpace fail with ValidationException if a CUSTOM strategy has none.

      Only CUSTOM strategies use it. SEMANTIC and SUMMARY strategies always extract with the service's built-in instructions: the service accepts and stores a prompt on them, and GetSpace returns it, but extraction doesn't use it.

    • extractEveryNMessages

      public final Integer extractEveryNMessages()

      Extract once this many messages have accumulated, from 1 to 1000. Lower values extract more often, in smaller batches. The default is 12.

      Messages accumulate until the first of extractEveryNMessages, extractEveryNTokens, and idleTimeoutSeconds is reached. The service then extracts them together in one pass.

      Returns:
      Extract once this many messages have accumulated, from 1 to 1000. Lower values extract more often, in smaller batches. The default is 12.

      Messages accumulate until the first of extractEveryNMessages, extractEveryNTokens, and idleTimeoutSeconds is reached. The service then extracts them together in one pass.

    • extractEveryNTokens

      public final Integer extractEveryNTokens()

      Extract once this many tokens of conversation have accumulated, from 1 to 80,000, however few messages that takes. Use it to bound how much text one extraction call carries when message sizes vary widely. Omit it to bound a batch only by extractEveryNMessages, idleTimeoutSeconds, and the service's maximum batch size.

      Returns:
      Extract once this many tokens of conversation have accumulated, from 1 to 80,000, however few messages that takes. Use it to bound how much text one extraction call carries when message sizes vary widely. Omit it to bound a batch only by extractEveryNMessages, idleTimeoutSeconds, and the service's maximum batch size.
    • idleTimeoutSeconds

      public final Integer idleTimeoutSeconds()

      Extract what has accumulated once the conversation has been idle for this many seconds, from 1 to 86,400. The default is 60. This is what extracts the end of a conversation that stops. Raise it when the pauses in your conversations are longer than that, so that one exchange isn't split across several extraction passes.

      Returns:
      Extract what has accumulated once the conversation has been idle for this many seconds, from 1 to 86,400. The default is 60. This is what extracts the end of a conversation that stops. Raise it when the pauses in your conversations are longer than that, so that one exchange isn't split across several extraction passes.
    • extractionSeedTopK

      public final Integer extractionSeedTopK()

      How many of the strategy's stored memories that are most relevant to the conversation to include in the extraction prompt, from 0 to 20, to improve extraction and reduce duplicates. If you omit this or set it to 0, the service uses its default (see extractionSeedRecentN). When this and extractionSeedRecentN are both set, the two sets of memories are combined without duplicates.

      Returns:
      How many of the strategy's stored memories that are most relevant to the conversation to include in the extraction prompt, from 0 to 20, to improve extraction and reduce duplicates. If you omit this or set it to 0, the service uses its default (see extractionSeedRecentN). When this and extractionSeedRecentN are both set, the two sets of memories are combined without duplicates.
    • extractionSeedRecentN

      public final Integer extractionSeedRecentN()

      How many of the strategy's most recent stored memories to include in the extraction prompt, from 0 to 20. If you omit this or set it to 0, the service uses its default: no seeding for most strategy types, and the 10 most recent memories for a SUMMARY strategy when neither seed setting is given. When this and extractionSeedTopK are both set, the two sets of memories are combined without duplicates.

      Returns:
      How many of the strategy's most recent stored memories to include in the extraction prompt, from 0 to 20. If you omit this or set it to 0, the service uses its default: no seeding for most strategy types, and the 10 most recent memories for a SUMMARY strategy when neither seed setting is given. When this and extractionSeedTopK are both set, the two sets of memories are combined without duplicates.
    • consolidationEnabled

      public final Boolean consolidationEnabled()

      Specifies whether the strategy consolidates memories. With consolidation, each new memory is compared with similar stored memories, and the service adds it, updates a stored memory, or skips it, so duplicate or contradicting facts don't accumulate. Without it, every extracted memory is stored as a new memory, which costs less and keeps a full history.

      When omitted, the default depends on the strategy's type: on for SEMANTIC and SUMMARY, off for CUSTOM.

      Returns:
      Specifies whether the strategy consolidates memories. With consolidation, each new memory is compared with similar stored memories, and the service adds it, updates a stored memory, or skips it, so duplicate or contradicting facts don't accumulate. Without it, every extracted memory is stored as a new memory, which costs less and keeps a full history.

      When omitted, the default depends on the strategy's type: on for SEMANTIC and SUMMARY, off for CUSTOM.

    • toBuilder

      Description copied from interface: ToCopyableBuilder
      Take this object and create a builder that contains all of the current property values of this object.
      Specified by:
      toBuilder in interface ToCopyableBuilder<MemoryStrategyConfiguration.Builder,MemoryStrategyConfiguration>
      Returns:
      a builder for type T
    • builder

      public static MemoryStrategyConfiguration.Builder builder()
    • serializableBuilderClass

      public static Class<? extends MemoryStrategyConfiguration.Builder> serializableBuilderClass()
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalsBySdkFields

      public final boolean equalsBySdkFields(Object obj)
      Description copied from interface: SdkPojo
      Indicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in an SdkPojo class, and is generated based on a service model.

      If an SdkPojo class does not have any inherited fields, equalsBySdkFields and equals are essentially the same.

      Specified by:
      equalsBySdkFields in interface SdkPojo
      Parameters:
      obj - the object to be compared with
      Returns:
      true if the other object equals to this object by sdk fields, false otherwise.
    • toString

      public final String toString()
      Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
      Overrides:
      toString in class Object
    • getValueForField

      public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
    • sdkFields

      public final List<SdkField<?>> sdkFields()
      Specified by:
      sdkFields in interface SdkPojo
      Returns:
      List of SdkField in this POJO. May be empty list but should never be null.
    • sdkFieldNameToField

      public final Map<String,SdkField<?>> sdkFieldNameToField()
      Specified by:
      sdkFieldNameToField in interface SdkPojo
      Returns:
      The mapping between the field name and its corresponding field.