Skip to content

DeleteAgentMemory

Source: src/AWS/Bedrock/DeleteAgentMemory.ts

Runtime binding for bedrock-agent-runtime:DeleteAgentMemory — delete the memory an agent has stored, for one session, one memory id, or everything.

Bind an AgentAlias inside a function runtime to get a callable that clears the agent’s long-term memory. The binding grants the function bedrock:DeleteAgentMemory scoped to exactly that alias. Deletion is idempotent — deleting a session or memory id that holds no memory succeeds.

Forget One Session

// init
const deleteAgentMemory = yield* Bedrock.DeleteAgentMemory(alias);
// runtime
yield* deleteAgentMemory({ sessionId });

Forget Everything for a Memory Id

yield* deleteAgentMemory({ memoryId: userId });