Interface MemoryStrategyConfiguration.Builder
- All Superinterfaces:
Buildable,CopyableBuilder<MemoryStrategyConfiguration.Builder,,MemoryStrategyConfiguration> SdkBuilder<MemoryStrategyConfiguration.Builder,,MemoryStrategyConfiguration> SdkPojo
- Enclosing class:
MemoryStrategyConfiguration
-
Method Summary
Modifier and TypeMethodDescriptionconsolidationEnabled(Boolean consolidationEnabled) Specifies whether the strategy consolidates memories.extractEveryNMessages(Integer extractEveryNMessages) Extract once this many messages have accumulated, from 1 to 1000.extractEveryNTokens(Integer extractEveryNTokens) Extract once this many tokens of conversation have accumulated, from 1 to 80,000, however few messages that takes.extractionPrompt(String extractionPrompt) Instructions that define what aCUSTOMstrategy extracts, up to 30,720 characters.extractionSeedRecentN(Integer extractionSeedRecentN) How many of the strategy's most recent stored memories to include in the extraction prompt, from 0 to 20.extractionSeedTopK(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.idleTimeoutSeconds(Integer idleTimeoutSeconds) Extract what has accumulated once the conversation has been idle for this many seconds, from 1 to 86,400.Methods inherited from interface software.amazon.awssdk.utils.builder.CopyableBuilder
copyMethods inherited from interface software.amazon.awssdk.utils.builder.SdkBuilder
applyMutation, buildMethods inherited from interface software.amazon.awssdk.core.SdkPojo
equalsBySdkFields, sdkFieldNameToField, sdkFields
-
Method Details
-
extractionPrompt
Instructions that define what a
CUSTOMstrategy extracts, up to 30,720 characters. Required for aCUSTOMstrategy:CreateSpaceandUpdateSpacefail withValidationExceptionif aCUSTOMstrategy has none.Only
CUSTOMstrategies use it.SEMANTICandSUMMARYstrategies always extract with the service's built-in instructions: the service accepts and stores a prompt on them, andGetSpacereturns it, but extraction doesn't use it.- Parameters:
extractionPrompt- Instructions that define what aCUSTOMstrategy extracts, up to 30,720 characters. Required for aCUSTOMstrategy:CreateSpaceandUpdateSpacefail withValidationExceptionif aCUSTOMstrategy has none.Only
CUSTOMstrategies use it.SEMANTICandSUMMARYstrategies always extract with the service's built-in instructions: the service accepts and stores a prompt on them, andGetSpacereturns it, but extraction doesn't use it.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
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, andidleTimeoutSecondsis reached. The service then extracts them together in one pass.- Parameters:
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, andidleTimeoutSecondsis reached. The service then extracts them together in one pass.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
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.- Parameters:
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 byextractEveryNMessages,idleTimeoutSeconds, and the service's maximum batch size.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
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.
- Parameters:
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:
- Returns a reference to this object so that method calls can be chained together.
-
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 andextractionSeedRecentNare both set, the two sets of memories are combined without duplicates.- Parameters:
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 (seeextractionSeedRecentN). When this andextractionSeedRecentNare both set, the two sets of memories are combined without duplicates.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
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
SUMMARYstrategy when neither seed setting is given. When this andextractionSeedTopKare both set, the two sets of memories are combined without duplicates.- Parameters:
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 aSUMMARYstrategy when neither seed setting is given. When this andextractionSeedTopKare both set, the two sets of memories are combined without duplicates.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
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
SEMANTICandSUMMARY, off forCUSTOM.- Parameters:
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
SEMANTICandSUMMARY, off forCUSTOM.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-