Skip to content

Conversation

dhrubo-os
Copy link
Contributor

@dhrubo-os dhrubo-os commented Oct 1, 2025

  • Add long-term memory APIs: search, update, delete
  • Add memory history APIs: search, delete
  • Add general memory APIs: get, update, delete, search by type
  • Update add-memory API to include data type memory and structured data
  • Update index with complete API structure
  • Support for conversation memory, data memory, and trace data
  • Include namespace-based organization and tagging system
  • Remove experimental warning as agentic memory is GA in 3.3

Description

Describe what this change achieves.

Issues Resolved

Closes #11162

Version

3.3

Frontend features

If you're submitting documentation for an OpenSearch Dashboards feature, add a video that shows how a user will interact with the UI step by step. A voiceover is optional.

Checklist

  • By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and subject to the Developers Certificate of Origin.
    For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link

github-actions bot commented Oct 1, 2025

Thank you for submitting your PR. The PR states are In progress (or Draft) -> Tech review -> Doc review -> Editorial review -> Merged.

Before you submit your PR for doc review, make sure the content is technically accurate. If you need help finding a tech reviewer, tag a maintainer.

When you're ready for doc review, tag the assignee of this PR. The doc reviewer may push edits to the PR directly or leave comments and editorial suggestions for you to address (let us know in a comment if you have a preference). The doc reviewer will arrange for an editorial review.

- Add long-term memory APIs: search, update, delete
- Add memory history APIs: search, delete
- Add general memory APIs: get, update, delete, search by type
- Update add-memory API to include data type memory and structured data
- Update index with complete API structure
- Support for conversation memory, data memory, and trace data
- Include namespace-based organization and tagging system
- Remove experimental warning as agentic memory is GA in 3.3

Signed-off-by: Dhrubo Saha <[email protected]>
@kolchfa-aws
Copy link
Collaborator

@dhrubo-os Thank you for the PR! When you connect it to an issue, you have to leave "Closes", "Fixes", or "Resolves" so it's properly linked (in this case, Closes #11162). I updated the PR description.

@kolchfa-aws kolchfa-aws added Tech review PR: Tech review in progress release-notes PR: Include this PR in the automated release notes v3.3.0 labels Oct 2, 2025
@kolchfa-aws
Copy link
Collaborator

Hey @dhrubo-os , let me know when this PR is ready for doc review. We have 3 days left before the release.

- Remove redundant API files in favor of unified memory APIs
- Delete legacy files: delete-long-term-memory.md, delete-memory-history.md, search-long-term-memory.md, search-memory-history.md, update-long-term-memory.md, search-memory.md, delete-memory.md, update-memory.md, get-memory.md
- Enhance unified APIs with comprehensive examples for all memory types (sessions, working, long-term, history)
- Add metadata field documentation to add-memory.md and get-memory-by-type.md
- Update response examples and field documentation with actual API responses
- Update index.md to reflect clean unified API structure
- Fix memory type parameter names (sessions vs session) for consistency

Signed-off-by: Dhrubo Saha <[email protected]>
- Add missing update-memory-container.md and search-memory-container.md files
- Update create-memory-container.md with advanced features from Postman collection:
  * Multiple strategy support (SEMANTIC, USER_PREFERENCE, SUMMARY)
  * Strategy configuration with llm_result_path
  * Index configuration (index_prefix, use_system_index)
  * Remove experimental warning (GA in 3.3)
- Remove experimental feature reference from index.md
- All APIs now match actual implementation from Postman collection

Signed-off-by: Dhrubo Saha <[email protected]>
- Add default llm_result_path value: $.output.message.content[0].text (Bedrock Converse format)
- Document LLM connector requirement for system_prompt and user_prompt parameters
- Reference ml-commons PR opensearch-project#4283 for standardized connector format
- Clarify that default is optimized for Bedrock Converse API

Signed-off-by: Dhrubo Saha <[email protected]>
@dhrubo-os
Copy link
Contributor Author

Hey @dhrubo-os , let me know when this PR is ready for doc review. We have 3 days left before the release.

Yes please start reviewing the PR. Thanks


## Path parameters

| Parameter | Data type | Description |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://docs.opensearch.org/latest/ml-commons-plugin/api/agentic-memory-apis/create-memory-container/

Currently we have a separate column Required/Optional, can we follow the same format?

