You're viewing version 3.3 of the OpenSearch documentation. This version is no longer maintained. For the latest version, see the current documentation. For information about OpenSearch version maintenance, see Release Schedule and Maintenance Policy.
Update Memory Container API
Introduced 3.3
Use this API to update an existing memory container’s properties, such as name, description, configuration, and access permissions.
Endpoints
PUT /_plugins/_ml/memory_containers/<memory_container_id>
Path parameters
| Parameter | Data type | Required/Optional | Description |
|---|---|---|---|
memory_container_id | String | Required | The ID of the memory container to update. |
Request fields
| Field | Data type | Required/Optional | Description |
|---|---|---|---|
name | String | Optional | The updated name of the memory container. |
description | String | Optional | The updated description of the memory container. |
configuration | Object | Optional | The configuration object containing strategies and embedding settings. See The configuration object. |
The configuration object
The configuration object supports the following fields.
| Field | Data type | Required/Optional | Description |
|---|---|---|---|
llm_id | String | Optional | The large language model (LLM) ID to use to extract facts. |
strategies | Array | Optional | An array of strategy objects for memory processing. |
embedding_model_id | String | Optional | The embedding model ID. Can only be updated if no long-term memory index exists. |
embedding_model_type | String | Optional | The embedding model type. Can only be updated if no long-term memory index exists. |
embedding_dimension | Integer | Optional | The embedding dimension. Can only be updated if no long-term memory index exists. |
Update behavior
Note the following update behavior.
Strategy updates
- To update a specific strategy, specify the strategy
id. - To create a new strategy, specify a strategy without an
id.
Backend roles updates
- Adding new
backend_rolesgrants new users read or write access with those roles. - The new
backend_rolesfield overwrites the existing field, so include the original roles if you want to keep them.
Namespace updates
- The
namespacefield in thestrategiesobject is updated by overwriting. Include the original namespace if you want to keep it.
Embedding model restrictions
- The
embedding_model_id,embedding_model_type, andembedding_dimensionfields can only be updated if no long-term memory index has been created for this memory container. Once a long-term memory index with the specifiedindex_prefixis created, these embedding fields cannot be updated.
Example request
PUT /_plugins/_ml/memory_containers/HudqiJkB1SltqOcZusVU
{
"name": "opensearch-agents-memory",
"description": "Updated memory container for OpenSearch agents",
"backend_roles": ["admin", "ml_user"],
"configuration": {
"strategies": [
{
"id": "existing_strategy_id",
"type": "summarization",
"namespace": "updated_namespace"
},
{
"type": "keyword_extraction"
}
],
"embedding_model_id": "new_embedding_model",
"embedding_model_type": "dense",
"embedding_dimension": 768
}
}
Example response
{
"result": "updated",
"_id": "HudqiJkB1SltqOcZusVU",
"_version": 2,
"_shards": {
"total": 2,
"successful": 1,
"failed": 0
}
}
Response fields
The following table lists all response body fields.
| Field | Data type | Description |
|---|---|---|
result | String | The result of the update operation. |
_id | String | The ID of the updated memory container. |
_version | Integer | The version number of the updated memory container. |
_shards | Object | Information about the shards involved in the operation. |