{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/grepr/json-schema/grepr-memory-detail-schema.json",
  "title": "MemoryDetail",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/grepr-agent-memory-api-openapi.yml#/components/schemas/MemoryDetail",
  "properties": {
    "contentRevision": {
      "format": "int32",
      "type": "integer"
    },
    "linkCount": {
      "format": "int64",
      "type": "integer"
    },
    "lockedTagKeys": {
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "memory": {
      "$ref": "#/$defs/MemorySearchResult"
    },
    "recurrences": {
      "items": {
        "$ref": "#/$defs/RecurrenceLink"
      },
      "type": "array"
    }
  },
  "type": "object",
  "$defs": {
    "MemoryReview": {
      "properties": {
        "editedAt": {
          "format": "date-time",
          "type": "string"
        },
        "verdictAt": {
          "format": "date-time",
          "type": "string"
        },
        "verdictNote": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "MemorySearchResult": {
      "properties": {
        "ageDays": {
          "format": "int64",
          "type": "integer"
        },
        "agentId": {
          "type": "string"
        },
        "investigationId": {
          "type": "string"
        },
        "lastSeenAt": {
          "format": "date-time",
          "type": "string"
        },
        "lastSeenDays": {
          "format": "int64",
          "type": "integer"
        },
        "matchedOn": {
          "enum": [
            "SEMANTIC",
            "TEXT",
            "TIMELINE",
            "LOOKUP"
          ],
          "type": "string"
        },
        "recencyLabel": {
          "enum": [
            "ACTIVE",
            "RECENT",
            "HISTORICAL"
          ],
          "type": "string"
        },
        "recordedAt": {
          "format": "date-time",
          "type": "string"
        },
        "recurrenceCount": {
          "format": "int32",
          "type": "integer"
        },
        "resolution": {
          "type": "string"
        },
        "review": {
          "$ref": "#/$defs/MemoryReview"
        },
        "rootCause": {
          "type": "string"
        },
        "rootCauseConfidence": {
          "enum": [
            "CONFIRMED",
            "SUSPECTED",
            "UNKNOWN"
          ],
          "type": "string"
        },
        "ruledOut": {
          "type": "string"
        },
        "score": {
          "format": "double",
          "type": "number"
        },
        "significance": {
          "enum": [
            "INCIDENT",
            "OBSERVATION",
            "INCONCLUSIVE",
            "BENIGN"
          ],
          "type": "string"
        },
        "symptoms": {
          "type": "string"
        },
        "tags": {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object"
        },
        "title": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "RecurrenceLink": {
      "properties": {
        "investigationId": {
          "type": "string"
        },
        "linkedAt": {
          "format": "date-time",
          "type": "string"
        }
      },
      "type": "object"
    }
  }
}