Skip to content

BatchUpdateMemoryRecords

Source: src/AWS/BedrockAgentCore/BatchUpdateMemoryRecords.ts

Updates long-term memory records in bulk.

Bind a Memory inside a function runtime to call the AgentCore data-plane API against it. Provide AgentCore.BatchUpdateMemoryRecordsHttp on the Function effect to implement the binding.

// init
const batchUpdateMemoryRecords = yield* AgentCore.BatchUpdateMemoryRecords(memory);
return {
fetch: Effect.gen(function* () {
// runtime
const result = yield* batchUpdateMemoryRecords({
records: [
{
memoryRecordId,
timestamp: new Date(),
content: { text: "The user's favorite color is green." },
namespaces: ["facts/user-1"],
},
],
});
return HttpServerResponse.json({
updated: result.successfulRecords.length,
});
}),
};