文档首页/ 智果(AgentArts)智能体平台/ API参考/ API/ 记忆库/ 记忆库管理/ 更新记忆空间相关配置 - UpdateCoreSpace
更新时间:2026-06-10 GMT+08:00
分享

更新记忆空间相关配置 - UpdateCoreSpace

功能介绍

更新记忆空间相关配置,涉及名称、策略等。

调用方法

请参见如何调用API

URI

PUT /v1/core/spaces/{space_id}

表1 路径参数

参数

是否必选

参数类型

描述

space_id

String

参数解释:

记忆空间 ID,唯一标识一个记忆空间,可通过"创建Space"接口获取。

约束限制:

仅支持字母、数字和中划线。

取值范围:

长度1-48字符。

默认取值:

不涉及。

请求参数

表2 请求Body参数

参数

是否必选

参数类型

描述

name

String

参数解释:

记忆空间名称。

约束限制:

支持字母、数字和中划线。

取值范围:

长度1-48字符。

默认取值:

不涉及。

description

String

参数解释:

记忆空间描述。

约束限制:

不涉及。

取值范围:

不超过1000长度的字符串。

默认取值:

不涉及。

message_ttl_hours

Integer

参数解释:

Message过期时间(小时)。

约束限制:

最大8760个小时(365天)。

取值范围:

1-8760

默认取值:

不涉及。

memory_extract_enabled

Boolean

参数解释:

是否开启记忆抽取。

约束限制:

不涉及。

取值范围:

  • true: 开启记忆抽取

  • false: 关闭记忆抽取

默认取值:

不涉及。

memory_extract_idle_seconds

Integer

参数解释:

触发记忆抽取空闲时间(秒)。

约束限制:

不涉及。

取值范围:

10-86400(24小时)

默认取值:

不涉及。

memory_extract_max_tokens

Integer

参数解释:

触发记忆抽取最大累计 token 数。

约束限制:

不涉及。

取值范围:

1000-1073741824

默认取值:

不涉及。

memory_extract_max_messages

Integer

参数解释:

触发记忆抽取最大累计 message 数。

约束限制:

不涉及。

取值范围:

3-10000

默认取值:

不涉及。

tags

Array of CoreSpaceTag objects

参数解释:

库标签列表。

约束限制:

数组长度0-20个;键最大长度36字符,不允许为空;值最大长度43字符,可以为空。

取值范围:

不涉及。

默认取值:

不涉及。

memory_strategies_builtin

Array of strings

参数解释:

内置策略类型列表。

约束限制:

数组长度0-10个。

取值范围:

不涉及。

默认取值:

不涉及。

表3 CoreSpaceTag

参数

是否必选

参数类型

描述

key

String

参数解释:

标签key。

取值范围:

不涉及。

value

String

参数解释:

标签value。

取值范围:

不涉及。

响应参数

状态码:200

更新成功

状态码:400

表4 响应Body参数

参数

参数类型

描述

error_code

String

参数解释:

错误码,标识错误类型,格式为 AgentArts.XXXXXXXX。

取值范围:

不涉及。

error_msg

String

参数解释:

错误信息,描述错误详情,供问题排查使用。

取值范围:

不涉及。

状态码:401

表5 响应Body参数

参数

参数类型

描述

error_code

String

参数解释:

错误码,标识错误类型,格式为 AgentArts.XXXXXXXX。

取值范围:

不涉及。

error_msg

String

参数解释:

错误信息,描述错误详情,供问题排查使用。

取值范围:

不涉及。

状态码:403

表6 响应Body参数

参数

参数类型

描述

error_code

String

参数解释:

错误码,标识错误类型,格式为 AgentArts.XXXXXXXX。

取值范围:

不涉及。

error_msg

String

参数解释:

错误信息,描述错误详情,供问题排查使用。

取值范围:

不涉及。

encoded_authorization_message

String

参数解释:

编码后的授权失败信息。

取值范围:

不涉及。

details

Array of CoreSpaceCommonError objects

参数解释:

依赖的下游服务错误信息列表,包含导致当前请求失败的下游服务错误详情。

取值范围:

不涉及。

表7 CoreSpaceCommonError

参数

参数类型

描述

error_code

String

参数解释:

错误码,标识错误类型,格式为 AgentArts.XXXXXXXX。

取值范围:

不涉及。

error_msg

String

参数解释:

错误信息,描述错误详情,供问题排查使用。

取值范围:

不涉及。

状态码:404

表8 响应Body参数

参数

参数类型

描述

error_code

String

参数解释:

错误码,标识错误类型,格式为 AgentArts.XXXXXXXX。

取值范围:

不涉及。

error_msg

String

参数解释:

错误信息,描述错误详情,供问题排查使用。

取值范围:

不涉及。

状态码:429

表9 响应Body参数

参数

参数类型

描述

error_code

String

参数解释:

错误码,标识错误类型,格式为 AgentArts.XXXXXXXX。

取值范围:

不涉及。

