Skip to main content

Create Memory Store

Creates a memory store for keeping an agent's long-term working notes.

Prerequisites

Endpoint and authentication configured. For details, see Overview and authentication.

Endpoint

POST /memory_stores

Request body

FieldRequiredTypeDescription
nameYesstringMemory store name, 1-255 characters
descriptionNostringPurpose description; an empty string is returned if omitted
metadataNoobjectCustom key-value pairs for business metadata; an empty object if omitted

Request example

curl -X POST "$AGENTSTUDIO_URL/memory_stores" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"name": "Project Knowledge","description": "Project conventions, decisions, and troubleshooting notes"}'

Response example

{
  "id": "memstore_xxx",
  "type": "memory_store",
  "name": "Project Knowledge",
  "description": "Project conventions, decisions, and troubleshooting notes",
  "metadata": {
    "team": "data"
  },
  "created_at": "2026-09-17T08:00:00Z",
  "updated_at": "2026-09-17T08:00:00Z"
}

Response fields

FieldTypeDescription
idstringMemory store ID, format memstore_xxx
typestringAlways memory_store
namestringMemory store name, 1-255 characters
descriptionstringPurpose description; an empty string if not set
metadataobjectCustom key-value pairs
archived_atstring | nullArchive time; omitted or null when not archived
created_atstringCreation time, ISO 8601 UTC
updated_atstringLast update time, ISO 8601 UTC

Error codes

HTTP statusError codeDescription
400invalid_request_errorInvalid parameters, path, limit, or pagination cursor
401InvalidApiKeyAPI key missing, invalid, or expired
403permission_errorInsufficient identity or resource access permissions
Flow Agent API
Sandbox API
RAG API
Long-term Memory
ParseX API
Security API
Framework Integration