Amazon Bedrock can now treat long-term user memory as another retrieval source inside the same AgenticRetrieveStream call that searches your enterprise knowledge base. On November 16, 2026, AWS published Build memory-aware AI agents with Agentic Retrieve on Amazon Bedrock Managed Knowledge Base—a full multi-tenant employee assistant pattern where each user sees only ACL-allowed documents and each user's AgentCore memory stays private.
If you already deployed agentic RAG from our October CDK blueprint, this post is the memory upgrade: swap your conversation table for AgentCore session and long-term records, and pass Cognito identity into userContext and memoryConfiguration on every stream.
Answer first: what changed for builders
| Piece | Before (typical DIY) | AWS November 16 pattern |
|---|---|---|
| Session history | App database or cache | AgentCore short-term memory via sessionBinding |
| User facts from old chats | Custom extractors | AgentCore summary and user-preference strategies |
| Retrieval call | KB only | KB plus planner-selected memory searches |
| Per-user docs | Manual filters | Managed KB ACL filtering from S3 ACL JSON |
| Isolation | App logic only | IAM conditions on actorId and namespacePath |
The integration is opt-in: omit memoryConfiguration and behavior stays compatible with earlier AgenticRetrieveStream clients.
Why AWS merged KB and memory in one stream
AWS opens with a product truth many RAG demos skip: users expect follow-up questions that only make sense with last month's context, and answers grounded with citations from docs they may read.
That splits state across two systems:
- Knowledge base — policies, runbooks, commission plans with document ACLs.
- Memory — durable facts such as office location, laptop OS, or answer-format preferences.
Without a single orchestrated call, apps glue retrieve → memory fetch → LLM themselves and often leak cross-user facts or over-fetch documents.
AgenticRetrieveStream already runs a planner that chooses sub-queries. Adding memoryConfiguration makes AgentCore memory a first-class retrieval source next to the managed knowledge base. After generation, persistenceMode: DEFAULT writes the turn back so long-term extraction runs asynchronously under configured strategies.
This is the same agentic retrieval family we covered when AWS shipped ACL interceptors on AgentCore Gateway—but the November guide focuses on memory namespaces rather than MCP tool routing.
Architecture: AnyCompany fictional assistant
AWS's running example is AnyCompany, an internal assistant over HR, IT, engineering, and sales folders in S3, with:
- One managed knowledge base (no self-hosted vector DB).
- One AgentCore memory resource shared by all employees.
- Amazon Cognito for authentication.
- Boto3 backend assuming a per-user IAM role with sts:TagSession.
Architecture of memory-aware AnyCompany assistant with Cognito, AgenticRetrieveStream, and AgentCore memory
Image: Amazon Web Services
One AgenticRetrieveStream turn with userContext and memoryConfiguration
Image: Amazon Web Services
Regional note from AWS: the sample uses US West (Oregon) (us-west-2) and requires the memory resource in the same account as the knowledge base, in ACTIVE state, per agentic retrieval documentation linked from the post.
Step 1 — ACL-enabled S3 data source
Managed knowledge bases ingest through MANAGED_KNOWLEDGE_BASE_CONNECTOR data sources. For multi-user enterprise RAG, AWS enables aclEnabled with a globalAccessControlListS3Uri pointing at JSON such as:
- docs/hr/ and docs/it/ — allow all test employees.
- docs/engineering/ — allow engineers only.
- docs/sales/ — allow sales only.
Critical constraint: aclEnabled cannot change after creation. If you already stood up a data source without ACLs, you need a new data source and re-ingestion, not a toggle.
Our Crawl4AI plus Bedrock KB guide shows a different ingestion path for web content; the ACL model still applies when documents land in S3 with consistent user email keys.
Step 2 — Memory strategies and namespace layout
One memory resource serves every user; isolation uses {actorId} templates resolved at extraction time.
AWS recommends two strategies together:
- summaryMemoryStrategy — captures facts mentioned in passing (Frankfurt office, Mac laptop).
- userPreferenceMemoryStrategy — structured prefs (bullet answers, deploy eu-central-1 first).
Namespace design mistake to avoid: retrievalConfigs accepts one namespacePath. A layout like /profile/actorId and /summaries/actorId in separate trees cannot both be reached with a single entry. AWS uses /anycompany/<sub> so one path covers profile and summaries.
Event retention example: 30-day raw event expiry on the memory resource, with optional CMK encryption.
For pricing shifts on AgentCore memory, see our October AgentCore ICYMI guide.
Step 3 — Cognito claims: email vs sub
Two claims, two jobs—AWS is explicit:
| Claim | Maps to | Why |
|---|---|---|
| Verified email | userContext.userId | ACL files key users by email |
| Immutable sub | memoryConfiguration.sessionBinding.actorId | Stable per-person memory key |
Using email as memory actor would let a reassigned mailbox inherit another employee's memories after HR churn. sub should never move between people.
The sample pool sets email required, verified, not mutable. Federated Okta or Entra installs should map IdP email to match ACL entries.
Step 4 — Building AgenticRetrieveStream
After JWT verification, the handler:
- AssumeRole on an app role with
Tags=[{Key: "userId", Value: principal.sub}]. - Generate or reuse sessionId (
conv-plus uuid for new chats). - Call AgenticRetrieveStream with:
- knowledgeBaseId as retriever.
- userContext carrying email.
- memoryConfiguration with sessionBinding and retrievalConfigs namespace.
ListSessions with actorId=sub replaces a custom conversations SQL table. If the actor never chatted, AWS returns ResourceNotFoundException—handle as empty history, not a crash.
ListEvents becomes required when using sessionBinding; RetrieveMemoryRecords when using retrievalConfigs; CreateEvent when persistenceMode is DEFAULT.
IAM: defense in depth for multi-tenant memory
The sample policy is worth copying even if you rewrite the app layer:
- bedrock:AgenticRetrieveStream on
*. - Scoped bedrock:Retrieve on the specific knowledge base ARN.
- bedrock-agentcore memory APIs conditioned on
${aws:PrincipalTag/userId}matching actorId or namespacePath prefix.
That means a bug that passes another user's sessionId still cannot read their STM or LTM—session IDs are namespaced under the caller actorId from the token.
Compare with Greenlight Luna SOC on AgentCore, which uses episodic memory for security playbooks; enterprise HR assistants need the same tenant walls with different retention.
Reading traces: when did memory matter?
Maya assistant answer with AgentCore memory hit for Frankfurt-specific VPN guidance
Image: Amazon Web Services
AWS's post walks trace events to show the planner choosing memory searches before composing KB sub-queries. That is the observability hook for debugging "why did it think I live in Berlin?" without dumping raw vectors.
Pair traces with the seven observability layers from the CDK blueprint—dashboards still matter; memory adds new span types.
How this differs from Apple and Microsoft agent memory research
Apple's Plan-or-Retrieve study asks when agents should search tools among thousands of APIs. Microsoft UserRepGen-4B simulates user profiles for evaluators. AWS's post is production wiring: Cognito, IAM, S3 ACL JSON, and stream API fields you can deploy this week in us-west-2.
It also complements Claude Code on Bedrock AgentCore—coding agents need repo-scoped memory hygiene; enterprise assistants need document ACL plus user memory hygiene.
Migration checklist from DIY chat history
- Audit current message tables for PII before importing into AgentCore strategies.
- Create memory resource and wait for ACTIVE.
- Align ACL emails with IdP immutable email policy.
- Add memoryConfiguration to AgenticRetrieveStream in staging; compare answers with/without memory on the same sessionId.
- Turn on IAM session tags on AssumeRole before production multi-tenant launch.
- Run regression prompts that require facts from turn 3 in turn 20—the acceptance test AWS implies but does not ship as code.
Testing memory-aware agentic retrieve in staging
Before you cut over production traffic, AWS’s sample pattern implies a test matrix you can script even if the blog does not ship pytest files:
- ACL negative test — authenticate as sofia@example.com and ask for an engineering runbook topic. The stream should cite zero engineering docs while still answering from HR folders she may read.
- Cross-session memory — in session A, state "I am on a Mac in Frankfurt." Open session B with the same sub and ask a PTO policy question. Trace output should show a memory retrieval influencing KB sub-queries (for example Frankfurt holiday rules).
- Session hijack attempt — pass Maya’s sessionId while authenticated as Liam. With IAM session tags enabled, ListEvents for that session should not return Maya’s STM because actorId differs.
- Cold start user — first question from a new Cognito user should not 500 when ListSessions raises ResourceNotFoundException; return an empty thread list instead.
- Boto3 pin — CI that floats boto3 without a floor can break AgenticRetrieveStream field support; lock 1.43.72+ as AWS documents.
Teams running AWS manufacturing agent taxonomy blueprints can reuse the same per-user tagging pattern when factory roles map to different SOP corpora.
Limits AWS states or implies
- Region and account colocation for memory and KB.
- Single namespacePath in retrievalConfigs—design namespaces accordingly.
- ACL ingestion: documents without ACL coverage do not ingest.
- Boto3 1.43.72+ requirement—pin in requirements.txt before CI drifts.
- Preview components elsewhere in AgentCore may still change; check memory strategies docs.
Bottom line
November 16, 2026 AWS documentation closes the loop between agentic RAG and durable per-user memory without a separate persistence microservice. Pass verified email for documents, sub for memory, wrap AgenticRetrieveStream with tagged IAM, and let the planner decide when a user fact should reshape KB sub-queries.
Related reading
- Agentic Retrieval CDK blueprint (October 2026)
- Bedrock KB ACLs on AgentCore Gateway
- AgentCore October 2026 builder ICYMI
- Crawl4AI plus Bedrock knowledge bases
- Claude Code remote sessions on AgentCore
- Apple plan-or-retrieve tool discovery study
- Primary source: AWS ML Blog — memory-aware Agentic Retrieve
