Use the UpdateMemoryStore operation to update the description, extraction instructions, or output types of a memory store. The operation uses PATCH semantics: only the fields that are provided in the request are updated, and the fields that are not provided remain unchanged.
Prerequisites
-
An AgentStorage instance has been created and is in the
normalstate, and the instance endpoint and instance name have been obtained. -
An API Key has been created.
-
The target memory store already exists. The
inputTypecannot be modified after creation, so this operation does not accept that field.
Request parameters
|
Field |
Type |
Required |
Description |
|
|
string |
Yes |
The name of the memory store. |
|
|
string |
No |
The new description. It can be up to 1024 bytes (UTF-8) in length. Pass an empty string to clear it. |
|
|
string |
No |
The new custom extraction instructions. They can be up to 4096 characters in length. Pass an empty string to clear them. |
|
|
array |
No |
Fully replaces the current set of output types.
|
The inputType cannot be modified after creation, so this operation does not accept that field. After a successful update, the response structure is the same as that of GetMemoryStore.
Request examples
When you use API Key authentication, pass the instance name and API Key in the x-ots-instancename and x-ots-apikey request headers.
curl -X POST https://<endpoint>/UpdateMemoryStore \
-H "x-ots-instancename: <instance-name>" \
-H "x-ots-apikey: <your-api-key>" \
-H "Content-Type: application/json" \
-d '{
"memoryStoreName": "agent_memory",
"outputTypes": ["structured", "file"]
}'
Update only the description:
{
"memoryStoreName": "agent_memory",
"description": "Conversation memory for a shopping assistant"
}