{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/kagura-ai-com/json-schema/kagura-ai-com-patch-memory-request-schema.json",
  "title": "PatchMemoryRequest",
  "description": "Request schema for ``PATCH /api/v1/memory/{memory_id}`` (Issue #439).\n\nUUID-addressed partial update. ``memory_id`` is the URL path param, not a\nbody field — there is intentionally no ``external_id`` upsert mode here\n(use the existing ``update_memory`` MCP tool for that).\n\nAll fields are optional. Only fields explicitly provided are updated;\nomitted fields preserve their current value. ``tags`` follows replace-all\nsemantics (an empty list clears tags; a non-empty list replaces the\nwhole list); ``add_tags`` / ``remove_tags`` and ``details_patch`` edit the\nstored list and details instead (#2585, see ``UpdateMemoryRequest``).\n``scope`` and ``context_id`` are intentionally excluded — they have\northogonal lifecycles handled by separate operations.\n``accept_supersede_candidate`` / ``dismiss_supersede_candidate`` (#2600)\nare update_memory's flags with its rules: the web dialog's accept runs\nthe same path, so the edge is kept under the carrier's author.",
  "x-generated": "2026-11-13",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/kagura-ai-com-openapi.json#/components/schemas/PatchMemoryRequest",
  "properties": {
    "summary": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 500,
          "minLength": 10
        },
        {
          "type": "null"
        }
      ],
      "title": "Summary"
    },
    "content": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 1
        },
        {
          "type": "null"
        }
      ],
      "title": "Content"
    },
    "type": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 50,
          "minLength": 1
        },
        {
          "type": "null"
        }
      ],
      "title": "Type"
    },
    "importance": {
      "anyOf": [
        {
          "type": "number",
          "maximum": 1.0,
          "minimum": 0.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Importance"
    },
    "tags": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 100
        },
        {
          "type": "null"
        }
      ],
      "title": "Tags"
    },
    "add_tags": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 100
        },
        {
          "type": "null"
        }
      ],
      "title": "Add Tags",
      "description": "Tags to append to the stored list (each once, in order; not with tags). Applied after remove_tags."
    },
    "remove_tags": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Remove Tags",
      "description": "Tags to remove from the stored list; one that is not there is ignored (not with tags)."
    },
    "details": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Details"
    },
    "details_patch": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Details Patch",
      "description": "Shallow merge into the stored details (a NULL column merges into {}); a null value deletes the key (not with details)."
    },
    "observed_at": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 40
        },
        {
          "type": "null"
        }
      ],
      "title": "Observed At"
    },
    "expected_version": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 1.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Expected Version"
    },
    "dismiss_supersede_candidate": {
      "type": "boolean",
      "title": "Dismiss Supersede Candidate",
      "description": "Reject the memory's current supersede_candidate (the pair is tombstoned; neither memory is deleted). May share the patch with field edits.",
      "default": false
    },
    "accept_supersede_candidate": {
      "type": "boolean",
      "title": "Accept Supersede Candidate",
      "description": "Accept the memory's current supersede_candidate: a declared supersedes edge from this memory to the candidate. No field edits in the same patch.",
      "default": false
    }
  },
  "type": "object"
}