Bedrock’s latest update lets you turn on built‑in memory for agents by attaching a memoryConfiguration to the AgenticRetrieveStream call. The service now restores prior turns, lets the planner decide when a stored fact is useful, injects that fact into the sub‑queries sent to a Managed Knowledge Base, and writes the new turn back to memory—all in a single request. At the same time, a userContext field carries the caller’s identity so the knowledge base can enforce document ACLs. Practitioners gain a drop‑in, backward‑compatible way to add durable, per‑user context without writing custom storage or retrieval logic.
How the New Memory Integration Works
The flow for a single request is:
- The front‑end authenticates the user (e.g., via Amazon Cognito) and extracts the JWT claims.
- The application builds an
AgenticRetrieveStreampayload that includes:memoryConfiguration– enables AgentCore memory as a retrieval source.userContext– supplies the user’s identifier for ACL filtering.- Any current user query.
- Bedrock restores the conversation from memory, runs the planner, and, when needed, pulls a fact from long‑term memory.
- The planner augments the knowledge‑base sub‑queries with the retrieved fact.
- The Managed Knowledge Base returns documents that match both the query and the user’s ACLs.
- Bedrock composes the final answer, returns it to the caller, and writes the turn back to memory.
This sequence replaces the manual steps of persisting chat logs, extracting durable facts, and re‑injecting them into subsequent searches.
Architectural Shifts for Multi‑Tenant Deployments
In the reference pattern, all documents reside in an Amazon S3 bucket that is synced to a single Managed Knowledge Base. An ACL file in the same bucket defines which employee groups may read each folder (e.g., HR and IT are public, engineering runbooks are limited to engineers, sales plans to salespeople). Cognito’s ID token provides two claims used downstream:
sub– becomes theactorIdfor AgentCore memory, effectively namespacing each user’s facts.email– is used by the knowledge base to apply the ACL filter.
All users share a single AgentCore memory resource, but isolation is achieved by namespacing memory entries with the actorId. The article also demonstrates that IAM policies can be written to enforce per‑user memory access, providing a safety net if application code fails to set the correct namespace.
Operational and Security Considerations
Because the memory feature is opt‑in, existing applications that omit memoryConfiguration continue to behave unchanged. However, enabling it introduces new observability points: the request trace now shows when the planner consulted memory, which can be useful for debugging and for compliance audits. Practitioners should monitor trace logs to verify that memory is only accessed for the intended user.
Security hinges on two separate controls:
- Authentication and identity verification are performed before the request reaches the handler (e.g., via an API Gateway JWT authorizer or a FastAPI validator).
- Authorization is split between IAM policies that guard the AgentCore memory namespace and the knowledge‑base ACL filter that limits document visibility based on the
emailclaim.
Both controls are independent; the article explicitly notes that the knowledge base’s ACL filtering is not a hard authorization boundary beyond the document level, and memory isolation relies on correct actorId usage backed by IAM.
Related CloudNinjas coverage: AWS.
What This Means For Practitioners
- Enable
memoryConfigurationonAgenticRetrieveStreamto offload conversation persistence and fact extraction to Bedrock. - Map the Cognito
subclaim to the memoryactorIdand theemailclaim to the knowledge‑baseuserContextto achieve per‑user isolation. - Define IAM policies that restrict memory read/write to the correct
actorIdnamespace, providing a fallback if code mis‑assigns the namespace. - Leverage trace logs to confirm that the planner is using memory only when appropriate, and to audit compliance with data‑access expectations.
- Plan for backward compatibility: existing clients that omit the new fields will continue to function, allowing a gradual rollout.

