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

name string (必选)Memory store name, 1-255 charactersdescription string (可选)Purpose description; an empty string is returned if omittedmetadata object (可选)Custom 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 fields

id stringMemory store ID, format memstore_xxxtype stringAlways memory_storename stringMemory store name, 1-255 charactersdescription stringPurpose description; an empty string if not setmetadata objectCustom key-value pairsarchived_at string | nullArchive time; omitted or null when not archivedcreated_at stringCreation time, ISO 8601 UTCupdated_at stringLast update time, ISO 8601 UTC

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"
}

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