error_msg

String

参数解释:

错误信息,描述错误详情,供问题排查使用。

取值范围:

不涉及。

状态码:500

表10 响应Body参数

参数

参数类型

描述

error_code

String

参数解释:

错误码,标识错误类型,格式为 AgentArts.XXXXXXXX。

取值范围:

不涉及。

error_msg

String

参数解释:

错误信息,描述错误详情,供问题排查使用。

取值范围:

不涉及。

请求示例

/v1/core/spaces/123e4567-e89b-12d3-a456-426614174000

{
  "name" : "string",
  "description" : "string",
  "message_ttl_hours" : 1,
  "memory_extract_enabled" : false,
  "memory_extract_idle_seconds" : 10,
  "memory_extract_max_tokens" : 1000,
  "memory_extract_max_messages" : 3,
  "tags" : [ {
    "key" : "Environment",
    "value" : "production"
  } ],
  "memory_strategies_builtin" : [ "semantic", "user_preference" ]
}

响应示例

状态码:200

更新成功

{
  "id" : "123e4567-e89b-12d3-a456-426614174000",
  "name" : "space-01",
  "description" : "test-environment",
  "message_ttl_hours" : 168,
  "memory_extract_enabled" : true,
  "memory_extract_idle_seconds" : 60,
  "memory_extract_max_tokens" : 10000,
  "memory_extract_max_messages" : 100,
  "memory_strategies_builtin" : [ {
    "name" : "semantic-memory",
    "type" : "semantic",
    "steps" : [ {
      "step_order" : 1,
      "step_type" : "extraction",
      "isolation_level" : null,
      "instruction" : "You are a long-term memory extraction agent supporting a lifelong learning system. Your task is to identify and extract meaningful information about the users from a given list of messages. ...(truncated)",
      "output_schema" : "<schema>{...SemanticMemory schema...}</schema>\n<conversation>\n{messages}\n</conversation>"
    }, {
      "step_order" : 2,
      "step_type" : "consolidation",
      "isolation_level" : "actor",
      "instruction" : "You are a conservative memory manager that preserves existing information while carefully integrating new facts. Operations: AddMemory, UpdateMemory, SkipMemory. ...(truncated)",
      "output_schema" : "<new_content>\n{new_content}\n</new_content>\n<existing_memories>\n{historical_memories}\n</existing_memories>"
    } ]
  } ],
  "memory_strategies_customized" : [ {
    "id" : "456e7890-e89b-12d3-a456-426614174000",
    "name" : "user-preference-strategy",
    "type" : "user_preference",
    "origin_type" : "user",
    "steps" : [ {
      "id" : "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "step_order" : 1,
      "step_type" : "extraction",
      "isolation_level" : "actor",
      "instruction" : "string",
      "output_schema" : "string",
      "enabled" : true,
      "created_at" : "2025-01-18T10:00:00.000Z",
      "updated_at" : "2025-01-18T10:00:00.000Z"
    } ],
    "created_at" : "2025-01-18T10:00:00.000Z",
    "updated_at" : "2025-01-18T10:00:00.000Z"
  } ],
  "vpc_id" : "string",
  "subnet_id" : "string",
  "private_access" : {
    "domain_name" : "123e4567-e89b-12d3-a456-426614174000.cn-north-4.memory.agentarts.myhuawei.com",
    "ip" : "120.46.xxx.xxx"
  },
  "public_access" : {
    "domain_name" : "123e4567-e89b-12d3-a456-426614174000.cn-north-4.memory.agentarts.myhuawei.com",
    "ip" : "120.46.xxx.xxx"
  },
  "api_key" : {
    "id" : "key-uuid",
    "masked_key" : "sk-***1234"
  },
  "tags" : [ {
    "key" : "Environment",
    "value" : "production"
  } ],
  "status" : "creating",
  "created_at" : "2025-01-18T10:00:00.000Z",
  "updated_at" : "2025-01-18T10:00:00.000Z"
}

状态码:400

请求参数错误

{
  "error_code" : "AgentArts.01010001",
  "error_msg" : "Invalid request parameter format"
}

状态码:401

认证失败

{
  "error_code" : "AgentArts.01020002",
  "error_msg" : "Authentication failed"
}

状态码:403

权限不足

{
  "error_code" : "AgentArts.01010002",
  "error_msg" : "Insufficient permissions"
}

状态码:404

Space不存在

{
  "error_code" : "AgentArts.01010005",
  "error_msg" : "Specified space does not exist"
}

状态码:429

请求过于频繁

{
  "error_code" : "AgentArts.01020008",
  "error_msg" : "Too many requests"
}

状态码:500

内部服务错误

{
  "error_code" : "AgentArts.01010008",
  "error_msg" : "Internal service error"
}

状态码

状态码

描述

200

更新成功

400

请求参数错误

401

认证失败

403

权限不足

404

Space不存在

429

请求过于频繁

500

内部服务错误

错误码

请参见错误码

相关文档