{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/gnosem-dev/json-schema/gnosem-dev-export-schema.json",
  "title": "Export",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/gnosem-dev-openapi.json#/components/schemas/Export",
  "type": "object",
  "required": [
    "format",
    "exported_at",
    "user_id",
    "plan",
    "counts",
    "memories"
  ],
  "properties": {
    "format": {
      "type": "string",
      "const": "gnosem/export/v1"
    },
    "exported_at": {
      "type": "integer",
      "description": "ms epoch"
    },
    "user_id": {
      "type": "string",
      "format": "uuid"
    },
    "plan": {
      "type": "string"
    },
    "counts": {
      "type": "object",
      "properties": {
        "memories": {
          "type": "integer"
        },
        "includes_forgotten": {
          "type": "boolean"
        },
        "includes_superseded": {
          "type": "boolean"
        }
      }
    },
    "memories": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Memory"
      }
    }
  },
  "$defs": {
    "Memory": {
      "type": "object",
      "required": [
        "id",
        "content",
        "tags",
        "created_at"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "content": {
          "type": "string",
          "description": "Raw prose OR LLM-optimized structured facts (depending on `raw` flag on the read tool)."
        },
        "content_raw": {
          "type": "string",
          "description": "Present when the compressed form was returned as `content`."
        },
        "content_optimized": {
          "type": [
            "string",
            "null"
          ]
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "written_by": {
          "type": [
            "string",
            "null"
          ]
        },
        "session_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "created_at": {
          "type": "integer",
          "description": "ms epoch"
        },
        "superseded_by": {
          "type": "string",
          "format": "uuid"
        },
        "forgotten_at": {
          "type": "integer"
        },
        "score": {
          "type": "number",
          "description": "Cosine similarity; only on search results."
        }
      }
    }
  }
}