BedrockAgentCore / Client / batch_create_memory_records
batch_create_memory_records¶
- BedrockAgentCore.Client.batch_create_memory_records(**kwargs)¶
Creates multiple memory records in a single batch operation for the specified memory with custom content.
See also: AWS API Documentation
Request Syntax
response = client.batch_create_memory_records( memoryId='string', records=[ { 'requestIdentifier': 'string', 'namespaces': [ 'string', ], 'content': { 'text': 'string' }, 'timestamp': datetime(2015, 1, 1), 'memoryStrategyId': 'string', 'metadata': { 'string': { 'stringValue': 'string', 'stringListValue': [ 'string', ], 'numberValue': 123.0, 'dateTimeValue': datetime(2015, 1, 1) } } }, ], clientToken='string', recordExpirySpecification={ 'recordExpiryDurationDays': 123, 'action': 'REMOVE' } )
- Parameters:
memoryId (string) –
[REQUIRED]
The unique ID of the memory resource where records will be created.
records (list) –
[REQUIRED]
A list of memory record creation inputs to be processed in the batch operation.
(dict) –
Input structure to create a new memory record.
requestIdentifier (string) – [REQUIRED]
A client-provided identifier for tracking this specific record creation request.
namespaces (list) – [REQUIRED]
A list of namespace identifiers that categorize or group the memory record.
(string) –
content (dict) – [REQUIRED]
The content to be stored within the memory record.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set:
text.text (string) –
The text content of the memory record.
timestamp (datetime) – [REQUIRED]
Time at which the memory record was created.
memoryStrategyId (string) –
The ID of the memory strategy that defines how this memory record is grouped.
metadata (dict) –
Metadata key-value pairs to be stored with the memory record.
(string) –
(dict) –
The value of a memory record metadata entry.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set:
stringValue,stringListValue,numberValue,dateTimeValue.stringValue (string) –
A string value.
stringListValue (list) –
A list of string values.
(string) –
numberValue (float) –
A numeric value.
dateTimeValue (datetime) –
A timestamp value in ISO 8601 UTC format.
clientToken (string) –
A unique, case-sensitive identifier to ensure idempotent processing of the batch request.
This field is autopopulated if not provided.
recordExpirySpecification (dict) –
The record expiry (long-term memory time-to-live) applied to every record created by this request. Set
recordExpiryDurationDaysto the number of days after which the records expire. Only the expiry provided here is applied; the records’ strategy association has no effect on their expiry. If you do not provide this value, the records do not expire. TheREMOVEaction does not apply when creating records.Note
This is a Tagged Union structure. Only one of the following top level keys can be set:
recordExpiryDurationDays,action.recordExpiryDurationDays (integer) –
The duration, in days, after which the records in this request expire. The minimum is 31 days.
action (string) –
The action to apply to the existing record expiry configuration. Set to
REMOVEto remove a previously configured expiry so that the records no longer expire. This value does not apply when creating records.
- Return type:
dict
- Returns:
Response Syntax
{ 'successfulRecords': [ { 'memoryRecordId': 'string', 'status': 'SUCCEEDED'|'FAILED', 'requestIdentifier': 'string', 'errorCode': 123, 'errorMessage': 'string' }, ], 'failedRecords': [ { 'memoryRecordId': 'string', 'status': 'SUCCEEDED'|'FAILED', 'requestIdentifier': 'string', 'errorCode': 123, 'errorMessage': 'string' }, ] }
Response Structure
(dict) –
successfulRecords (list) –
A list of memory records that were successfully created during the batch operation.
(dict) –
Output information returned after processing a memory record operation.
memoryRecordId (string) –
The unique ID associated to the memory record.
status (string) –
The status of the memory record operation (e.g., SUCCEEDED, FAILED).
requestIdentifier (string) –
The client-provided identifier that was used to track this record operation.
errorCode (integer) –
The error code returned when the memory record operation fails.
errorMessage (string) –
A human-readable error message describing why the memory record operation failed.
failedRecords (list) –
A list of memory records that failed to be created, including error details for each failure.
(dict) –
Output information returned after processing a memory record operation.
memoryRecordId (string) –
The unique ID associated to the memory record.
status (string) –
The status of the memory record operation (e.g., SUCCEEDED, FAILED).
requestIdentifier (string) –
The client-provided identifier that was used to track this record operation.
errorCode (integer) –
The error code returned when the memory record operation fails.
errorMessage (string) –
A human-readable error message describing why the memory record operation failed.
Exceptions