{: .warning}

Use this API to add an agentic memory to a [memory container]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/agentic-memory-apis/create-memory-container). You can create a memory in one of the following modes (controlled by the `infer` parameter):
Use this API to add an agentic memory to a [memory container]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/agentic-memory-apis/create-memory-container). You can create memories in two types:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Use this API to add an agentic memory to a [memory container]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/agentic-memory-apis/create-memory-container). You can create memories in two types:
Use this API to add an agentic memory to a [memory container]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/agentic-memory-apis/create-memory-container). You can provide memory payload in two types:

Use this API to add an agentic memory to a [memory container]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/agentic-memory-apis/create-memory-container). You can create a memory in one of the following modes (controlled by the `infer` parameter):
Use this API to add an agentic memory to a [memory container]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/agentic-memory-apis/create-memory-container). You can create memories in two types:

- **Conversation memory** -- Stores conversational messages between users and assistants. Can be processed (when `infer` is `true`) to extract facts or stored as raw messages.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **Conversation memory** -- Stores conversational messages between users and assistants. Can be processed (when `infer` is `true`) to extract facts or stored as raw messages.
- **conversational** -- Stores conversational messages between users and assistants.


- **Conversation memory** -- Stores conversational messages between users and assistants. Can be processed (when `infer` is `true`) to extract facts or stored as raw messages.

- **Data memory** -- Stores structured, non-conversational data such as agent state, checkpoints, or reference information.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **Data memory** -- Stores structured, non-conversational data such as agent state, checkpoints, or reference information.
- **data** -- Stores extra messages, structured, non-conversational data such as agent state, checkpoints, or reference information.


Memory processing modes (controlled by the `infer` parameter):

- Fact memory -- A processed representation of the message. The large language model (LLM) associated with the memory container extracts and stores key factual information or knowledge from the original text.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Fact memory -- A processed representation of the message. The large language model (LLM) associated with the memory container extracts and stores key factual information or knowledge from the original text.
- **infer=true** -- Use large language model (LLM) to extract key information or knowledge from the messages.


- Fact memory -- A processed representation of the message. The large language model (LLM) associated with the memory container extracts and stores key factual information or knowledge from the original text.

- Raw message memory -- The unprocessed message content.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **infer=false** -- Only store raw messages and data in working memory.

`session_id` | String | Optional | The session ID associated with the memory.
`agent_id` | String | Optional | The agent ID associated with the memory.
`infer` | Boolean | Optional | Controls whether the LLM infers context from messages. Default is `true`. When `true`, the LLM extracts factual information from the original text and stores it as the memory. When `false`, the memory contains the unprocessed message and you must explicitly specify the `role` in each message.
`messages` | List | Conditional | A list of messages for conversation memory. Each message requires `content` and may include a `role` (commonly, `user` or `assistant`) when `infer` is set to `true`. Required for `memory_type` of `conversation`.
Copy link
Contributor

@ylwu-amzn ylwu-amzn Oct 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`messages` | List | Conditional | A list of messages for conversation memory. Each message requires `content` and may include a `role` (commonly, `user` or `assistant`) when `infer` is set to `true`. Required for `memory_type` of `conversation`.
`messages` | List | Conditional | A list of messages for conversational payload. Each message requires `content` and may include a `role` (commonly, `user` or `assistant`) when `infer` is set to `true`. Required for `payload_type` of `conversational`.

`agent_id` | String | Optional | The agent ID associated with the memory.
`infer` | Boolean | Optional | Controls whether the LLM infers context from messages. Default is `true`. When `true`, the LLM extracts factual information from the original text and stores it as the memory. When `false`, the memory contains the unprocessed message and you must explicitly specify the `role` in each message.
`messages` | List | Conditional | A list of messages for conversation memory. Each message requires `content` and may include a `role` (commonly, `user` or `assistant`) when `infer` is set to `true`. Required for `memory_type` of `conversation`.
`structured_data` | Object | Conditional | Structured data content for data memory. Required for `memory_type` of `data`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`structured_data` | Object | Conditional | Structured data content for data memory. Required for `memory_type` of `data`.
`structured_data` | Map<String, Object> | Conditional | Structured data content for data memory. Required for `memory_type` of `data`.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a new row for binary_data

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And metadata also?

