> ## 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 Fact

> Update the text or metadata of an existing agent fact

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

Updates the text or metadata of an existing agent fact. You can modify the fact content, its metadata, or both.

<Note>
  **Permission required:** `workspace_agent:fact_modify`
</Note>

### Path Parameters

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

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

<ParamField path="factId" type="string" required>
  Fact ID
</ParamField>

### Request Body

<ParamField body="fact" type="string">
  Updated fact text
</ParamField>

<ParamField body="metadata" type="object">
  Updated key-value metadata to attach to the fact
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X PATCH 'https://app.memorylake.ai/openapi/memorylake/api/v3/workspaces/ws-fe314186ccd18cde04d6af48a5afd79f/agents/agent-f8bf71ab17ed8eccad8c0e8ae708273f/facts/fact_4c5d6e7f8a9b' \
    -H 'Authorization: Bearer sk_xxxxxx' \
    -H 'Content-Type: application/json' \
    -d '{
      "fact": "Escalates billing disputes to the finance team",
      "metadata": {
        "category": "skills",
        "confidence": "high",
        "verified": true
      }
    }'
  ```
</RequestExample>

### Response

<ResponseField name="data" type="object">
  <Expandable title="Fact object">
    <ResponseField name="id" type="string">Unique fact identifier</ResponseField>
    <ResponseField name="fact" type="string">The fact text</ResponseField>
    <ResponseField name="metadata" type="object">Arbitrary key-value metadata attached to the fact</ResponseField>
    <ResponseField name="expired" type="boolean">Whether the fact has been forgotten</ResponseField>
    <ResponseField name="score" type="number">Relevance score</ResponseField>
    <ResponseField name="expiration_date" type="string|null">Scheduled expiration date, or `null` if the fact does not expire</ResponseField>
    <ResponseField name="created_at" type="string">Creation timestamp</ResponseField>
    <ResponseField name="updated_at" type="string">Last update timestamp</ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json Success (200) theme={null}
  {
    "success": true,
    "data": {
      "id": "fact-11a0e057d09877c9c492633fd60424fc",
      "fact": "Escalates billing disputes to the finance team",
      "metadata": {
        "category": "skills",
        "confidence": "high",
        "verified": true
      },
      "expired": false,
      "score": 0.92,
      "expiration_date": null,
      "created_at": "2025-05-20T10:00:00Z",
      "updated_at": "2025-06-22T08:30:00Z"
    }
  }
  ```
</ResponseExample>


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