The [AgentCore Memory Store](https://github.com/aws/bedrock-agentcore-sdk-typescript/tree/main/src/memory/integrations/strands) implements the Strands [`MemoryStore`](/docs/user-guide/concepts/memory/overview/index.md#custom-stores) interface on top of Amazon Bedrock AgentCore Memory. Search maps to AgentCore’s `retrieveMemoryRecords`, and conversation turns are ingested for server-side memory extraction into long-term records. Attach it to an agent through a [`MemoryManager`](/docs/user-guide/concepts/memory/overview/index.md) like any other store. See the [Getting Started](/docs/user-guide/concepts/memory/overview/index.md#getting-started) section for more information.

## Requirements

-   `bedrock-agentcore >= 0.4.1`
-   `@strands-agents/sdk >= 1.5.0`
-   An [Amazon Bedrock AgentCore Memory](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/memory.html) resource, with AWS credentials to reach it

## Installation

```bash
npm install bedrock-agentcore @strands-agents/sdk
```

## Usage

`createAgentCoreMemoryStores` builds one store per namespace over a shared client, and you attach them to an agent through a `MemoryManager`. Mark a namespace `writable` to capture the conversation into it; a namespace left unmarked stays read-only for recall.

```typescript
import { Agent, MemoryManager, BedrockModel } from '@strands-agents/sdk'
import { createAgentCoreMemoryStores } from 'bedrock-agentcore/memory/strands'

const stores = createAgentCoreMemoryStores({
  memoryId: 'mem-abc',
  actorId: 'user-123',
  sessionId: 'session-1',
  namespaces: [
    { namespace: '/facts/{actorId}', writable: true },
    { namespace: '/preferences/{actorId}', minScore: 0.5 },
  ],
  extraction: true,
})

const agent = new Agent({
  model: new BedrockModel(),
  memoryManager: new MemoryManager({ stores }),
})
```

A single `AgentCoreMemoryStore` can also be constructed directly when you only need one namespace:

```typescript
import { AgentCoreMemoryStore } from 'bedrock-agentcore/memory/strands'

const store = new AgentCoreMemoryStore({
  memoryId: 'mem-abc',
  actorId: 'user-123',
  sessionId: 'session-1',
  namespace: '/facts/{actorId}',
  writable: true,
  extraction: true,
})
```

## Configuration

In `createAgentCoreMemoryStores`, `namespace`, `writable`, and `minScore` are set per `namespaces` entry, while everything else is passed once at the top level. The direct `AgentCoreMemoryStore` constructor takes all options in one flat config.

| Option | Type | Description |
| --- | --- | --- |
| `memoryId` | `string` | The AgentCore Memory resource to read from and write to. |
| `actorId` | `string` | Identifies the user; substituted into `{actorId}` placeholders. |
| `sessionId` | `string` | Identifies the conversation; substituted into `{sessionId}` placeholders. |
| `namespace` | `string` | Exact namespace prefix for recall. Use `namespacePath` instead to query a whole subtree. |
| `writable` | `boolean` | Enables writing conversation turns for extraction. Defaults to `false`. |
| `extraction` | `boolean | object` | Turns on server-side extraction, with optional cadence and filter config. |
| `minScore` | `number` | Drops recalled records below this relevance threshold. |

See the [package README](https://github.com/aws/bedrock-agentcore-sdk-typescript/tree/main/src/memory/integrations/strands) for the full option reference, including subtree reads and over-fetch tuning.

## Notes

-   **One writable store per session.** Mark at most one store `writable` for a given `(actorId, sessionId)`: because writes are namespace-free, multiple writable stores would emit duplicate events to the same `(memoryId, actorId, sessionId)` stream. `createAgentCoreMemoryStores` enforces this and throws if more than one store is writable.
-   **Placeholders resolve at construction.** Only `{actorId}` and `{sessionId}` are substituted client-side, into the namespace used for recall. Any other placeholder in a namespace causes construction to throw. Provision strategies with `{actorId}`/`{sessionId}`\-only templates to match.
-   **Eventual consistency.** Writes and extraction are asynchronous, so a fact written this turn may not be retrievable on the next one.

## References

-   [Integration source](https://github.com/aws/bedrock-agentcore-sdk-typescript/tree/main/src/memory/integrations/strands)
-   [`bedrock-agentcore` on npm](https://www.npmjs.com/package/bedrock-agentcore)
-   [Amazon Bedrock AgentCore Memory](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/memory.html)
-   [Report an issue](https://github.com/aws/bedrock-agentcore-sdk-typescript/issues/new/choose)