BedrockAgentCoreControlPlaneFrontingLayer / Client / create_memory

create_memory

BedrockAgentCoreControlPlaneFrontingLayer.Client.create_memory(**kwargs)

Creates a new memory.

See also: AWS API Documentation

Request Syntax

response = client.create_memory(
    clientToken='string',
    name='string',
    description='string',
    encryptionKeyArn='string',
    memoryExecutionRoleArn='string',
    eventExpiryDuration=123,
    memoryStrategies=[
        {
            'semanticMemoryStrategy': {
                'name': 'string',
                'description': 'string',
                'namespaces': [
                    'string',
                ]
            },
            'summaryMemoryStrategy': {
                'name': 'string',
                'description': 'string',
                'namespaces': [
                    'string',
                ]
            },
            'userPreferenceMemoryStrategy': {
                'name': 'string',
                'description': 'string',
                'namespaces': [
                    'string',
                ]
            },
            'customMemoryStrategy': {
                'name': 'string',
                'description': 'string',
                'namespaces': [
                    'string',
                ],
                'configuration': {
                    'semanticOverride': {
                        'extraction': {
                            'appendToPrompt': 'string',
                            'modelId': 'string'
                        },
                        'consolidation': {
                            'appendToPrompt': 'string',
                            'modelId': 'string'
                        }
                    },
                    'summaryOverride': {
                        'consolidation': {
                            'appendToPrompt': 'string',
                            'modelId': 'string'
                        }
                    },
                    'userPreferenceOverride': {
                        'extraction': {
                            'appendToPrompt': 'string',
                            'modelId': 'string'
                        },
                        'consolidation': {
                            'appendToPrompt': 'string',
                            'modelId': 'string'
                        }
                    }
                }
            }
        },
    ]
)
Parameters:
  • clientToken (string) –

    A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request but does not return an error.

    This field is autopopulated if not provided.

  • name (string) –

    [REQUIRED]

    The name of the memory. The name must be unique within your account.

  • description (string) – The description of the memory.

  • encryptionKeyArn (string) – The Amazon Resource Name (ARN) of the KMS key used to encrypt the memory data.

  • memoryExecutionRoleArn (string) – The Amazon Resource Name (ARN) of the IAM role that provides permissions for the memory to access Amazon Web Services services.

  • eventExpiryDuration (integer) –

    [REQUIRED]

    The duration after which memory events expire. Specified as an ISO 8601 duration.

  • memoryStrategies (list) –

    The memory strategies to use for this memory. Strategies define how information is extracted, processed, and consolidated.

    • (dict) –

      Contains input information for creating a memory strategy.

      Note

      This is a Tagged Union structure. Only one of the following top level keys can be set: semanticMemoryStrategy, summaryMemoryStrategy, userPreferenceMemoryStrategy, customMemoryStrategy.

      • semanticMemoryStrategy (dict) –

        Input for creating a semantic memory strategy.

        • name (string) – [REQUIRED]

          The name of the semantic memory strategy.

        • description (string) –

          The description of the semantic memory strategy.

        • namespaces (list) –

          The namespaces associated with the semantic memory strategy.

          • (string) –

      • summaryMemoryStrategy (dict) –

        Input for creating a summary memory strategy.

        • name (string) – [REQUIRED]

          The name of the summary memory strategy.

        • description (string) –

          The description of the summary memory strategy.

        • namespaces (list) –

          The namespaces associated with the summary memory strategy.

          • (string) –

      • userPreferenceMemoryStrategy (dict) –

        Input for creating a user preference memory strategy.

        • name (string) – [REQUIRED]

          The name of the user preference memory strategy.

        • description (string) –

          The description of the user preference memory strategy.

        • namespaces (list) –

          The namespaces associated with the user preference memory strategy.

          • (string) –

      • customMemoryStrategy (dict) –

        Input for creating a custom memory strategy.

        • name (string) – [REQUIRED]

          The name of the custom memory strategy.

        • description (string) –

          The description of the custom memory strategy.

        • namespaces (list) –

          The namespaces associated with the custom memory strategy.

          • (string) –

        • configuration (dict) –

          The configuration for the custom memory strategy.

          Note

          This is a Tagged Union structure. Only one of the following top level keys can be set: semanticOverride, summaryOverride, userPreferenceOverride.

          • semanticOverride (dict) –

            The semantic override configuration for a custom memory strategy.

            • extraction (dict) –

              The extraction configuration for a semantic override.

              • appendToPrompt (string) – [REQUIRED]

                The text to append to the prompt for semantic extraction.

              • modelId (string) – [REQUIRED]

                The model ID to use for semantic extraction.

            • consolidation (dict) –

              The consolidation configuration for a semantic override.

              • appendToPrompt (string) – [REQUIRED]

                The text to append to the prompt for semantic consolidation.

              • modelId (string) – [REQUIRED]

                The model ID to use for semantic consolidation.

          • summaryOverride (dict) –

            The summary override configuration for a custom memory strategy.

            • consolidation (dict) –

              The consolidation configuration for a summary override.

              • appendToPrompt (string) – [REQUIRED]

                The text to append to the prompt for summary consolidation.

              • modelId (string) – [REQUIRED]

                The model ID to use for summary consolidation.

          • userPreferenceOverride (dict) –

            The user preference override configuration for a custom memory strategy.

            • extraction (dict) –

              The extraction configuration for a user preference override.

              • appendToPrompt (string) – [REQUIRED]

                The text to append to the prompt for user preference extraction.

              • modelId (string) – [REQUIRED]

                The model ID to use for user preference extraction.

            • consolidation (dict) –

              The consolidation configuration for a user preference override.

              • appendToPrompt (string) – [REQUIRED]

                The text to append to the prompt for user preference consolidation.

              • modelId (string) – [REQUIRED]

                The model ID to use for user preference consolidation.

