View a markdown version of this page

amazon-opensearch-memory skill - Amazon OpenSearch Service
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

amazon-opensearch-memory skill

amazon-opensearch-memory is a skill in the Agent Toolkit for Amazon 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 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 Amazon 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 Amazon. You have two options:

  • Discover it at runtime through the Amazon MCP Server. With the Amazon MCP Server configured (see Set up the Amazon MCP Server), your agent finds the skill on demand using the server's search_documentation tool and loads it with retrieve_skill – no local install required.

  • Install it with the Amazon CLI. The following command installs the skill to the AI coding agents that the Agent Toolkit for Amazon detects on your system. This command requires Amazon CLI version 2.35.0 or later. For more information, see Amazon CLI in the Agent Toolkit for Amazon documentation.

    aws agent-toolkit add-skill --skill-name amazon-opensearch-memory

The source of the skill is in the Agent Toolkit for Amazon repository on GitHub.

Using the skill with and without the Amazon MCP Server

The skill is designed to run with the Amazon MCP Server, which provides authenticated API access and sandboxed script execution. Where the Amazon MCP Server is available, the agent uses its run_script tool to run OpenSearch Memory operations. For setup, see Set up the Amazon MCP Server.

The skill also works without the Amazon MCP Server. Every operation in the skill runs with the Amazon CLI alone (for example, aws opensearchmemory create-space or aws opensearchmemory search-memories). The skill includes instructions that work with both approaches.

Prerequisites

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 as osm:SearchMemories, osm:GetMemory, and osm:ListMemories.

  • Isolate end users. Use one actor ID per end user, and restrict principals with the osm:actorId condition 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.