`infer` | Boolean | Optional | Controls whether the LLM infers context from messages. Default is `true`. When `true`, the LLM extracts factual information from the original text and stores it as the memory. When `false`, the memory contains the unprocessed message and you must explicitly specify the `role` in each message.
`messages` | List | Conditional | A list of messages for conversation memory. Each message requires `content` and may include a `role` (commonly, `user` or `assistant`) when `infer` is set to `true`. Required for `memory_type` of `conversation`.
`structured_data` | Object | Conditional | Structured data content for data memory. Required for `memory_type` of `data`.
`memory_type` | String | Required | The type of memory: `conversation` or `data`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`memory_type` | String | Required | The type of memory: `conversation` or `data`.
`payload_type` | String | Required | The type of payload: `conversational` or `data`.

`messages` | List | Conditional | A list of messages for conversation memory. Each message requires `content` and may include a `role` (commonly, `user` or `assistant`) when `infer` is set to `true`. Required for `memory_type` of `conversation`.
`structured_data` | Object | Conditional | Structured data content for data memory. Required for `memory_type` of `data`.
`memory_type` | String | Required | The type of memory: `conversation` or `data`.
`namespace` | Object | Optional | Namespace context for organizing memories (e.g., `user_id`, `session_id`, `agent_id`).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`namespace` | Object | Optional | Namespace context for organizing memories (e.g., `user_id`, `session_id`, `agent_id`).
`namespace` | List<String> | Optional | Namespace context for organizing memories (e.g., `user_id`, `session_id`, `agent_id`).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explain more details

If session_id not exists in namespace will create a new session and use the new session's id

| `memory` | String | The extracted long-term memory fact. |
| `strategy_type` | String | The type of memory strategy used (e.g., "SEMANTIC", "SUMMARY", "USER_PREFERENCE"). |
| `namespace` | Object | The namespace context for this memory. |
| `namespace_size` | Integer | The size of the namespace. |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In what units?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Integer? Like 1, 2, 3

Signed-off-by: Fanit Kolchina <[email protected]>
"data_type": "trace"
},
"infer": false,
"payload_type": "conversational"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be "data"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch. Yeah this should be data

Signed-off-by: Fanit Kolchina <[email protected]>
- Text embedding models: For semantic search capabilities.
- Large language models (LLMs): For inference and knowledge extraction.
- [Memory processing strategies](#memory-processing-strategies): For automatic content organization.
- [Namespaces](#namespaces): For organizing memories within containers.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For partitioning and isolating memories by context or user or agent or session


- Text embedding models: For semantic search capabilities.
- Large language models (LLMs): For inference and knowledge extraction.
- [Memory processing strategies](#memory-processing-strategies): For automatic content organization.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For defining how memories are processed or extracted

- A large language model (LLM) for reasoning over the message to produce factual or processed content. If no LLM is specified, messages are stored directly, without applying inference.
- A large language model (LLM) for reasoning over the message to produce factual or processed content. If no LLM is specified, messages are stored directly, without applying inference. Long term memory requires both an LLM model and embedding model to be configured.

**Note**: LLM connectors must support `system_prompt` and `user_prompt` parameters for agentic memory processing. The default `llm_result_path` is configured for Bedrock Converse API format (`"$.output.message.content[0].text"`).
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems repetitive at line 22?

Use this API to delete a specific memory by its type and ID or to delete memories matching a query. This unified API supports deleting memories of any [memory type]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/agentic-memory-apis/#memory-types): `sessions`, `working`, `long-term`, or `history`.

Use this API to delete an agentic memory by its ID.
## Delete a memory by type or ID
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type or ID seems, we need either of them, but we need both of them here.

Copy link
Collaborator

@natebower natebower left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Editorial review

### Backend roles updates

- Adding new `backend_roles` grants new users read or write access with those roles.
- The new `backend_roles` field overwrites the existing field, so include original roles if you want to keep them.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- The new `backend_roles` field overwrites the existing field, so include original roles if you want to keep them.
- The new `backend_roles` field overwrites the existing field, so include the original roles if you want to keep them.


OpenSearch provides two different memory systems:

- **[Memory APIs]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/memory-apis/index/)** - Simple conversation history storage for [conversational search]({{site.url}}{{site.baseurl}}/search-plugins/conversational-search/). Stores question/answer pairs chronologically without processing or learning.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **[Memory APIs]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/memory-apis/index/)** - Simple conversation history storage for [conversational search]({{site.url}}{{site.baseurl}}/search-plugins/conversational-search/). Stores question/answer pairs chronologically without processing or learning.
- **[Memory APIs]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/memory-apis/index/)** -- Simple conversation history storage for [conversational search]({{site.url}}{{site.baseurl}}/search-plugins/conversational-search/). Stores question/answer pairs chronologically without processing or learning.