Return type:

dict

Returns:

Response Syntax

{
    'memory': {
        'arn': 'string',
        'id': 'string',
        'name': 'string',
        'description': 'string',
        'encryptionKeyArn': 'string',
        'memoryExecutionRoleArn': 'string',
        'eventExpiryDuration': 123,
        'status': 'CREATING'|'ACTIVE'|'FAILED'|'DELETING',
        'failureReason': 'string',
        'createdAt': datetime(2015, 1, 1),
        'updatedAt': datetime(2015, 1, 1),
        'strategies': [
            {
                'strategyId': 'string',
                'name': 'string',
                'description': 'string',
                'configuration': {
                    'type': 'SEMANTIC_OVERRIDE'|'SUMMARY_OVERRIDE'|'USER_PREFERENCE_OVERRIDE',
                    'extraction': {
                        'customExtractionConfiguration': {
                            'semanticExtractionOverride': {
                                'appendToPrompt': 'string',
                                'modelId': 'string'
                            },
                            'userPreferenceExtractionOverride': {
                                'appendToPrompt': 'string',
                                'modelId': 'string'
                            }
                        }
                    },
                    'consolidation': {
                        'customConsolidationConfiguration': {
                            'semanticConsolidationOverride': {
                                'appendToPrompt': 'string',
                                'modelId': 'string'
                            },
                            'summaryConsolidationOverride': {
                                'appendToPrompt': 'string',
                                'modelId': 'string'
                            },
                            'userPreferenceConsolidationOverride': {
                                'appendToPrompt': 'string',
                                'modelId': 'string'
                            }
                        }
                    }
                },
                'type': 'SEMANTIC'|'SUMMARIZATION'|'USER_PREFERENCE'|'CUSTOM',
                'namespaces': [
                    'string',
                ],
                'createdAt': datetime(2015, 1, 1),
                'updatedAt': datetime(2015, 1, 1),
                'status': 'CREATING'|'ACTIVE'|'DELETING'|'FAILED'
            },
        ]
    }
}

