aws / aws/bedrock-agentcore-sdk-typescript
[FEATURE] Add AgentCoreMemorySessionManager for Strands TypeScript SDK integration
- Dominant language
- TypeScript
- Stars
- 91
- Forks
- 31
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 5
Description
### Problem Statement
The Python `bedrock-agentcore` SDK provides `AgentCoreMemorySessionManager` which integrates AgentCore Memory with the Strands Agents SDK's session management interface. This allows Python developers to persist conversation history across sessions with a single configuration line.
The TypeScript equivalent does not exist. TypeScript developers have to build a custom ~100-line class using the raw `@aws-sdk/client-bedrock-agentcore` client (`CreateEventCommand` / `ListEventsCommand`) to achieve the same functionality.
### Proposed Solution
Ship an `AgentCoreMemorySessionManager` (or equivalent) for the TypeScript SDK that implements the Strands SDK's `SnapshotStorage` interface, matching the Python SDK's ergonomics.
The Python community session manager provides:
- Automatic conversation history persistence via `session_manager` interface
- Long-term memory strategies (session summaries, user preferences, semantic facts)
- Drop-in integration with the Strands agent constructor
The TypeScript equivalent should provide the same capabilities.
### Use Case
Building production TypeScript agents with Strands SDK that need cross-session memory. Currently requires manual wiring:
```typescript
// What we have to build manually today (~100 lines):
const memory = new AgentCoreMemory({
memoryId: process.env.AGENTCORE_MEMORY_ID,
actorId: userId,
sessionId: sid,
region: 'us-west-2',
});
const agent = createAgent(userId);
await memory.loadHistory(agent); // Manual: restore previous conversation
await agent.stream(message);
await memory.saveNewMessages(agent); // Manual: persist new turns
```
```typescript
// What it should look like (matching Python ergonomics):
const agent = new Agent({
sessionManager: new AgentCoreMemorySessionManager({
memoryId: process.env.AGENTCORE_MEMORY_ID,
actorId: userId,
sessionId: sid,
}),
});
// Memory loading/saving handled automatically by the session manager
```
### Proof of Concept
I created a working custom implementation as a proof of concept:
https://gist.github.com/ErikCH/53512f5a9d670daaab4eec1a29e4e431
### Related
- Originally filed as: https://github.com/strands-agents/sdk-typescript/issues/811
- Python community session manager: https://strandsagents.com/docs/community/session-managers/agentcore-memory/
- Strands TS SDK `SessionManager` interface: https://strandsagents.com/docs/api/typescript/SessionManager/
### Additional Context
The collaborator on the Strands SDK issue (#811) directed this to be filed here. The Python equivalent lives in `bedrock-agentcore-sdk-python` as a community session manager.
Contributor guide
Research direction
Start with the Strands TypeScript SDK SessionManager/SnapshotStorage interface and compare the Python community AgentCore Memory session manager. Review the linked proof of concept and the CreateEventCommand/ListEventsCommand flow. Done means an exported TypeScript session manager provides automatic history loading and saving with the proposed Agent constructor configuration and equivalent memory strategies.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- backend, developer-experience
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100