AWS Guide Adds Memory to Bedrock Agents
- •AWS guide adds AgentCore memory to Bedrock Agentic Retrieve for personalized, document-grounded assistant answers
- •Cognito token claims separate document access by email from private memory keyed to a stable user ID
- •AnyCompany sample indexes 11 documents with 0 failures and isolates three employees’ memories through IAM conditions
AWS published a guide on building memory-aware assistants with Amazon Bedrock Managed Knowledge Base and Amazon Bedrock AgentCore memory. By adding `memoryConfiguration` to an `AgenticRetrieveStream` request, an application can restore a user’s conversation, retrieve relevant long-term facts to shape searches, and save the exchange afterward. The integration is opt-in and backward compatible; the application remains responsible for authenticating users and passing their identities.
The walkthrough uses a fictional company, AnyCompany, where employees ask about HR policies, IT guides, engineering runbooks, and sales plans. Three test users—engineers Maya and Liam and salesperson Sofia—share one knowledge base and one memory resource. Amazon Cognito supplies a verified ID token: its stable `sub` claim identifies the user for memory, while the verified email claim filters documents using access control lists (rules that limit which users can read documents). The application derives these values from the token, not from the request body, and passes user identity through `userContext` and `memoryConfiguration`.
AnyCompany stores documents in Amazon S3 and uses an ACL-enabled data source. A global ACL file maps folders to permitted email addresses: everyone can read HR and IT documents, engineers can read runbooks, and salespeople can read the commission plan. The sample indexed all 11 scanned documents with 0 failures; documents without a matching ACL entry are not ingested, and users whose emails match no entry receive no results. The guide says the same application pattern can work with permission-aware connectors for SharePoint, Google Drive, and Confluence.
The service restores short-term conversation history, searches the knowledge base with ACL filtering, and can retrieve long-term memory selected by its planner. A summary strategy records conversation facts, while a user-preference strategy stores stated response or deployment preferences; the guide recommends using both. One namespace path, `/anycompany/<sub>`, lets the planner reach both profile records and conversation summaries. AgentCore memory extracts long-term records asynchronously, while the managed knowledge base handles ingestion, filtering, indexing, ranking, planning, retrieval, and answer generation.
The application assumes an IAM role separately for each user and attaches a `userId=<sub>` session tag, allowing IAM conditions to enforce memory isolation. The guide warns that the actor ID and namespace must come from verified identity rather than the client; a client-provided session ID is scoped within that actor’s own memory. The sample uses the US West (Oregon) Region (`us-west-2`), Python 3.10 or later, and Boto3 1.43.72 or later. The memory resource must be in the same AWS account as the knowledge base and in `ACTIVE` state. The post says this setup replaces the earlier sample’s step of persisting conversation history yourself.
The fastest, most reliable AI news, straight to your inbox

