# UserPreferenceMemoryStrategyProperty

The memory strategy.

- Source: Generated at build time
- Type last changed: v2.276.0 · 10 Nov 2026

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_bedrockagentcore as bedrockagentcore } from 'aws-cdk-lib';
const userPreferenceMemoryStrategyProperty: bedrockagentcore.CfnMemory.UserPreferenceMemoryStrategyProperty = {
  name: 'name',

  // the properties below are optional
  createdAt: 'createdAt',
  description: 'description',
  memoryRecordSchema: {
    metadataSchema: [{
      key: 'key',

      // the properties below are optional
      extractionConfig: {
        llmExtractionConfig: {
          definition: 'definition',

          // the properties below are optional
          llmExtractionInstruction: 'llmExtractionInstruction',
          validation: {
            numberValidation: {
              maxValue: 123,
              minValue: 123,
            },
            stringListValidation: {
              allowedValues: ['allowedValues'],
              maxItems: 123,
            },
            stringValidation: {
              allowedValues: ['allowedValues'],
            },
          },
        },
      },
      extractionType: 'extractionType',
      type: 'type',
    }],
  },
  namespaces: ['namespaces'],
  namespaceTemplates: ['namespaceTemplates'],
  recordExpiryDurationDays: 123,
  recordExpirySpecification: {
    recordExpiryDurationDays: 123,
  },
  status: 'status',
  strategyId: 'strategyId',
  type: 'type',
  updatedAt: 'updatedAt',
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_bedrockagentcore as bedrockagentcore

user_preference_memory_strategy_property = bedrockagentcore.CfnMemory.UserPreferenceMemoryStrategyProperty(
    name="name",

    # the properties below are optional
    created_at="createdAt",
    description="description",
    memory_record_schema=bedrockagentcore.CfnMemory.MemoryRecordSchemaProperty(
        metadata_schema=[bedrockagentcore.CfnMemory.MetadataSchemaEntryProperty(
            key="key",

            # the properties below are optional
            extraction_config=bedrockagentcore.CfnMemory.ExtractionConfigProperty(
                llm_extraction_config=bedrockagentcore.CfnMemory.LlmExtractionConfigProperty(
                    definition="definition",

                    # the properties below are optional
                    llm_extraction_instruction="llmExtractionInstruction",
                    validation=bedrockagentcore.CfnMemory.ValidationProperty(
                        number_validation=bedrockagentcore.CfnMemory.NumberValidationProperty(
                            max_value=123,
                            min_value=123
                        ),
                        string_list_validation=bedrockagentcore.CfnMemory.StringListValidationProperty(
                            allowed_values=["allowedValues"],
                            max_items=123
                        ),
                        string_validation=bedrockagentcore.CfnMemory.StringValidationProperty(
                            allowed_values=["allowedValues"]
                        )
                    )
                )
            ),
            extraction_type="extractionType",
            type="type"
        )]
    ),
    namespaces=["namespaces"],
    namespace_templates=["namespaceTemplates"],
    record_expiry_duration_days=123,
    record_expiry_specification=bedrockagentcore.CfnMemory.RecordExpirySpecificationProperty(
        record_expiry_duration_days=123
    ),
    status="status",
    strategy_id="strategyId",
    type="type",
    updated_at="updatedAt"
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.bedrockagentcore.*;

UserPreferenceMemoryStrategyProperty userPreferenceMemoryStrategyProperty = UserPreferenceMemoryStrategyProperty.builder()
        .name("name")

        // the properties below are optional
        .createdAt("createdAt")
        .description("description")
        .memoryRecordSchema(MemoryRecordSchemaProperty.builder()
                .metadataSchema(List.of(MetadataSchemaEntryProperty.builder()
                        .key("key")

                        // the properties below are optional
                        .extractionConfig(ExtractionConfigProperty.builder()
                                .llmExtractionConfig(LlmExtractionConfigProperty.builder()
                                        .definition("definition")

                                        // the properties below are optional
                                        .llmExtractionInstruction("llmExtractionInstruction")
                                        .validation(ValidationProperty.builder()
                                                .numberValidation(NumberValidationProperty.builder()
                                                        .maxValue(123)
                                                        .minValue(123)
                                                        .build())
                                                .stringListValidation(StringListValidationProperty.builder()
                                                        .allowedValues(List.of("allowedValues"))
                                                        .maxItems(123)
                                                        .build())
                                                .stringValidation(StringValidationProperty.builder()
                                                        .allowedValues(List.of("allowedValues"))
                                                        .build())
                                                .build())
                                        .build())
                                .build())
                        .extractionType("extractionType")
                        .type("type")
                        .build()))
                .build())
        .namespaces(List.of("namespaces"))
        .namespaceTemplates(List.of("namespaceTemplates"))
        .recordExpiryDurationDays(123)
        .recordExpirySpecification(RecordExpirySpecificationProperty.builder()
                .recordExpiryDurationDays(123)
                .build())
        .status("status")
        .strategyId("strategyId")
        .type("type")
        .updatedAt("updatedAt")
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.BedrockAgentCore;

var userPreferenceMemoryStrategyProperty = new UserPreferenceMemoryStrategyProperty {
    Name = "name",

    // the properties below are optional
    CreatedAt = "createdAt",
    Description = "description",
    MemoryRecordSchema = new MemoryRecordSchemaProperty {
        MetadataSchema = new [] { new MetadataSchemaEntryProperty {
            Key = "key",

            // the properties below are optional
            ExtractionConfig = new ExtractionConfigProperty {
                LlmExtractionConfig = new LlmExtractionConfigProperty {
                    Definition = "definition",

                    // the properties below are optional
                    LlmExtractionInstruction = "llmExtractionInstruction",
                    Validation = new ValidationProperty {
                        NumberValidation = new NumberValidationProperty {
                            MaxValue = 123,
                            MinValue = 123
                        },
                        StringListValidation = new StringListValidationProperty {
                            AllowedValues = new [] { "allowedValues" },
                            MaxItems = 123
                        },
                        StringValidation = new StringValidationProperty {
                            AllowedValues = new [] { "allowedValues" }
                        }
                    }
                }
            },
            ExtractionType = "extractionType",
            Type = "type"
        } }
    },
    Namespaces = new [] { "namespaces" },
    NamespaceTemplates = new [] { "namespaceTemplates" },
    RecordExpiryDurationDays = 123,
    RecordExpirySpecification = new RecordExpirySpecificationProperty {
        RecordExpiryDurationDays = 123
    },
    Status = "status",
    StrategyId = "strategyId",
    Type = "type",
    UpdatedAt = "updatedAt"
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

userPreferenceMemoryStrategyProperty := &UserPreferenceMemoryStrategyProperty{
	Name: jsii.String("name"),

	// the properties below are optional
	CreatedAt: jsii.String("createdAt"),
	Description: jsii.String("description"),
	MemoryRecordSchema: &MemoryRecordSchemaProperty{
		MetadataSchema: []interface{}{
			&MetadataSchemaEntryProperty{
				Key: jsii.String("key"),

				// the properties below are optional
				ExtractionConfig: &ExtractionConfigProperty{
					LlmExtractionConfig: &LlmExtractionConfigProperty{
						Definition: jsii.String("definition"),

						// the properties below are optional
						LlmExtractionInstruction: jsii.String("llmExtractionInstruction"),
						Validation: &ValidationProperty{
							NumberValidation: &NumberValidationProperty{
								MaxValue: jsii.Number(123),
								MinValue: jsii.Number(123),
							},
							StringListValidation: &StringListValidationProperty{
								AllowedValues: []*string{
									jsii.String("allowedValues"),
								},
								MaxItems: jsii.Number(123),
							},
							StringValidation: &StringValidationProperty{
								AllowedValues: []*string{
									jsii.String("allowedValues"),
								},
							},
						},
					},
				},
				ExtractionType: jsii.String("extractionType"),
				Type: jsii.String("type"),
			},
		},
	},
	Namespaces: []*string{
		jsii.String("namespaces"),
	},
	NamespaceTemplates: []*string{
		jsii.String("namespaceTemplates"),
	},
	RecordExpiryDurationDays: jsii.Number(123),
	RecordExpirySpecification: &RecordExpirySpecificationProperty{
		RecordExpiryDurationDays: jsii.Number(123),
	},
	Status: jsii.String("status"),
	StrategyId: jsii.String("strategyId"),
	Type: jsii.String("type"),
	UpdatedAt: jsii.String("updatedAt"),
}
```

## Properties

- `createdAt`: string — Creation timestamp of the memory strategy.

- `description`: string — The memory strategy description.

- `memoryRecordSchema`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnMemory.MemoryRecordSchemaProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_bedrockagentcore.CfnMemory.MemoryRecordSchemaProperty.html)

- `name`: string (required) — The memory strategy name.

- `namespaces`: string[] — The memory namespaces.

- `namespaceTemplates`: string[] — List of namespaces for memory strategy.

- `recordExpiryDurationDays`: number — The duration, in days, after which long-term memory records generated by this strategy expire (LTM TTL).

  Minimum 31 days.

- `recordExpirySpecification`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnMemory.RecordExpirySpecificationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_bedrockagentcore.CfnMemory.RecordExpirySpecificationProperty.html) — Specifies the record expiry (LTM TTL) for a strategy.

  Provide RecordExpiryDurationDays to configure the duration after which records expire. Omit the specification entirely to leave records without an expiry on create, or to clear a previously configured expiry on update (the handler derives the removal from the previous and desired state).

- `status`: string — The memory strategy status.

- `strategyId`: string — The memory strategy ID.

- `type`: string — The memory strategy type.

- `updatedAt`: string — The memory strategy update date and time.