Response Structure

  • (dict) –

    • memory (dict) –

      The details of the created memory, including its ID, ARN, name, description, and configuration settings.

      • arn (string) –

        The Amazon Resource Name (ARN) of the memory.

      • id (string) –

        The unique identifier of the memory.

      • name (string) –

        The name of the memory.

      • description (string) –

        The description of the memory.

      • encryptionKeyArn (string) –

        The ARN of the KMS key used to encrypt the memory.

      • memoryExecutionRoleArn (string) –

        The ARN of the IAM role that provides permissions for the memory.

      • eventExpiryDuration (integer) –

        The number of days after which memory events will expire.

      • status (string) –

        The current status of the memory.

      • failureReason (string) –

        The reason for failure if the memory is in a failed state.

      • createdAt (datetime) –

        The timestamp when the memory was created.

      • updatedAt (datetime) –

        The timestamp when the memory was last updated.

      • strategies (list) –

        The list of memory strategies associated with this memory.

        • (dict) –

          Contains information about a memory strategy.

          • strategyId (string) –

            The unique identifier of the memory strategy.

          • name (string) –

            The name of the memory strategy.

          • description (string) –

            The description of the memory strategy.

          • configuration (dict) –

            The configuration of the memory strategy.

            • type (string) –

              The type of override for the strategy configuration.

            • extraction (dict) –

              The extraction configuration for the memory strategy.

              Note

              This is a Tagged Union structure. Only one of the following top level keys will be set: customExtractionConfiguration. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

              'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
              
              • customExtractionConfiguration (dict) –

                The custom extraction configuration.

                Note

                This is a Tagged Union structure. Only one of the following top level keys will be set: semanticExtractionOverride, userPreferenceExtractionOverride. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

                'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
                
                • semanticExtractionOverride (dict) –

                  The semantic extraction override configuration.

                  • appendToPrompt (string) –

                    The text to append to the prompt for semantic extraction.

                  • modelId (string) –

                    The model ID to use for semantic extraction.

                • userPreferenceExtractionOverride (dict) –

                  The user preference extraction override configuration.

                  • appendToPrompt (string) –

                    The text to append to the prompt for user preference extraction.

                  • modelId (string) –

                    The model ID to use for user preference extraction.

            • consolidation (dict) –

              The consolidation configuration for the memory strategy.

              Note

              This is a Tagged Union structure. Only one of the following top level keys will be set: customConsolidationConfiguration. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

              'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
              
              • customConsolidationConfiguration (dict) –

                The custom consolidation configuration.

                Note

                This is a Tagged Union structure. Only one of the following top level keys will be set: semanticConsolidationOverride, summaryConsolidationOverride, userPreferenceConsolidationOverride. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

                'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
                
                • semanticConsolidationOverride (dict) –

                  The semantic consolidation override configuration.

                  • appendToPrompt (string) –

                    The text to append to the prompt for semantic consolidation.

                  • modelId (string) –

                    The model ID to use for semantic consolidation.

                • summaryConsolidationOverride (dict) –

                  The summary consolidation override configuration.

                  • appendToPrompt (string) –

                    The text to append to the prompt for summary consolidation.

                  • modelId (string) –

                    The model ID to use for summary consolidation.

                • userPreferenceConsolidationOverride (dict) –

                  The user preference consolidation override configuration.

                  • appendToPrompt (string) –

                    The text to append to the prompt for user preference consolidation.

                  • modelId (string) –

                    The model ID to use for user preference consolidation.

          • type (string) –

            The type of the memory strategy.

          • namespaces (list) –

            The namespaces associated with the memory strategy.

            • (string) –

          • createdAt (datetime) –

            The timestamp when the memory strategy was created.

          • updatedAt (datetime) –

            The timestamp when the memory strategy was last updated.

          • status (string) –

            The current status of the memory strategy.

Exceptions