import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Manages an AWS Bedrock AgentCore Memory Strategy. Memory strategies define how the agent processes and organizes information within a memory, such as semantic understanding, summarization, or custom processing logic. * * **Important Limitations:** * * - Each memory can have a maximum of 6 strategies total * - Only one strategy of each built-in type (`SEMANTIC`, `SUMMARIZATION`, `USER_PREFERENCE`, `EPISODIC`) can exist per memory * - Multiple `CUSTOM` strategies are allowed (subject to the total limit of 6) * * ## Example Usage * * ### Semantic Strategy * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const semantic = new aws.bedrock.AgentcoreMemoryStrategy("semantic", { * name: "semantic-strategy", * memoryId: example.id, * type: "SEMANTIC", * description: "Semantic understanding strategy", * namespaceTemplates: ["default"], * }); * ``` * * ### Summarization Strategy * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const summary = new aws.bedrock.AgentcoreMemoryStrategy("summary", { * name: "summary-strategy", * memoryId: example.id, * type: "SUMMARIZATION", * description: "Text summarization strategy", * namespaceTemplates: ["{sessionId}"], * }); * ``` * * ### User Preference Strategy * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const userPref = new aws.bedrock.AgentcoreMemoryStrategy("user_pref", { * name: "user-preference-strategy", * memoryId: example.id, * type: "USER_PREFERENCE", * description: "User preference tracking strategy", * namespaceTemplates: ["preferences"], * }); * ``` * * ### Episodic Strategy * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const episodic = new aws.bedrock.AgentcoreMemoryStrategy("episodic", { * name: "episodic-strategy", * memoryId: example.id, * type: "EPISODIC", * description: "Episodic memory strategy", * namespaceTemplates: ["/strategies/{memoryStrategyId}/actors/{actorId}/sessions/{sessionId}"], * }); * ``` * * ### Custom Strategy with Semantic Override * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const customSemantic = new aws.bedrock.AgentcoreMemoryStrategy("custom_semantic", { * configuration: { * consolidation: { * appendToPrompt: "Focus on extracting key semantic relationships and concepts", * modelId: "anthropic.claude-3-sonnet-20240229-v1:0", * }, * extraction: { * appendToPrompt: "Extract and categorize semantic information", * modelId: "anthropic.claude-3-haiku-20240307-v1:0", * }, * type: "SEMANTIC_OVERRIDE", * }, * name: "custom-semantic-strategy", * memoryId: example.id, * memoryExecutionRoleArn: example.memoryExecutionRoleArn, * type: "CUSTOM", * description: "Custom semantic processing strategy", * namespaceTemplates: ["{sessionId}"], * }); * ``` * * ### Custom Strategy with Summary Override * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const customSummary = new aws.bedrock.AgentcoreMemoryStrategy("custom_summary", { * configuration: { * consolidation: { * appendToPrompt: "Create concise summaries while preserving key details", * modelId: "anthropic.claude-3-sonnet-20240229-v1:0", * }, * type: "SUMMARY_OVERRIDE", * }, * name: "custom-summary-strategy", * memoryId: example.id, * type: "CUSTOM", * description: "Custom summarization strategy", * namespaceTemplates: ["summaries"], * }); * ``` * * ### Custom Strategy with User Preference Override * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const customUserPref = new aws.bedrock.AgentcoreMemoryStrategy("custom_user_pref", { * configuration: { * consolidation: { * appendToPrompt: "Consolidate user preferences and behavioral patterns", * modelId: "anthropic.claude-3-sonnet-20240229-v1:0", * }, * extraction: { * appendToPrompt: "Extract user preferences and interaction patterns", * modelId: "anthropic.claude-3-haiku-20240307-v1:0", * }, * type: "USER_PREFERENCE_OVERRIDE", * }, * name: "custom-user-preference-strategy", * memoryId: example.id, * type: "CUSTOM", * description: "Custom user preference tracking strategy", * namespaceTemplates: ["user_prefs"], * }); * ``` * * ### Custom Strategy with Episodic Override * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const customEpisodic = new aws.bedrock.AgentcoreMemoryStrategy("custom_episodic", { * configuration: { * consolidation: { * appendToPrompt: "Consolidate episodic memories into coherent narratives", * modelId: "anthropic.claude-3-sonnet-20240229-v1:0", * }, * extraction: { * appendToPrompt: "Extract key events and episodes from interactions", * modelId: "anthropic.claude-3-haiku-20240307-v1:0", * }, * type: "EPISODIC_OVERRIDE", * }, * name: "custom-episodic-strategy", * memoryId: example.id, * memoryExecutionRoleArn: example.memoryExecutionRoleArn, * type: "CUSTOM", * description: "Custom episodic processing strategy", * namespaceTemplates: ["/strategies/{memoryStrategyId}/actors/{actorId}/sessions/{sessionId}"], * }); * ``` * * ### Custom Strategy with Self-Managed Configuration * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const selfManaged = new aws.bedrock.AgentcoreMemoryStrategy("self_managed", { * configuration: { * selfManaged: [{ * invocationConfiguration: [{ * topicArn: example.arn, * payloadDeliveryBucketName: exampleAwsS3Bucket.bucket, * }], * triggerConditions: [{ * messageBasedTrigger: [{ * messageCount: 12, * }], * }], * historicalContextWindowSize: 10, * }], * type: "SELF_MANAGED", * }, * name: "self-managed-strategy", * memoryId: exampleAwsBedrockagentcoreMemory.id, * memoryExecutionRoleArn: exampleAwsBedrockagentcoreMemory.memoryExecutionRoleArn, * type: "CUSTOM", * description: "Self-managed processing strategy", * }); * ``` * * ### Custom Strategy with Self-Managed Configuration * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const selfManaged = new aws.bedrock.AgentcoreMemoryStrategy("self_managed", { * configuration: { * selfManagedConfiguration: { * invocationConfiguration: { * topicArn: example.arn, * payloadDeliveryBucketName: exampleAwsS3Bucket.bucket, * }, * triggerCondition: [{ * messageBasedTrigger: [{ * messageCount: 12, * }], * }], * historicalContextWindowSize: 10, * }, * type: "SELF_MANAGED", * }, * name: "self-managed-strategy", * memoryId: exampleAwsBedrockagentcoreMemory.id, * memoryExecutionRoleArn: exampleAwsBedrockagentcoreMemory.memoryExecutionRoleArn, * type: "CUSTOM", * description: "Self-managed processing strategy", * }); * ``` * * ## Import * * ### Identity Schema * * #### Required * * * `memoryId` (String) Memory ID. * * `memoryStrategyId` (String) Memory strategy ID. * * #### Optional * * * `accountId` (String) Account ID where this resource is managed. * * `region` (String) Region where this resource is managed. * * Using `pulumi import`, import memory strategies using `memoryId` and `memoryStrategyId` separated by a comma (`,`). For example: * * ```sh * $ pulumi import aws:bedrock/agentcoreMemoryStrategy:AgentcoreMemoryStrategy example example_memory-5JcvKJ4GP0,example_memory_strategy-pblFzi8VyW * ``` */ export declare class AgentcoreMemoryStrategy extends pulumi.CustomResource { /** * Get an existing AgentcoreMemoryStrategy resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: AgentcoreMemoryStrategyState, opts?: pulumi.CustomResourceOptions): AgentcoreMemoryStrategy; /** * Returns true if the given object is an instance of AgentcoreMemoryStrategy. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is AgentcoreMemoryStrategy; /** * Custom configuration block. Required when `type` is `CUSTOM`, must be omitted for other types. See `configuration` Block below. */ readonly configuration: pulumi.Output; /** * Description of the memory strategy. Once set, a description cannot be removed via update because the service API ignores a null description and retains the previously stored value. */ readonly description: pulumi.Output; /** * ARN of the IAM role that the memory service assumes to perform operations. * * @deprecated memory_execution_role_arn is deprecated. Use memoryExecutionRoleArn on the aws.bedrock.AgentcoreMemory resource instead. */ readonly memoryExecutionRoleArn: pulumi.Output; /** * ID of the memory to associate with this strategy. Changing this forces a new resource. */ readonly memoryId: pulumi.Output; /** * Schema for metadata fields on records generated by this strategy. Valid for all strategy types. See `memoryRecordSchema` Block below. */ readonly memoryRecordSchema: pulumi.Output; /** * Unique identifier of the Memory Strategy. This corresponds to the service `strategyId` identifier (AWS API / CloudFormation terminology). */ readonly memoryStrategyId: pulumi.Output; /** * Name of the memory strategy. Changing this forces a new resource, because the service API does not support renaming a strategy. */ readonly name: pulumi.Output; /** * Set containing exactly one namespace template where this strategy applies (for example `/strategies/{memoryStrategyId}/actors/{actorId}/sessions/{sessionId}`). Namespace templates help organize and scope memory content. Exactly one of `namespaceTemplates` or `namespaces` must be configured for all strategies except `CUSTOM` strategies using `SELF_MANAGED` configuration. */ readonly namespaceTemplates: pulumi.Output; /** * Set of namespace identifiers where this strategy applies. Exactly one of `namespaces` or `namespaceTemplates` must be configured. The API treats this as a legacy parameter; prefer `namespaceTemplates`. Since the API mirrors the two fields, switching an existing configuration from `namespaces` to `namespaceTemplates` with the same value is an in-place no-op. * * @deprecated namespaces is deprecated. Use namespaceTemplates instead. */ readonly namespaces: pulumi.Output; /** * Configuration for the reflections created with the episodic memory strategy. Valid when `type` is `EPISODIC`, must be omitted for other types. See `reflectionConfiguration` Block below. */ readonly reflectionConfiguration: pulumi.Output; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ readonly region: pulumi.Output; readonly timeouts: pulumi.Output; /** * Type of memory strategy. Valid values: `SEMANTIC`, `SUMMARIZATION`, `USER_PREFERENCE`, `EPISODIC`, `CUSTOM`. Changing this forces a new resource. Note that only one strategy of each built-in type (`SEMANTIC`, `SUMMARIZATION`, `USER_PREFERENCE`, `EPISODIC`) can exist per memory. * * The following arguments are optional: */ readonly type: pulumi.Output; /** * Create a AgentcoreMemoryStrategy resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: AgentcoreMemoryStrategyArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering AgentcoreMemoryStrategy resources. */ export interface AgentcoreMemoryStrategyState { /** * Custom configuration block. Required when `type` is `CUSTOM`, must be omitted for other types. See `configuration` Block below. */ configuration?: pulumi.Input; /** * Description of the memory strategy. Once set, a description cannot be removed via update because the service API ignores a null description and retains the previously stored value. */ description?: pulumi.Input; /** * ARN of the IAM role that the memory service assumes to perform operations. * * @deprecated memory_execution_role_arn is deprecated. Use memoryExecutionRoleArn on the aws.bedrock.AgentcoreMemory resource instead. */ memoryExecutionRoleArn?: pulumi.Input; /** * ID of the memory to associate with this strategy. Changing this forces a new resource. */ memoryId?: pulumi.Input; /** * Schema for metadata fields on records generated by this strategy. Valid for all strategy types. See `memoryRecordSchema` Block below. */ memoryRecordSchema?: pulumi.Input; /** * Unique identifier of the Memory Strategy. This corresponds to the service `strategyId` identifier (AWS API / CloudFormation terminology). */ memoryStrategyId?: pulumi.Input; /** * Name of the memory strategy. Changing this forces a new resource, because the service API does not support renaming a strategy. */ name?: pulumi.Input; /** * Set containing exactly one namespace template where this strategy applies (for example `/strategies/{memoryStrategyId}/actors/{actorId}/sessions/{sessionId}`). Namespace templates help organize and scope memory content. Exactly one of `namespaceTemplates` or `namespaces` must be configured for all strategies except `CUSTOM` strategies using `SELF_MANAGED` configuration. */ namespaceTemplates?: pulumi.Input[] | undefined>; /** * Set of namespace identifiers where this strategy applies. Exactly one of `namespaces` or `namespaceTemplates` must be configured. The API treats this as a legacy parameter; prefer `namespaceTemplates`. Since the API mirrors the two fields, switching an existing configuration from `namespaces` to `namespaceTemplates` with the same value is an in-place no-op. * * @deprecated namespaces is deprecated. Use namespaceTemplates instead. */ namespaces?: pulumi.Input[] | undefined>; /** * Configuration for the reflections created with the episodic memory strategy. Valid when `type` is `EPISODIC`, must be omitted for other types. See `reflectionConfiguration` Block below. */ reflectionConfiguration?: pulumi.Input; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input; timeouts?: pulumi.Input; /** * Type of memory strategy. Valid values: `SEMANTIC`, `SUMMARIZATION`, `USER_PREFERENCE`, `EPISODIC`, `CUSTOM`. Changing this forces a new resource. Note that only one strategy of each built-in type (`SEMANTIC`, `SUMMARIZATION`, `USER_PREFERENCE`, `EPISODIC`) can exist per memory. * * The following arguments are optional: */ type?: pulumi.Input; } /** * The set of arguments for constructing a AgentcoreMemoryStrategy resource. */ export interface AgentcoreMemoryStrategyArgs { /** * Custom configuration block. Required when `type` is `CUSTOM`, must be omitted for other types. See `configuration` Block below. */ configuration?: pulumi.Input; /** * Description of the memory strategy. Once set, a description cannot be removed via update because the service API ignores a null description and retains the previously stored value. */ description?: pulumi.Input; /** * ARN of the IAM role that the memory service assumes to perform operations. * * @deprecated memory_execution_role_arn is deprecated. Use memoryExecutionRoleArn on the aws.bedrock.AgentcoreMemory resource instead. */ memoryExecutionRoleArn?: pulumi.Input; /** * ID of the memory to associate with this strategy. Changing this forces a new resource. */ memoryId: pulumi.Input; /** * Schema for metadata fields on records generated by this strategy. Valid for all strategy types. See `memoryRecordSchema` Block below. */ memoryRecordSchema?: pulumi.Input; /** * Name of the memory strategy. Changing this forces a new resource, because the service API does not support renaming a strategy. */ name?: pulumi.Input; /** * Set containing exactly one namespace template where this strategy applies (for example `/strategies/{memoryStrategyId}/actors/{actorId}/sessions/{sessionId}`). Namespace templates help organize and scope memory content. Exactly one of `namespaceTemplates` or `namespaces` must be configured for all strategies except `CUSTOM` strategies using `SELF_MANAGED` configuration. */ namespaceTemplates?: pulumi.Input[] | undefined>; /** * Set of namespace identifiers where this strategy applies. Exactly one of `namespaces` or `namespaceTemplates` must be configured. The API treats this as a legacy parameter; prefer `namespaceTemplates`. Since the API mirrors the two fields, switching an existing configuration from `namespaces` to `namespaceTemplates` with the same value is an in-place no-op. * * @deprecated namespaces is deprecated. Use namespaceTemplates instead. */ namespaces?: pulumi.Input[] | undefined>; /** * Configuration for the reflections created with the episodic memory strategy. Valid when `type` is `EPISODIC`, must be omitted for other types. See `reflectionConfiguration` Block below. */ reflectionConfiguration?: pulumi.Input; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input; timeouts?: pulumi.Input; /** * Type of memory strategy. Valid values: `SEMANTIC`, `SUMMARIZATION`, `USER_PREFERENCE`, `EPISODIC`, `CUSTOM`. Changing this forces a new resource. Note that only one strategy of each built-in type (`SEMANTIC`, `SUMMARIZATION`, `USER_PREFERENCE`, `EPISODIC`) can exist per memory. * * The following arguments are optional: */ type: pulumi.Input; } //# sourceMappingURL=agentcoreMemoryStrategy.d.ts.map