From 9cce186c001550a7db43455f81862107b9c3c4d8 Mon Sep 17 00:00:00 2001 From: opieter-aws Date: Fri, 17 Jul 2026 08:53:05 -0400 Subject: [PATCH 1/2] docs(memory): add community page for AgentCore Memory Store --- site/package-lock.json | 38 +++--- site/src/config/navigation.yml | 1 + .../memory-stores/agentcore-memory-store.mdx | 113 ++++++++++++++++++ 3 files changed, 133 insertions(+), 19 deletions(-) create mode 100644 site/src/content/docs/community/memory-stores/agentcore-memory-store.mdx diff --git a/site/package-lock.json b/site/package-lock.json index 171cec9f87..b965883827 100644 --- a/site/package-lock.json +++ b/site/package-lock.json @@ -67,25 +67,25 @@ "version": "0.0.1-development", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/client-bedrock-runtime": "^3.1069.0", + "@aws-sdk/client-bedrock-runtime": "^3.1078.0", "@types/json-schema": "^7.0.15", "uuid": "^14.0.1", "yaml": "^2.8.3" }, "devDependencies": { "@a2a-js/sdk": "^0.3.10", - "@ai-sdk/amazon-bedrock": "^4.0.128", + "@ai-sdk/amazon-bedrock": "^4.0.129", "@ai-sdk/openai": "^3.0.41", "@ai-sdk/provider": "^3.0.0", - "@anthropic-ai/sdk": "^0.106.0", - "@aws-sdk/client-bedrock": "^3.1069.0", - "@aws-sdk/client-bedrock-agent": "^3.1075.0", - "@aws-sdk/client-bedrock-agent-runtime": "^3.1075.0", - "@aws-sdk/client-s3": "^3.1069.0", - "@aws-sdk/client-secrets-manager": "^3.1069.0", - "@aws-sdk/client-ssm": "^3.1069.0", - "@aws-sdk/client-sts": "^3.1069.0", - "@aws-sdk/credential-providers": "^3.1069.0", + "@anthropic-ai/sdk": "^0.109.1", + "@aws-sdk/client-bedrock": "^3.1078.0", + "@aws-sdk/client-bedrock-agent": "^3.1078.0", + "@aws-sdk/client-bedrock-agent-runtime": "^3.1078.0", + "@aws-sdk/client-s3": "^3.1078.0", + "@aws-sdk/client-secrets-manager": "^3.1078.0", + "@aws-sdk/client-ssm": "^3.1078.0", + "@aws-sdk/client-sts": "^3.1078.0", + "@aws-sdk/credential-providers": "^3.1078.0", "@aws/bedrock-token-generator": "^1.1.0", "@cedar-policy/cedar-wasm": "^4.11.2", "@cedar-policy/mcp-schema-generator-wasm": "^0.6.0", @@ -104,9 +104,9 @@ "@types/uuid": "^11.0.0", "@typescript-eslint/eslint-plugin": "^8.62.1", "@typescript-eslint/parser": "^8.0.0", - "@vitest/browser": "^4.1.9", - "@vitest/browser-playwright": "^4.1.6", - "@vitest/coverage-v8": "^4.1.6", + "@vitest/browser": "^4.1.10", + "@vitest/browser-playwright": "^4.1.10", + "@vitest/coverage-v8": "^4.1.10", "eslint": "^10.6.0", "eslint-plugin-tsdoc": "^0.5.0", "express": "^5.2.1", @@ -114,7 +114,7 @@ "playwright": "^1.61.0", "tsx": "^4.22.5", "typescript": "^6.0.3", - "vitest": "^4.1.6" + "vitest": "^4.1.10" }, "engines": { "node": ">=20.0.0" @@ -122,10 +122,10 @@ "peerDependencies": { "@a2a-js/sdk": "^0.3.10", "@ai-sdk/provider": "^3.0.0", - "@anthropic-ai/sdk": "^0.106.0", - "@aws-sdk/client-bedrock-agent": "^3.1075.0", - "@aws-sdk/client-bedrock-agent-runtime": "^3.1075.0", - "@aws-sdk/client-s3": "^3.1069.0", + "@anthropic-ai/sdk": "^0.109.1", + "@aws-sdk/client-bedrock-agent": "^3.1078.0", + "@aws-sdk/client-bedrock-agent-runtime": "^3.1078.0", + "@aws-sdk/client-s3": "^3.1078.0", "@aws/bedrock-token-generator": "^1.1.0", "@cedar-policy/cedar-wasm": "^4.0.0", "@cedar-policy/mcp-schema-generator-wasm": "^0.6.0", diff --git a/site/src/config/navigation.yml b/site/src/config/navigation.yml index 9383669cde..e5c180173d 100644 --- a/site/src/config/navigation.yml +++ b/site/src/config/navigation.yml @@ -343,6 +343,7 @@ sidebar: - label: Memory Stores items: - docs/community/memory-stores/overview + - docs/community/memory-stores/agentcore-memory-store - label: Session Managers items: - docs/community/session-managers/agentcore-memory diff --git a/site/src/content/docs/community/memory-stores/agentcore-memory-store.mdx b/site/src/content/docs/community/memory-stores/agentcore-memory-store.mdx new file mode 100644 index 0000000000..ffea8f476e --- /dev/null +++ b/site/src/content/docs/community/memory-stores/agentcore-memory-store.mdx @@ -0,0 +1,113 @@ +--- +title: AgentCore Memory Store +community: true +description: Amazon Bedrock AgentCore Memory as a MemoryStore for long-term recall and server-side extraction +integrationType: memory-store +languages: TypeScript +sidebar: + label: "AgentCore Memory Store" +project: + npm: https://www.npmjs.com/package/bedrock-agentcore + github: https://github.com/aws/bedrock-agentcore-sdk-typescript/tree/main/src/memory/integrations/strands + maintainer: aws +service: + name: Amazon Bedrock AgentCore + link: https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/memory.html +--- + +The [AgentCore Memory Store](https://github.com/aws/bedrock-agentcore-sdk-typescript/tree/main/src/memory/integrations/strands) +implements the Strands [`MemoryStore`](../../user-guide/concepts/memory/overview.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`](../../user-guide/concepts/memory/overview.md) like any other store. See +the [Getting Started](../../user-guide/concepts/memory/overview.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 + +Key options for both the store and each `namespaces` entry: + +| 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.** At most one store may be `writable` for a given + `(actorId, sessionId)`. Constructing more than one throws. +- **Placeholders resolve at write time.** Only `{actorId}` and `{sessionId}` are substituted + client-side. 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) From 4136b0bd8c36c2a426ea5eff4d9c33ecccd39571 Mon Sep 17 00:00:00 2001 From: opieter-aws Date: Fri, 17 Jul 2026 14:42:57 -0400 Subject: [PATCH 2/2] address feedback --- .../memory-stores/agentcore-memory-store.mdx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/site/src/content/docs/community/memory-stores/agentcore-memory-store.mdx b/site/src/content/docs/community/memory-stores/agentcore-memory-store.mdx index ffea8f476e..81df48420a 100644 --- a/site/src/content/docs/community/memory-stores/agentcore-memory-store.mdx +++ b/site/src/content/docs/community/memory-stores/agentcore-memory-store.mdx @@ -80,7 +80,9 @@ const store = new AgentCoreMemoryStore({ ## Configuration -Key options for both the store and each `namespaces` entry: +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 | |--------|------|-------------| @@ -97,11 +99,14 @@ for the full option reference, including subtree reads and over-fetch tuning. ## Notes -- **One writable store per session.** At most one store may be `writable` for a given - `(actorId, sessionId)`. Constructing more than one throws. -- **Placeholders resolve at write time.** Only `{actorId}` and `{sessionId}` are substituted - client-side. Any other placeholder in a namespace causes construction to throw. Provision - strategies with `{actorId}`/`{sessionId}`-only templates to match. +- **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.