amazon-opensearch-memory skill
amazon-opensearch-memory is a skill in the Agent Toolkit for AWS that
helps your AI coding agent integrate an application with Amazon OpenSearch Memory. With the skill,
the agent can create a space, write conversation turns as events, and search the memories
that OpenSearch Memory extracts from them. A skill is a curated package of instructions and
reference material that helps an agent complete a task correctly. The agent loads the
skill when your request names OpenSearch Memory, an OpenSearch Memory space, or the
aws opensearchmemory commands.
For how the service works, see What is Amazon OpenSearch Memory?.
Capabilities
The skill covers the following tasks.
Spaces and memory strategies
Create a space, add or change its memory strategies (SEMANTIC,
SUMMARY, and CUSTOM), set event and memory retention,
and delete a space.
Create an OpenSearch Memory space for my agent that extracts user facts and session summaries
Events and memories
Write conversation turns as events, read events back, write or update memories directly, and delete an end user's data.
Write this conversation turn for user-42 to my OpenSearch Memory space
Search
Search or list memories, build a search query, and filter results by time or metadata.
Search my OpenSearch Memory space for what user-42 said about where they live
Access control and encryption
Write IAM policies, isolate end users from each other, and use a customer managed AWS KMS key for a space.
What IAM policy lets a read-only agent search memories in one OpenSearch Memory space but not write to it?
Troubleshooting
Diagnose errors such as ResourceNotFoundException after a space
reports ACTIVE, ConflictException while a space is
UPDATING, or ValidationException on a search query, and
find out why memories don't appear in search results.
I wrote events to my OpenSearch Memory space, but searching memories returns nothing
How the agent gets the skill
The skill is delivered through the Agent Toolkit for AWS. You have two options:
-
Discover it at runtime through the AWS MCP Server. With the AWS MCP Server configured (see Set up the AWS MCP Server), your agent finds the skill on demand using the server's
search_documentationtool and loads it withretrieve_skill– no local install required. -
Install it with the AWS CLI. The following command installs the skill to the AI coding agents that the Agent Toolkit for AWS detects on your system. This command requires AWS CLI version 2.35.0 or later. For more information, see AWS CLI in the Agent Toolkit for AWS documentation.
aws agent-toolkit add-skill --skill-name amazon-opensearch-memory
The source of the skill is in the Agent Toolkit for AWS repository
Using the skill with and without the AWS MCP Server
The skill is designed to run with the AWS MCP Server, which provides
authenticated API access and sandboxed script execution. Where the AWS MCP Server is
available, the agent uses its run_script tool to run OpenSearch Memory
operations. For setup, see Set up the AWS MCP Server.
The skill also works without the AWS MCP Server. Every operation in the skill
runs with the AWS CLI alone (for example, aws opensearchmemory create-space
or aws opensearchmemory search-memories). The skill includes instructions
that work with both approaches.
Prerequisites
-
An AI coding agent that supports the Agent Toolkit for AWS (such as Claude Code or Codex).
-
AWS credentials configured with permission for the OpenSearch Memory operations you intend to run. See Identity and Access Management for Amazon OpenSearch Memory.
-
An AWS Region where OpenSearch Memory is available. See Supported AWS Regions.
-
To run the skill without the AWS MCP Server, AWS CLI version 2.40.4 or later, the first version that includes the
aws opensearchmemorycommands. -
For the recommended setup, the AWS MCP Server. See Set up the AWS MCP Server.
Security considerations
When the agent runs OpenSearch Memory operations, it acts with the credentials you provide. Anything those credentials are authorized to do, the agent can trigger on your behalf.
-
Use least-privilege credentials. Grant only the
osm:actions the agent needs, scoped to specific space ARNs. For a read-only agent, grant only read actions such asosm:SearchMemories,osm:GetMemory, andosm:ListMemories. -
Isolate end users. Use one actor ID per end user, and restrict principals with the
osm:actorIdcondition key. See Identity and Access Management for Amazon OpenSearch Memory. -
Require explicit confirmation before the agent deletes a space, a memory, or an event. Deletions are permanent.
-
Don't put secrets or credentials in events, memories, or metadata.
-
Review tool output. MCP tool responses, including the events and memories the agent reads, are returned to the language model as context. Avoid running operations against spaces that contain sensitive data you don't want exposed to your model provider.