Free Intensive Nov 21–22Free 2-day hands-on Vibecoding Intensive on Nov 21–22 at 16:00 MSK (Sat–Sun) · Live Cohort 3 starts Nov 23Join Free →Cohort 3 (Nov 23)
ReleaseInsight · On RadarAWS Machine Learning Blog→ original

Amazon Bedrock Teaches Its Assistant to Remember Employees and Hide Restricted Documents

An assistant should remember that an employee mentioned a Frankfurt office a month ago, but it should not show that employee other people's documents. In Amazon Bedrock Managed Knowledge Base, the service now handles both. Add memoryConfiguration to an AgenticRetrieveStream request, and the planner pulls the fact from AgentCore memory on its own. The userContext parameter keeps only the documents permitted by access control lists (ACLs). You can drop your own conversation table. Memory is keyed to the Cognito sub, while documents are keyed to the employee's email. An IAM policy with a userId tag blocks access to another user's memory even if the code has a bug. You need Boto3 1.43.72+ and AgentCore memory in the same account as the knowledge base.

AI-processed from AWS Machine Learning Blog; edited by Hamidun News
Amazon Bedrock Teaches Its Assistant to Remember Employees and Hide Restricted Documents
Source: AWS Machine Learning Blog. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceAWS Machine Learning Blog ↗
Editor-in-Chief
Key metric #1Memory is tied to the Cognito sub, documents to the employee's email
Key metric #2IAM with a userId tag won't let anyone read another user's memory, even with a bug in the code
Key metric #3Requires Boto3 1.43.72+ and AgentCore memory in the same account as the knowledge base

A corporate assistant has to remember who it is talking to without disclosing too much. Picture an employee who wrote in a conversation a month ago that they work from the Frankfurt office. Today they ask about vacation, and the answer should take that into account without being reminded.

But the same assistant has no right to show an engineer the sales department's commission plan. Until now, developers stitched this together by hand: they stored every conversation, extracted facts from them, picked the relevant ones, and mixed them into the request. Now AWS hands that work to the service: Amazon Bedrock Managed Knowledge Base uses AgentCore memory and access control lists (ACLs, meaning a list of who can read which documents).

If you are building an assistant for many users, this cuts the amount of custom code you have to write.

What exactly has changed

Amazon Bedrock AgentCore memory now works as another retrieval source alongside the knowledge base. You enable it by adding a memoryConfiguration block to an AgenticRetrieveStream request. Within a single call, the service restores the conversation history, and the planner decides on its own whether a fact about the user will help. If it will, the planner pulls the fact from long-term memory and uses it in subqueries to the knowledge base. After the response, the service writes the exchange back to memory. AgentCore extracts long-term records asynchronously, so a new fact will not appear in memory instantly.

The same request carries userContext, and the knowledge base returns only the documents the user is permitted to see under the ACL. The integration is optional and backward compatible. Authentication and passing the user's identity remain the application's job. There is no separate conversation table anymore: when the interface shows a list of chats, it reads the same memory.

How it works, using the AnyCompany example

AWS demonstrates an internal assistant for a fictional company. The documents live in Amazon S3. HR and IT documents are readable by everyone, engineering regulations only by engineers, and the commission plan only by salespeople. Permissions are defined in a global ACL file, where each folder maps to a list of emails. In the example, 11 documents are indexed, with 0 errors. A document not covered by any ACL entry does not make it into the index. And a user whose email is not found in the entries gets no results from that source. For SharePoint, Google Drive, and Confluence, permissions are pulled from the source itself, and the application code does not change.

Employees sign in through Amazon Cognito. Two fields are taken from its ID token, and each does its own job:

  • email goes into userContext.userId and determines which documents the user can read;
  • sub (the user identifier) goes into actorId and into the memory namespace, for example /anycompany/<sub>.

Why not use email for everything? An address can be changed, or reassigned to a new employee after someone leaves, and that person would inherit the previous owner's memory. A Cognito sub does not change and is never reused. Another stable identifier from your user database will also work, as long as it never passes to a different person.

Memory is configured as a single resource for all users, and the {actorId} template in the namespaces handles the separation. There are three test users: engineers Maya and Liam, and salesperson Sofia. Each has their own documents and their own memory.

Protection that works even when the code has a bug

The most practical part of the material is isolation at the IAM level. The backend assumes the application role separately for each user, with a session tag userId=<sub>. Memory permissions are bound to this tag through actorId and the namespace path. If a developer mistakenly substitutes someone else's identifier, IAM denies access. That way, a bug in the code does not turn into a leak of another person's data.

What you need to get started

AgentCore memory must be in the same AWS account as the knowledge base and in the ACTIVE state. The example uses the US West (Oregon) region, us-west-2. You need Python 3.10+ and Boto3 version 1.43.72 or newer. The aclEnabled flag cannot be changed after the data source is created, so it is worth planning the permission model in advance.

The practical takeaway for teams building assistants for many users: if you store conversations yourself and stitch the context together, compare your setup with the ready-made mechanism. The separation scheme is also worth adopting. Email governs documents, an immutable ID governs memory, and IAM guards against bugs in the code. Part of the source material breaks off at the creation of the memory resource, so details on reading the trace are not covered here.

Story

Key Questions Answered

What exactly has changed?

Amazon Bedrock AgentCore memory now works as another retrieval source alongside the knowledge base. You enable it by adding a memoryConfiguration block to an AgenticRetrieveStream request. Within a single call, the service restores the conversation history, and the planner decides on its own whether a fact about the user will help. If it will, the planner pulls the fact from long-term memory and uses it in subqueries to the knowledge base. After the response, the service writes the exchange back to memory.

How it works, using the AnyCompany example?

AWS demonstrates an internal assistant for a fictional company. The documents live in Amazon S3. HR and IT documents are readable by everyone, engineering regulations only by engineers, and the commission plan only by salespeople. Permissions are defined in a global ACL file, where each folder maps to a list of emails. In the example, 11 documents are indexed, with 0 errors. A document not covered by any ACL entry does not make it into the index.

What are the key details on Protection that works even when the code has a bug?

The most practical part of the material is isolation at the IAM level. The backend assumes the application role separately for each user, with a session tag userId=<sub>. Memory permissions are bound to this tag through actorId and the namespace path. If a developer mistakenly substitutes someone else's identifier, IAM denies access. That way, a bug in the code does not turn into a leak of another person's data.

ZK
Zhemal Khamidun — CPO at Alpina Digital, product manager of AlpinaGPT. Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Private AI Builders Community · Vibe Club

Ship AI Faster with Founders, Engineers & Weekly Architecture Reviews

Inside Vibe Club (hamidun.com/club) — weekly live masterminds with Zhemal Khamidun, Tech Radar, full LMS access, and 370+ production Claude Code skills.

Join Vibe Club →Explore Hamidun Academy
What do you think?
Loading comments…