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

# Update Agent Memory Settings

> Set or clear the instruction that decides what an agent's memory records in a workspace

```
PATCH /openapi/memorylake/api/v3/workspaces/{workspaceId}/agents/{agentId}/settings
```

Partially updates an agent's memory settings in a workspace. Fields you leave out stay unchanged. The change applies to this workspace only.

A new `fact_instruction` replaces the current one whole; it is not appended to. It takes effect the next time facts are extracted into the agent's memory. Facts already recorded stay as they are.

If the agent has been deleted, its settings can still be read but no longer changed: the request returns `404` with `NOT_FOUND`.

### Path Parameters

<ParamField path="workspaceId" type="string" required>
  Workspace identifier
</ParamField>

<ParamField path="agentId" type="string" required>
  Agent identifier
</ParamField>

### Request Body

<ParamField body="fact_instruction" type="string">
  What this memory is about and what it is not, in Markdown, at most 2,000 characters. Send an empty string to clear it and put the built-in default back in effect. [Draft Agent Fact Instruction](/features/memorylake/api-reference/memory-settings/draft-agent-fact-instruction) can write one for you.
</ParamField>

<RequestExample>
  ```bash Set the instruction theme={null}
  curl -X PATCH 'https://app.memorylake.ai/openapi/memorylake/api/v3/workspaces/ws-8001856949ad4f6a5b6226f415ffa877/agents/agent-7d2e9b4f1c6a4e3b8f5d0a9c2e7b6f13/settings' \
    -H 'Authorization: Bearer sk_xxxxxx' \
    -H 'Content-Type: application/json' \
    -d '{
      "fact_instruction": "The working profile of the support assistant.\n\n## Include\n- Which products it answers questions about\n- Tools it must use and the limits it works within\n- Corrections users have made to its answers\n\n## Exclude\n- Facts about any specific person"
    }'
  ```

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

### Response

Returns the memory settings after the update.

<ResponseField name="data" type="object">
  <Expandable title="Memory settings object">
    <ResponseField name="fact_instruction" type="string">What this memory is about and what it is not, in Markdown. An empty string means none has been set and the built-in default is in effect.</ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json Success (200) theme={null}
  {
    "success": true,
    "data": {
      "fact_instruction": "The working profile of the support assistant.\n\n## Include\n- Which products it answers questions about\n- Tools it must use and the limits it works within\n- Corrections users have made to its answers\n\n## Exclude\n- Facts about any specific person"
    }
  }
  ```
</ResponseExample>


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