The integration is opt-in and backward compatible. Adding memoryConfiguration to an AgenticRetrieveStream call makes AgentCore memory a retrieval source alongside the knowledge base. Within the same call, the service restores the conversation, lets the planner decide when a stored fact about the user would help, and saves the turn to memory after the answer is generated.
The application still passes a userContext, which limits results to the documents that the user's access control lists allow. The sample takes the memory actorId from the sub claim of the verified Cognito ID token and the knowledge base user from its email claim. The client sends only a question and an optional session ID, and the application assumes an IAM role per user with a session tag that memory policies check.
The example uses one memory resource shared by all users, with per-user separation done through namespace templates. It combines a summary strategy for conversation facts with a user-preference strategy for stated preferences. Memory is best-effort, so a request continues and is answered from the knowledge base if memory calls fail.
Why it matters if you build agents
Teams already running a knowledge base can drop their own conversation table and fact-extraction code, since the service now handles session restore and persistence. Identity has to be right, because the email claim controls document access and the sub claim controls memory. A reused or changeable email could give one person another person's memory, so the sub claim is the safer memory key.
Agentic retrieval does not check whether a supplied actorId, sessionId or namespace belongs to the caller, so these values should come from the verified token and never from the client.
Get stories like this every weekday
One short email with the day's agent tooling news.