ManagedStrategyProps Struct
Configuration parameters for a memory strategy that can override existing built-in default prompts/models.
| Source | lib/memory/strategies/managed-strategy.ts |
|---|
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as bedrock_agentcore_alpha from '@aws-cdk/aws-bedrock-agentcore-alpha';
import * as bedrock_alpha from '@aws-cdk/aws-bedrock-alpha';
declare const bedrockInvokable: bedrock_alpha.IBedrockInvokable;
const managedStrategyProps: bedrock_agentcore_alpha.ManagedStrategyProps = {
name: 'name',
namespaces: ['namespaces'],
// the properties below are optional
customConsolidation: {
appendToPrompt: 'appendToPrompt',
model: bedrockInvokable,
},
customExtraction: {
appendToPrompt: 'appendToPrompt',
model: bedrockInvokable,
},
description: 'description',
reflectionConfiguration: {
namespaces: ['namespaces'],
},
};
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_bedrock_agentcore_alpha as bedrock_agentcore_alpha
import aws_cdk.aws_bedrock_alpha as bedrock_alpha
# bedrock_invokable: bedrock_alpha.IBedrockInvokable
managed_strategy_props = bedrock_agentcore_alpha.ManagedStrategyProps(
name="name",
namespaces=["namespaces"],
# the properties below are optional
custom_consolidation=bedrock_agentcore_alpha.OverrideConfig(
append_to_prompt="appendToPrompt",
model=bedrock_invokable
),
custom_extraction=bedrock_agentcore_alpha.OverrideConfig(
append_to_prompt="appendToPrompt",
model=bedrock_invokable
),
description="description",
reflection_configuration=bedrock_agentcore_alpha.EpisodicReflectionConfiguration(
namespaces=["namespaces"]
)
)
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.bedrock.agentcore.alpha.*;
import software.amazon.awscdk.services.bedrock.alpha.*;
IBedrockInvokable bedrockInvokable;
ManagedStrategyProps managedStrategyProps = ManagedStrategyProps.builder()
.name("name")
.namespaces(List.of("namespaces"))
// the properties below are optional
.customConsolidation(OverrideConfig.builder()
.appendToPrompt("appendToPrompt")
.model(bedrockInvokable)
.build())
.customExtraction(OverrideConfig.builder()
.appendToPrompt("appendToPrompt")
.model(bedrockInvokable)
.build())
.description("description")
.reflectionConfiguration(EpisodicReflectionConfiguration.builder()
.namespaces(List.of("namespaces"))
.build())
.build();
// Install: dotnet add package Amazon.CDK.AWS.Bedrock.Agentcore.Alpha
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Bedrock.Agentcore.Alpha;
using Amazon.CDK.AWS.Bedrock.Alpha;
IBedrockInvokable bedrockInvokable;
var managedStrategyProps = new ManagedStrategyProps {
Name = "name",
Namespaces = new [] { "namespaces" },
// the properties below are optional
CustomConsolidation = new OverrideConfig {
AppendToPrompt = "appendToPrompt",
Model = bedrockInvokable
},
CustomExtraction = new OverrideConfig {
AppendToPrompt = "appendToPrompt",
Model = bedrockInvokable
},
Description = "description",
ReflectionConfiguration = new EpisodicReflectionConfiguration {
Namespaces = new [] { "namespaces" }
}
};
// Install: go get github.com/aws/aws-cdk-go/awsbedrockagentcorealpha/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import bedrock_agentcore_alpha "github.com/aws/aws-cdk-go/awsbedrockagentcorealpha"
import bedrock_alpha "github.com/aws/aws-cdk-go/awsbedrockalpha"
var bedrockInvokable IBedrockInvokable
managedStrategyProps := &ManagedStrategyProps{
Name: jsii.String("name"),
Namespaces: []*string{
jsii.String("namespaces"),
},
// the properties below are optional
CustomConsolidation: &OverrideConfig{
AppendToPrompt: jsii.String("appendToPrompt"),
Model: bedrockInvokable,
},
CustomExtraction: &OverrideConfig{
AppendToPrompt: jsii.String("appendToPrompt"),
Model: bedrockInvokable,
},
Description: jsii.String("description"),
ReflectionConfiguration: &EpisodicReflectionConfiguration{
Namespaces: []*string{
jsii.String("namespaces"),
},
},
}
Properties
customConsolidationoptionalOverrideConfigcustom_consolidationoptionalOverrideConfigcustomConsolidationoptionalOverrideConfigCustomConsolidationoptionalOverrideConfigCustomConsolidationoptionalOverrideConfig #Default: No custom extraction
This configuration provides customization to how the model identifies and extracts relevant information for memory storage.
customExtractionoptionalOverrideConfigcustom_extractionoptionalOverrideConfigcustomExtractionoptionalOverrideConfigCustomExtractionoptionalOverrideConfigCustomExtractionoptionalOverrideConfig #Default: No custom extraction
This configuration provides customization to how the model identifies and extracts relevant information for memory storage.
descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string #Default: No description
namespacesstring[]namespacestyping.List[str]namespacesList<String>Namespacesstring[]Namespaces*[]*string required #notes
Use a hierarchical format separated by forward slashes (/) to organize namespaces logically. You can include these defined variables:
- {sessionId} - the user identifier to be created in the CreateEvent API
- {memoryStrategyId} - an identifier for an extraction strategy
- {sessionId} - an identifier for each session
Example namespace path: /strategies/{memoryStrategyId}/actions/{actionId}/sessions/{sessionId}
After memory creation, this namespace might look like: /actor/actor-3afc5aa8fef9/strategy/summarization-fy5c5fwc7/session/session-qj7tpd1kvr8
reflectionConfigurationoptionalEpisodicReflectionConfigurationreflection_configurationoptionalEpisodicReflectionConfigurationreflectionConfigurationoptionalEpisodicReflectionConfigurationReflectionConfigurationoptionalEpisodicReflectionConfigurationReflectionConfigurationoptionalEpisodicReflectionConfiguration #Default: No reflection configuration