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

# Resolve Memory Conflict

> Apply a resolution strategy to a memory conflict in a project

```
POST /openapi/memorylake/api/v3/workspaces/{workspaceId}/projects/{projectId}/memories/conflicts/{conflictId}/resolve
```

Applies a resolution strategy to a conflict. You can keep a designated fact, trust one side of a fact-vs-document conflict, or dismiss the conflict as a false positive.

<Note>
  **Permission required:** `project:mem_modify`
</Note>

### Path Parameters

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

<ParamField path="projectId" type="string" required>
  Project ID
</ParamField>

<ParamField path="conflictId" type="string" required>
  Conflict ID
</ParamField>

### Request Body

<ParamField body="strategy" type="string" required>
  Resolution strategy to apply:

  | Strategy         | What it does                                                                                         |
  | ---------------- | ---------------------------------------------------------------------------------------------------- |
  | `keep_fact`      | Keep the fact designated by `keep_fact_id` and forget the other conflicting facts                    |
  | `trust_fact`     | Trust the fact side of a fact-vs-document conflict                                                   |
  | `trust_document` | Trust the document side of a fact-vs-document conflict; conflicting facts are forgotten or rewritten |
  | `dismiss`        | Mark the conflict as resolved without changing any facts                                             |
</ParamField>

<ParamField body="keep_fact_id" type="string">
  ID of the fact to keep. Required when `strategy` is `keep_fact`.
</ParamField>

<RequestExample>
  ```bash Keep a fact theme={null}
  curl -X POST 'https://app.memorylake.ai/openapi/memorylake/api/v3/workspaces/ws_abc123/projects/proj_def456/memories/conflicts/conf-abc123/resolve' \
    -H 'Authorization: Bearer sk_xxxxxx' \
    -H 'Content-Type: application/json' \
    -d '{
      "strategy": "keep_fact",
      "keep_fact_id": "fact-002"
    }'
  ```

  ```bash Trust the document theme={null}
  curl -X POST 'https://app.memorylake.ai/openapi/memorylake/api/v3/workspaces/ws_abc123/projects/proj_def456/memories/conflicts/conf-abc123/resolve' \
    -H 'Authorization: Bearer sk_xxxxxx' \
    -H 'Content-Type: application/json' \
    -d '{
      "strategy": "trust_document"
    }'
  ```

  ```bash Dismiss theme={null}
  curl -X POST 'https://app.memorylake.ai/openapi/memorylake/api/v3/workspaces/ws_abc123/projects/proj_def456/memories/conflicts/conf-abc123/resolve' \
    -H 'Authorization: Bearer sk_xxxxxx' \
    -H 'Content-Type: application/json' \
    -d '{
      "strategy": "dismiss"
    }'
  ```
</RequestExample>

### Response

<ResponseField name="data" type="object">
  <Expandable title="Resolution result">
    <ResponseField name="id" type="string">Conflict identifier</ResponseField>
    <ResponseField name="resolved" type="boolean">Whether the conflict is now resolved</ResponseField>
    <ResponseField name="strategy" type="string">Applied resolution strategy</ResponseField>
    <ResponseField name="resolve_id" type="string">Resolution record identifier</ResponseField>
    <ResponseField name="forgotten_fact_ids" type="array">IDs of the facts forgotten as part of the resolution</ResponseField>
    <ResponseField name="updated_fact_ids" type="array">IDs of the facts rewritten as part of the resolution</ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json Success (200) theme={null}
  {
    "success": true,
    "data": {
      "id": "conf-abc123",
      "resolved": true,
      "strategy": "keep_fact",
      "resolve_id": "res-9f8e7d6c",
      "forgotten_fact_ids": ["fact-001"],
      "updated_fact_ids": []
    }
  }
  ```
</ResponseExample>
