{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/korely-ai/json-schema/korely-ai-memory-with-facts-schema.json",
  "title": "MemoryWithFacts",
  "x-generated": "2026-11-14",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/korely-ai-openapi.json#/components/schemas/MemoryWithFacts",
  "properties": {
    "id": {
      "type": "string",
      "title": "Id"
    },
    "content": {
      "type": "string",
      "title": "Content"
    },
    "user_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "User Id"
    },
    "agent_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Agent Id"
    },
    "run_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Run Id"
    },
    "client": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Client",
      "description": "The tool that wrote it: the X-Korely-Client header of the write, or the name an MCP client gave when it connected. A label, not a namespace: no read is scoped by it and the agent cap does not count it."
    },
    "kind": {
      "type": "string",
      "title": "Kind",
      "description": "`note`, or `session` for the log of a work session (`kind` of the write).",
      "default": "note"
    },
    "metadata": {
      "additionalProperties": true,
      "type": "object",
      "title": "Metadata"
    },
    "status": {
      "type": "string",
      "title": "Status",
      "description": "Whether this memory's typed facts are queryable yet: 'processing', 'ready', or 'error'. Extraction runs after the write returns, so a read taken immediately can legitimately find no facts. Poll GET /v1/events or read the memory again: no webhook says that extraction finished (`memory.created` is sent when the memory is stored, before its facts).",
      "default": "processing"
    },
    "created_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Created At"
    },
    "updated_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Updated At"
    },
    "facts": {
      "items": {
        "additionalProperties": true,
        "type": "object"
      },
      "type": "array",
      "title": "Facts",
      "default": []
    }
  },
  "type": "object",
  "required": [
    "id",
    "content",
    "user_id",
    "agent_id",
    "run_id",
    "metadata",
    "created_at",
    "updated_at"
  ]
}