All Products
Search
Document Center

Tablestore:Create a memory store

Last Updated:Sep 24, 2026

Use the CreateMemoryStore interface to create a memory store in the current AgentStorage instance.

Prerequisites

  • An AgentStorage instance has been created and is in the normal state, and you have obtained the instance endpoint and instance name.

  • An API Key has been created.

  • Before creation, plan the combination of input and output types. inputType cannot be modified after creation.

Request parameters

Field

Type

Required

Description

memoryStoreName

string

Yes

The name of the memory store. It can only contain letters, digits, and underscores, with a maximum of 32 characters.

description

string

No

The description of the memory store, with a maximum of 1024 bytes (UTF-8).

extractInstructions

string

No

Custom memory extraction instructions, with a maximum of 4096 characters.

inputType

string

Conditionally required

The input type: messages or file. When using the new type fields, it must be provided together with outputTypes. It cannot be modified after creation.

outputTypes

array

Conditionally required

The set of output types, whose elements are structured or file. When using the new type fields, it must be provided together with inputType.

storageMode

string

No

Compatibility field: ots, file+ots, or filemem. It cannot be provided together with inputType or outputTypes. New requests are recommended to use the new type fields.

The supported input and output combinations are as follows.

inputType

outputTypes

Description

messages

["structured"]

Generate structured memory from messages.

messages

["file"]

Generate read-only memory files from messages.

messages

["structured", "file"]

Generate both structured memory and read-only memory files.

file

["file"]

The application directly manages memory files.

When no type field is provided, for compatibility with existing calls, a memory store with messages input and structured output is created by default.

Request example

When using API Key authentication, pass the instance name and API Key through the x-ots-instancename and x-ots-apikey request headers.

curl -X POST https://<endpoint>/CreateMemoryStore \
  -H "x-ots-instancename: <instance-name>" \
  -H "x-ots-apikey: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
  "memoryStoreName": "agent_memory",
  "description": "Agent conversation memory store",
  "extractInstructions": "Focus on the user's dietary preferences and travel habits",
  "inputType": "messages",
  "outputTypes": ["structured", "file"]
}'

Create a memory store whose files are directly managed by the application:

{
  "memoryStoreName": "agent_files",
  "inputType": "file",
  "outputTypes": ["file"]
}

Response

{
  "otsInstance": "your-instance-name",
  "memoryStoreName": "agent_memory",
  "description": "Agent conversation memory store",
  "extractInstructions": "Focus on the user's dietary preferences and travel habits",
  "inputType": "messages",
  "outputTypes": ["structured", "file"],
  "createdAt": "2026-08-31T07:19:48.935Z",
  "updatedAt": "2026-08-31T07:19:48.935Z"
}

For a memory store created with the new type fields, the response does not return storageMode. When created with the compatibility field, the response returns the normalized inputType, outputTypes, and storageMode together.