Skip to content

Add conversation history feature with AgentCore Memory#10

Open
inoue22 wants to merge 8 commits intoaws-samples:mainfrom
inoue22:feat/agentcore-memory
Open

Add conversation history feature with AgentCore Memory#10
inoue22 wants to merge 8 commits intoaws-samples:mainfrom
inoue22:feat/agentcore-memory

Conversation

@inoue22
Copy link

@inoue22 inoue22 commented Jan 1, 2026

Issue #, if available:

Description of changes:

Description

This PR adds conversation history functionality using Amazon Bedrock AgentCore Memory, enabling users to view and continue past chat sessions.

Changes

AWS CDK

  • AgentCoreInfraStack: Add IAM policy for agent role to access AgentCore Memory (CreateEvent, GetEvent, ListEvents, DeleteEvent, ListSessions)
  • AgentCoreAuth: Add Cognito Identity Pool with IAM role for authenticated frontend users to access AgentCore Memory (ListSessions, ListEvents)
  • AgentCoreRuntime: Add CfnMemory resource with 365-day event expiry, pass Memory ID as environment variable to agent runtime

AgentCore Runtime

  • Integrate AgentCoreMemorySessionManager with Strands Agents for automatic session persistence
  • Accept actorId and sessionId from request payload

Frontend

  • Add ChatHistorySidebar component for displaying past sessions
  • Add useChatHistory hook for fetching sessions and messages from AgentCore Memory
  • Add messageParser.ts utility for parsing AgentCore Memory event payloads (handles both conversational and blob payload types)
  • Update App.tsx to support session selection and creation

Deployment Scripts

  • Pass VITE_MEMORY_ID and VITE_IDENTITY_POOL_ID environment variables to frontend build

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@benlec
Copy link
Contributor

benlec commented Jan 4, 2026

thanks, I will have a look at this.

@inoue22
Copy link
Author

inoue22 commented Jan 5, 2026

Thank you for looking into this.
Reverted the Dockerfile changes for build-essential installation as the issue was resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments