{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/korely-ai/json-schema/korely-ai-fact-body-schema.json",
  "title": "FactBody",
  "x-generated": "2026-11-14",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/korely-ai-openapi.json#/components/schemas/FactBody",
  "properties": {
    "subject": {
      "type": "string",
      "maxLength": 200,
      "minLength": 1,
      "title": "Subject"
    },
    "predicate": {
      "type": "string",
      "maxLength": 200,
      "minLength": 1,
      "title": "Predicate"
    },
    "object": {
      "type": "string",
      "maxLength": 500,
      "minLength": 1,
      "title": "Object"
    },
    "user_id": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 255
        },
        {
          "type": "null"
        }
      ],
      "title": "User Id",
      "description": "End user this fact is about. One of user_id and agent_id is required: with neither (or only ids made of spaces, format characters or marks) the write is a 422 `identity_required`; run_id alone is not enough. 1 to 255 characters, no '/', no control character or other line break, and not '.' or '..': the id names a namespace that DELETE /v1/users/<user_id>/memories and DELETE /v1/agents/<agent_id> address as one URL path segment."
    },
    "agent_id": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 255
        },
        {
          "type": "null"
        }
      ],
      "title": "Agent Id",
      "description": "Agent namespace: the agent writing. One of user_id and agent_id is required: with neither (or only ids made of spaces, format characters or marks) the write is a 422 `identity_required`; run_id alone is not enough. 1 to 255 characters, no '/', no control character or other line break, and not '.' or '..': the id names a namespace that DELETE /v1/users/<user_id>/memories and DELETE /v1/agents/<agent_id> address as one URL path segment."
    },
    "run_id": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 255
        },
        {
          "type": "null"
        }
      ],
      "title": "Run Id"
    },
    "subject_type": {
      "type": "string",
      "maxLength": 20,
      "title": "Subject Type",
      "description": "What the subject is: any type of up to 20 characters, stored as sent on a new fact (an empty one as `unknown`). A write that restates a fact already true keeps the type the fact was first stored with, and POST answers that fact's id. Extraction gives one of `concept`, `event`, `organization`, `person`, `place`, `product`, `unknown`. `self` (lower case, matched exactly): GET /v1/profile counts a fact so typed as one about the end user and lists it first, as it does a fact whose subject is the end user's id. The context block of GET /v1/context does not read the type: it tells the end user by the subject.",
      "default": "unknown"
    },
    "object_is_literal": {
      "type": "boolean",
      "title": "Object Is Literal",
      "default": false
    },
    "confidence": {
      "type": "number",
      "maximum": 1.0,
      "minimum": 0.0,
      "title": "Confidence",
      "default": 0.9
    },
    "valid_from": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Valid From"
    },
    "tense": {
      "type": "string",
      "enum": [
        "current",
        "past",
        "planned"
      ],
      "title": "Tense",
      "description": "current | past | planned. A past fact closes the open fact it restates.",
      "default": "current"
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "subject",
    "predicate",
    "object"
  ]
}