> ## Documentation Index
> Fetch the complete documentation index at: https://docs.memorylake.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# 更新 Actor 记忆设置

> 设置或清空决定 Actor 在工作空间中的记忆记录哪些内容的说明

```
PATCH /openapi/memorylake/api/v3/workspaces/{workspaceId}/actors/{actorId}/settings
```

部分更新 Actor 在工作空间中的记忆设置。未提供的字段保持不变。改动只作用于这个工作空间。

新的 `fact_instruction` 会整体替换当前值，而不是追加。它从下一次提取关于该 Actor 的事实时开始生效，已经记录的事实保持不变。

已删除的 Actor 的设置仍可读取，但不能再修改：请求返回 `404` 和 `ACTOR_INACTIVE`。

此端点接收代表人的 Actor ID。Agent 请使用[更新 Agent 记忆设置](/features/memorylake/api-reference/memory-settings/update-agent-memory-settings)。

### 路径参数

<ParamField path="workspaceId" type="string" required>
  工作空间 ID
</ParamField>

<ParamField path="actorId" type="string" required>
  Actor ID
</ParamField>

### 请求体

<ParamField body="fact_instruction" type="string">
  这份记忆是关于什么的、不包含什么，Markdown 格式，最多 2000 个字符。传空字符串可清空它，恢复内置默认值。[起草 Actor 事实提取说明](/features/memorylake/api-reference/memory-settings/draft-actor-fact-instruction)可以帮您写一版。
</ParamField>

<RequestExample>
  ```bash Set the instruction theme={null}
  curl -X PATCH 'https://app.memorylake.cn/openapi/memorylake/api/v3/workspaces/ws-8001856949ad4f6a5b6226f415ffa877/actors/actor-3f9c2a7e5b1d4c8e9a6f0b2d7e4c1a95/settings' \
    -H 'Authorization: Bearer sk_xxxxxx' \
    -H 'Content-Type: application/json' \
    -d '{
      "fact_instruction": "某个人的个人档案。\n\n## 包括\n- 职位、所在团队和负责的产品\n- 希望别人如何配合工作\n\n## 不包括\n- 任何单个项目的记录\n- 关于助理的任何内容"
    }'
  ```

  ```bash Clear the instruction theme={null}
  curl -X PATCH 'https://app.memorylake.cn/openapi/memorylake/api/v3/workspaces/ws-8001856949ad4f6a5b6226f415ffa877/actors/actor-3f9c2a7e5b1d4c8e9a6f0b2d7e4c1a95/settings' \
    -H 'Authorization: Bearer sk_xxxxxx' \
    -H 'Content-Type: application/json' \
    -d '{
      "fact_instruction": ""
    }'
  ```
</RequestExample>

### 响应

返回更新后的记忆设置。

<ResponseField name="data" type="object">
  <Expandable title="记忆设置对象">
    <ResponseField name="fact_instruction" type="string">这份记忆是关于什么的、不包含什么，Markdown 格式。空字符串表示尚未设置，当前生效的是内置默认值。</ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json Success (200) theme={null}
  {
    "success": true,
    "data": {
      "fact_instruction": "某个人的个人档案。\n\n## 包括\n- 职位、所在团队和负责的产品\n- 希望别人如何配合工作\n\n## 不包括\n- 任何单个项目的记录\n- 关于助理的任何内容"
    }
  }
  ```

  ```json Actor deleted (404) theme={null}
  {
    "success": false,
    "message": "Actor 'actor-3f9c2a7e5b1d4c8e9a6f0b2d7e4c1a95' is inactive because it has been deleted. Its existing memories stay readable, but it can no longer take part in writes.",
    "error_code": "ACTOR_INACTIVE"
  }
  ```
</ResponseExample>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.