- **[Memory APIs]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/memory-apis/index/)** - Simple conversation history storage for [conversational search]({{site.url}}{{site.baseurl}}/search-plugins/conversational-search/). Stores question/answer pairs chronologically without processing or learning.

- **[Agentic Memory APIs]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/agentic-memory-apis/)** - Intelligent memory system for AI agents. Uses LLMs to extract knowledge, learn user preferences, and maintain context across sessions. For conceptual information, see [Agentic memory]({{site.url}}{{site.baseurl}}/ml-commons-plugin/agents-tools/agentic-memory/).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **[Agentic Memory APIs]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/agentic-memory-apis/)** - Intelligent memory system for AI agents. Uses LLMs to extract knowledge, learn user preferences, and maintain context across sessions. For conceptual information, see [Agentic memory]({{site.url}}{{site.baseurl}}/ml-commons-plugin/agents-tools/agentic-memory/).
- **[Agentic Memory APIs]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/agentic-memory-apis/)** -- Intelligent memory system for AI agents. Uses large language models (LLMs) to extract knowledge, learn user preferences, and maintain context across sessions. For conceptual information, see [Agentic memory]({{site.url}}{{site.baseurl}}/ml-commons-plugin/agents-tools/agentic-memory/).


## Enable agentic memory

When set to `true`, this setting enables [agentic memory]({{site.url}}{{site.baseurl}}/agents-tools/agentic-memory/), which provides advanced memory management for AI agents including session memory, working memory, long-term memory, and memory history with namespace-based organization.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
When set to `true`, this setting enables [agentic memory]({{site.url}}{{site.baseurl}}/agents-tools/agentic-memory/), which provides advanced memory management for AI agents including session memory, working memory, long-term memory, and memory history with namespace-based organization.
When set to `true`, this setting enables [agentic memory]({{site.url}}{{site.baseurl}}/agents-tools/agentic-memory/), which provides advanced memory management for AI agents, including session memory, working memory, long-term memory, and memory history with namespace-based organization.


| Field | Data type | Required/Optional | Description |
| :--- | :--- | :--- | :--- |
| `llm_id` | String | Optional | The large language model ID to use to extract facts. |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `llm_id` | String | Optional | The large language model ID to use to extract facts. |
| `llm_id` | String | Optional | The large language model (LLM) ID to use to extract facts. |

Copy link
Collaborator

@natebower natebower left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Editorial review

Copy link
Collaborator

@natebower natebower left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@natebower natebower added Doc review PR: Doc review in progress and removed Tech review PR: Tech review in progress labels Oct 13, 2025
@natebower
Copy link
Collaborator

Please fix Jekyll build failure

Signed-off-by: Fanit Kolchina <[email protected]>
@natebower natebower removed the Doc review PR: Doc review in progress label Oct 13, 2025
@natebower
Copy link
Collaborator

@kolchfa-aws Can you resolve conflicts as well? Thanks!

- [Delete memory container]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/agentic-memory-apis/delete-memory-container/)
- [Search memory container]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/agentic-memory-apis/search-memory-container/)

OpenSearch supports the following memory APIs:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed create session api ? opensearch-project/ml-commons#4246


```json
DELETE /_plugins/_ml/memory_containers/{memory_container_id}
DELETE /_plugins/_ml/memory_containers/<memory_container_id>
Copy link
Contributor

@ylwu-amzn ylwu-amzn Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This API supports two parameters

  1. delete_all_memories: control delete all memory indices or not when delete container. Default is false. That means the memory index (sessions/working/long-term/history) will not be deleted when delete container
  2. delete_memories : array of memory types , defines deleting which memory index when delete container. Default is empty array. User can set as "delete_memories=sessions,working"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-notes PR: Include this PR in the automated release notes v3.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DOC] Agentic Memory enhancements for GA release

5 participants