{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/antfly/json-schema/antfly-created-index-schema.json",
  "title": "CreatedIndex",
  "description": "Discriminated normalized configuration returned after an index is created.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/antfly-index-management-api-openapi.yml#/components/schemas/CreatedIndex",
  "oneOf": [
    {
      "$ref": "#/$defs/CreatedFullTextIndex"
    },
    {
      "$ref": "#/$defs/CreatedEmbeddingsIndex"
    },
    {
      "$ref": "#/$defs/CreatedGraphIndex"
    },
    {
      "$ref": "#/$defs/CreatedAlgebraicIndex"
    },
    {
      "$ref": "#/$defs/CreatedRelationalIndex"
    }
  ],
  "$defs": {
    "AlgebraicAggregateConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "op"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "op": {
          "type": "string",
          "enum": [
            "count",
            "sum",
            "avg",
            "min",
            "max"
          ]
        },
        "group_by": {
          "type": "array",
          "maxItems": 32,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "measure": {
          "type": "string",
          "minLength": 1,
          "description": "Required except for count. Omitted count means COUNT(*); a supplied column means COUNT(column), excluding SQL NULL values."
        }
      }
    },
    "AlgebraicIndexConfig": {
      "type": "object",
      "description": "Schema-derived algebraic index capabilities with optional declarative aggregate recipes. Physical materialization state remains engine-owned.",
      "properties": {
        "derive_from_schema": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean",
          "description": "When true, derive typed fields and capabilities from the table schema. Physical fields, laws, joins and state remain engine-owned."
        },
        "aggregates": {
          "type": "array",
          "maxItems": 64,
          "description": "Desired exact aggregate recipes over schema column names. Eligible SQL automatically reuses complete, snapshot-bound materializations; unsupported SQL shapes retain scanning.",
          "items": {
            "$ref": "#/$defs/AlgebraicAggregateConfig"
          }
        }
      }
    },
    "AntflyChunkerConfig": {
      "description": "Configuration for the Antfly inference chunking provider.\n\nAntfly inference is Antfly's built-in ML service for local chunking.\n\n**Chunking Models:**\n- fixed: Fixed-size chunking by token count, with fixed time windows for audio\n  (aliases `fixed_bert`, `fixed_bpe`, and `fixed-bert-tokenizer`). This is the\n  only chunking model Antfly inference implements; other model names are\n  rejected as unsupported.\n\n**Deduplication:**\n- Within a single document write, chunk results are deduplicated when multiple\n  indexes share the same source text and chunker configuration, so the source\n  is chunked at most once per write.\n",
      "allOf": [
        {
          "$ref": "#/$defs/ChunkOptions"
        },
        {
          "type": "object",
          "properties": {
            "api_url": {
              "type": "string",
              "format": "uri",
              "description": "The URL of the Inference API endpoint (e.g., 'http://localhost:8080'). Can also be set via ANTFLY_INFERENCE_URL environment variable."
            },
            "model": {
              "type": "string",
              "description": "The chunking model to use. Defaults to 'fixed' for simple token-based chunking; other values select a model from models/chunkers/{name}/. Successful create responses include the effective model.",
              "default": "fixed"
            }
          }
        }
      ]
    },
    "AntflyGeneratorConfig": {
      "type": "object",
      "description": "Configuration for the Antfly inference generative AI provider.\n",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "antfly"
          ]
        },
        "model": {
          "type": "string",
          "description": "The name of the generator model."
        },
        "api_url": {
          "type": "string",
          "format": "uri",
          "description": "The URL of the Inference API endpoint. Can also be set via ANTFLY_INFERENCE_URL environment variable."
        },
        "temperature": {
          "type": "number",
          "format": "float",
          "description": "Controls randomness in generation (0.0-2.0).",
          "minimum": 0.0,
          "maximum": 2.0
        },
        "max_tokens": {
          "type": "integer",
          "description": "Maximum number of tokens to generate."
        },
        "top_p": {
          "type": "number",
          "format": "float",
          "description": "Nucleus sampling parameter.",
          "minimum": 0.0,
          "maximum": 1.0
        },
        "top_k": {
          "type": "integer",
          "description": "Top-k sampling parameter."
        },
        "timeout": {
          "type": "integer",
          "description": "HTTP response timeout in seconds for Inference API calls.",
          "minimum": 1
        }
      },
      "required": [
        "provider",
        "model"
      ]
    },
    "AnthropicGeneratorConfig": {
      "type": "object",
      "description": "Configuration for the Anthropic generative AI provider.\n",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "anthropic"
          ]
        },
        "workspace_id": {
          "type": "string",
          "description": "Anthropic workspace for keys not scoped to a workspace. Defaults to ANTHROPIC_WORKSPACE_ID."
        },
        "model": {
          "type": "string",
          "description": "The full model ID of the Anthropic model to use.",
          "default": "claude-sonnet-4-5-20250929"
        },
        "api_key": {
          "type": "string",
          "writeOnly": true,
          "description": "Anthropic API key or secret reference. Defaults to ANTHROPIC_API_KEY."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "Messages API base URL. Defaults to https://api.anthropic.com/v1."
        },
        "temperature": {
          "type": "number",
          "format": "float",
          "description": "Controls randomness in generation (0.0-1.0).",
          "minimum": 0.0,
          "maximum": 1.0
        },
        "max_tokens": {
          "type": "integer",
          "description": "Maximum number of tokens to generate in the response."
        },
        "top_p": {
          "type": "number",
          "format": "float",
          "description": "Nucleus sampling parameter (0.0-1.0).",
          "minimum": 0.0,
          "maximum": 1.0
        },
        "top_k": {
          "type": "integer",
          "description": "Top-k sampling parameter."
        }
      },
      "required": [
        "provider",
        "model"
      ]
    },
    "AppleGeneratorConfig": {
      "type": "object",
      "description": "On-device Apple Foundation Models generation. Requires a macOS Apple provider build, Apple Intelligence enabled, and its system model ready. Supports text conversations; tool calling and media attachments are not supported.",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "apple"
          ]
        },
        "max_tokens": {
          "type": "integer",
          "minimum": 1,
          "default": 256
        },
        "temperature": {
          "type": "number",
          "minimum": 0,
          "maximum": 2
        }
      }
    },
    "ArtifactIndexSource": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "artifact"
      ],
      "description": "Named generated artifact stream consumed by an index. Producer inputs belong on the matching enrichment.",
      "properties": {
        "artifact": {
          "type": "string",
          "minLength": 1,
          "description": "Stable name of a generated artifact stream."
        }
      }
    },
    "AudioChunkOptions": {
      "type": "object",
      "description": "Options specific to audio chunking.",
      "properties": {
        "window_duration_ms": {
          "type": "integer",
          "minimum": 0,
          "maximum": 86400000,
          "description": "Window duration in milliseconds for fixed-window audio chunking (default: 30000)."
        },
        "overlap_duration_ms": {
          "type": "integer",
          "minimum": 0,
          "maximum": 86400000,
          "description": "Overlap duration in milliseconds between audio chunks (default: 0)."
        }
      }
    },
    "BedrockGeneratorConfig": {
      "type": "object",
      "description": "AWS Bedrock Converse generation, including image inputs and tools for\nmodels that support them. Uses the AWS default credential chain unless\nan explicit Bedrock API key is configured. Image capability is declared\nper target through inference_capabilities; model IDs are not allowlisted.\n",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "bedrock"
          ]
        },
        "url": {
          "type": "string",
          "description": "Optional Bedrock Runtime endpoint override. Defaults to the regional AWS endpoint."
        },
        "api_key": {
          "type": "string",
          "description": "Optional Bedrock bearer API key or secret reference. Omit to use signed AWS requests and the default credential chain."
        },
        "model": {
          "type": "string",
          "description": "The Bedrock model ID to use."
        },
        "region": {
          "type": "string",
          "description": "AWS region. Defaults to AWS_REGION, then AWS_DEFAULT_REGION, then us-east-1."
        },
        "temperature": {
          "type": "number",
          "format": "float",
          "description": "Controls randomness in generation (0.0-1.0).",
          "minimum": 0.0,
          "maximum": 1.0
        },
        "max_tokens": {
          "type": "integer",
          "description": "Maximum number of tokens to generate."
        },
        "top_p": {
          "type": "number",
          "format": "float",
          "description": "Nucleus sampling parameter.",
          "minimum": 0.0,
          "maximum": 1.0
        }
      },
      "required": [
        "provider",
        "model"
      ]
    },
    "ChatGPTGeneratorConfig": {
      "type": "object",
      "description": "Personal ChatGPT plan for interactive generation. Credentials stay in the local runtime.",
      "required": [
        "provider",
        "model",
        "connection_id"
      ],
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "chatgpt"
          ]
        },
        "reasoning_effort": {
          "$ref": "#/$defs/OpenAIReasoningEffort"
        },
        "model": {
          "type": "string"
        },
        "connection_id": {
          "type": "string",
          "description": "Opaque personal registration owned by the authenticated caller."
        }
      }
    },
    "ChoiceDecisionQuestion": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "name",
        "instructions",
        "choices"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "choice"
          ]
        },
        "name": {
          "type": "string",
          "minLength": 1
        },
        "instructions": {
          "type": "string",
          "minLength": 1
        },
        "choices": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/DecisionChoice"
          },
          "minItems": 2,
          "maxItems": 64
        },
        "embedding_options": {
          "$ref": "#/$defs/EmbeddingDecisionAcceptance"
        }
      }
    },
    "ChunkDiarizationConfig": {
      "type": "object",
      "description": "Source-wide online speaker clustering on a fixed 1.5 s grid with 3 s embedding windows. Identities are stable within a source and recipe. Silence and ambiguous voices remain unassigned. Analysis advances incrementally; admitted cached timelines and durable centroid/sample-position checkpoints are shared across matching outputs and continuations. Missing checkpoints reconstruct the required prefix deterministically.",
      "properties": {
        "model": {
          "type": "string",
          "description": "Speaker ONNX registry reference; defaults to 3D-Speaker CAM++. For kind=diarize the target model selects the speaker model."
        },
        "model_identity": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$",
          "description": "Optional SHA-256 pin of the speaker ONNX file, including when paired with a transcription model."
        },
        "similarity_threshold": {
          "type": "number",
          "format": "float",
          "minimum": 0,
          "maximum": 1,
          "default": 0.45
        },
        "ambiguity_margin": {
          "type": "number",
          "format": "float",
          "minimum": 0,
          "maximum": 1,
          "default": 0.03
        },
        "min_rms": {
          "type": "number",
          "format": "float",
          "minimum": 0,
          "maximum": 1,
          "default": 0.01
        },
        "max_speakers": {
          "type": "integer",
          "minimum": 1,
          "maximum": 64,
          "default": 64
        }
      }
    },
    "ChunkEmbeddingTarget": {
      "type": "object",
      "required": [
        "model"
      ],
      "properties": {
        "model": {
          "type": "string",
          "minLength": 1
        },
        "model_identity": {
          "type": "string",
          "minLength": 64,
          "maxLength": 64,
          "pattern": "^[0-9a-f]{64}$",
          "description": "Optional required embedding-weight/recipe identity; a changed model is rejected before delivery."
        },
        "task_type": {
          "type": "string",
          "default": "RETRIEVAL_DOCUMENT"
        },
        "dimensions": {
          "type": "integer",
          "minimum": 1
        },
        "execute": {
          "type": "boolean",
          "x-go-type-skip-optional-pointer": false,
          "default": true,
          "description": "False resolves model limits and plans descriptors without running embedding inference."
        },
        "allow_partial": {
          "type": "boolean",
          "default": false,
          "description": "Return explicit per-chunk failures and gaps instead of aborting on the first non-retryable embedding failure."
        }
      }
    },
    "ChunkOptions": {
      "type": "object",
      "description": "Per-request configuration for chunking. All fields are optional - zero/omitted values use chunker defaults.",
      "properties": {
        "max_chunks": {
          "type": "integer",
          "minimum": 0,
          "maximum": 4096,
          "description": "Maximum chunks in one response; zero requests the full result. Model-aware responses return continuation coverage when a page is full: follow next_continuation until source_complete. Embedded model-aware enrichment uses this as its page size and continues through the entire source. Fixed chunking without model-aware outputs retains its per-call truncation behavior."
        },
        "threshold": {
          "type": "number",
          "format": "float",
          "minimum": 0,
          "maximum": 1,
          "description": "Confidence threshold for model-based chunking (0.0-1.0)."
        },
        "text": {
          "$ref": "#/$defs/TextChunkOptions"
        },
        "audio": {
          "$ref": "#/$defs/AudioChunkOptions"
        },
        "embedding": {
          "$ref": "#/$defs/ChunkEmbeddingTarget"
        },
        "outputs": {
          "$ref": "#/$defs/ChunkOutputs"
        },
        "policy": {
          "$ref": "#/$defs/MediaChunkPolicy"
        }
      }
    },
    "ChunkOutputTarget": {
      "type": "object",
      "required": [
        "name",
        "kind",
        "model"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "kind": {
          "type": "string",
          "enum": [
            "embedding",
            "transcribe",
            "classify",
            "diarize"
          ]
        },
        "model": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096
        },
        "execute": {
          "type": "boolean",
          "default": true,
          "description": "False retains this model as a planning boundary while skipping its inference; used for independent output repairs."
        },
        "skip_windows": {
          "type": "array",
          "maxItems": 4096,
          "description": "Execution-only repair mask for already accepted sub-windows; does not affect the model recipe or boundary plan. Skipped windows return receipts with status skipped.",
          "items": {
            "type": "object",
            "required": [
              "ordinal",
              "sub_index"
            ],
            "properties": {
              "ordinal": {
                "type": "integer",
                "format": "uint64",
                "minimum": 0
              },
              "sub_index": {
                "type": "integer",
                "format": "uint32",
                "minimum": 0
              }
            }
          }
        },
        "required": {
          "type": "boolean",
          "default": true
        },
        "model_identity": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$"
        },
        "task_type": {
          "type": "string",
          "default": "RETRIEVAL_DOCUMENT"
        },
        "dimensions": {
          "type": "integer",
          "minimum": 1
        },
        "language": {
          "type": "string"
        },
        "diarize": {
          "type": "boolean",
          "default": false,
          "description": "Convenience option on transcription outputs; enables source-wide diarization with the default speaker model."
        },
        "diarization": {
          "description": "Speaker settings for diarize or transcribe outputs; also accepted on the selected audio embedding boundary with audio_speaker_turns=true.",
          "$ref": "#/$defs/ChunkDiarizationConfig"
        },
        "top_k": {
          "type": "integer",
          "minimum": 1,
          "maximum": 128,
          "default": 5
        }
      }
    },
    "ChunkOutputs": {
      "type": "object",
      "required": [
        "boundary_model",
        "targets"
      ],
      "description": "Named independent media outputs. The named boundary model alone determines the shared plan; adding or changing another output preserves parent IDs. The compatibility embedding target is named embedding. Smaller output windows are identified by the parent ordinal and sub_index.",
      "properties": {
        "boundary_model": {
          "type": "string",
          "minLength": 1
        },
        "targets": {
          "type": "array",
          "minItems": 1,
          "maxItems": 16,
          "items": {
            "$ref": "#/$defs/ChunkOutputTarget"
          }
        }
      }
    },
    "ChunkerConfig": {
      "description": "A unified configuration for a chunking provider.",
      "allOf": [
        {
          "$ref": "#/$defs/AntflyChunkerConfig"
        },
        {
          "type": "object",
          "properties": {
            "provider": {
              "$ref": "#/$defs/ChunkerProvider"
            },
            "store_chunks": {
              "x-go-type-skip-optional-pointer": true,
              "type": "boolean",
              "description": "Controls whether chunk data is persisted to storage. When false (default), fixed chunks are generated in memory and only embeddings are stored. Model-aware streams always retain descriptor recipes; false omits their payloads. When true, chunk payloads are also stored. Vectors remain in the embedding artifact family.",
              "default": false
            },
            "full_text_index": {
              "x-go-type-skip-optional-pointer": true,
              "type": "object",
              "description": "Configuration for full-text indexing of chunks.\nWhen present (even if empty), chunk artifacts are persisted and indexed in Antfly's native full-text index, queryable and projectable via the document's `_chunks` field.\nWhen absent, chunks are generated only to drive vector embeddings and are not indexed for full-text search (unless `store_chunks` is also set).\n",
              "additionalProperties": true
            },
            "api_url": {
              "type": "string",
              "format": "uri",
              "description": "The URL of the Inference API endpoint. Can also be set via ANTFLY_INFERENCE_URL."
            },
            "model": {
              "type": "string",
              "description": "The chunking model to use. Defaults to 'fixed' for simple token-based chunking; other values select a model from models/chunkers/{name}/. Successful create responses include the effective model.",
              "default": "fixed"
            },
            "max_chunks": {
              "type": "integer",
              "minimum": 0,
              "maximum": 4096,
              "description": "Maximum chunks per invocation. Model-aware enrichment treats this as a page size and resumes until source completion; zero selects the worker page size. Fixed chunking retains its per-document cap, with zero meaning unlimited."
            },
            "threshold": {
              "type": "number",
              "format": "float",
              "minimum": 0,
              "maximum": 1
            },
            "text": {
              "$ref": "#/$defs/TextChunkOptions"
            },
            "audio": {
              "$ref": "#/$defs/AudioChunkOptions"
            },
            "embedding": {
              "$ref": "#/$defs/ChunkEmbeddingTarget"
            },
            "outputs": {
              "$ref": "#/$defs/ChunkOutputs"
            },
            "policy": {
              "$ref": "#/$defs/MediaChunkPolicy"
            }
          },
          "required": [
            "provider"
          ]
        }
      ]
    },
    "ChunkerProvider": {
      "type": "string",
      "enum": [
        "mock",
        "antfly"
      ],
      "description": "The chunking provider to use."
    },
    "CloudflareGeneratorConfig": {
      "type": "object",
      "description": "Cloudflare Workers AI generation. Uses CLOUDFLARE_API_TOKEN or an Antfly secret reference.",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "cloudflare"
          ]
        },
        "account_id": {
          "type": "string",
          "minLength": 1
        },
        "gateway_id": {
          "type": "string",
          "minLength": 1,
          "description": "Optional AI Gateway ID, sent through cf-aig-gateway-id."
        },
        "model": {
          "type": "string",
          "default": "@cf/meta/llama-3.3-70b-instruct-fp8-fast"
        },
        "api_key": {
          "type": "string",
          "writeOnly": true
        },
        "url": {
          "type": "string",
          "description": "Optional deployment-owned endpoint override."
        },
        "max_tokens": {
          "type": "integer",
          "minimum": 1
        },
        "temperature": {
          "type": "number",
          "format": "float",
          "minimum": 0,
          "maximum": 2
        },
        "top_p": {
          "type": "number",
          "format": "float",
          "minimum": 0,
          "maximum": 1
        },
        "frequency_penalty": {
          "type": "number",
          "format": "float",
          "minimum": -2,
          "maximum": 2
        },
        "presence_penalty": {
          "type": "number",
          "format": "float",
          "minimum": -2,
          "maximum": 2
        }
      },
      "required": [
        "provider",
        "account_id",
        "model"
      ]
    },
    "ConstrainedGenerationBatch": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "max_items_per_call": {
          "type": "integer",
          "minimum": 1,
          "maximum": 256,
          "default": 8
        },
        "max_input_bytes": {
          "type": "integer",
          "minimum": 1,
          "maximum": 4194304,
          "default": 65536
        }
      }
    },
    "ConstrainedOutput": {
      "type": "string",
      "enum": [
        "auto",
        "tool_call",
        "json_schema",
        "grammar"
      ],
      "default": "auto",
      "description": "Provider and model admission selects a supported constrained mechanism. Auto prefers forced tools, then provider JSON schema, then native grammar. Free-text parsing is not a mode."
    },
    "ConstrainedProbabilities": {
      "type": "string",
      "enum": [
        "token_logprobs",
        "verdict_only"
      ],
      "default": "token_logprobs",
      "description": "Token probabilities require complete decoder evidence for the allowed values. Verdict-only is explicit opt-in; model-reported confidence is never used."
    },
    "CreatedAlgebraicIndex": {
      "description": "Normalized effective schema-derived algebraic index configuration returned after creation.",
      "allOf": [
        {
          "$ref": "#/$defs/CreatedIndexCommon"
        },
        {
          "$ref": "#/$defs/AlgebraicIndexConfig"
        },
        {
          "type": "object",
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "algebraic"
              ]
            }
          }
        }
      ]
    },
    "CreatedEmbeddingsIndex": {
      "description": "Normalized effective dense or sparse embeddings index configuration returned after creation.",
      "allOf": [
        {
          "$ref": "#/$defs/CreatedIndexCommon"
        },
        {
          "$ref": "#/$defs/CreatedEmbeddingsIndexConfig"
        },
        {
          "type": "object",
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "embeddings"
              ]
            }
          }
        }
      ]
    },
    "CreatedEmbeddingsIndexConfig": {
      "type": "object",
      "description": "Credential-free normalized embeddings configuration returned after creation. Single-source v0.2 fields are preserved alongside canonical sources for read compatibility.",
      "properties": {
        "publication_policy": {
          "$ref": "#/$defs/IndexPublicationPolicy"
        },
        "coverage_policy": {
          "$ref": "#/$defs/DerivedCoveragePolicy"
        },
        "external": {
          "type": "boolean",
          "default": false
        },
        "sparse": {
          "type": "boolean",
          "default": false
        },
        "dimension": {
          "type": "integer",
          "minimum": 1
        },
        "field": {
          "type": "string"
        },
        "sources": {
          "type": "array",
          "minItems": 1,
          "maxItems": 64,
          "uniqueItems": true,
          "items": {
            "$ref": "#/$defs/ArtifactIndexSource"
          },
          "description": "Embedding artifact streams indexed together as independent vector members."
        },
        "embedding_name": {
          "type": "string",
          "readOnly": true,
          "description": "Released v0.2 single-source read field, preserved when that request form created the index. Canonical source identity is also returned through sources."
        },
        "source_artifact_name": {
          "type": "string",
          "readOnly": true,
          "deprecated": true,
          "x-deprecated-reason": "Use the matching embedding enrichment's source_artifact_name; it is authoritative.",
          "description": "Deprecated v0.2 descriptive source read field, preserved when supplied with embedding_name. The matching enrichment is authoritative."
        },
        "template": {
          "type": "string"
        },
        "distance_metric": {
          "$ref": "#/$defs/DistanceMetric"
        },
        "mem_only": {
          "type": "boolean"
        },
        "embedder": {
          "$ref": "#/$defs/CreatedProviderConfig"
        },
        "chunker": {
          "$ref": "#/$defs/ChunkerConfig"
        },
        "top_k": {
          "type": "integer",
          "minimum": 1,
          "default": 10
        },
        "min_weight": {
          "type": "number",
          "format": "float",
          "default": 0.0
        },
        "chunk_size": {
          "type": "integer",
          "minimum": 64,
          "default": 1024
        },
        "execution": {
          "$ref": "#/$defs/IndexExecutionConfig"
        }
      }
    },
    "CreatedEnrichmentConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "kind"
      ],
      "description": "Credential-free normalized enrichment configuration returned after index creation.",
      "properties": {
        "name": {
          "type": "string"
        },
        "kind": {
          "$ref": "#/$defs/EnrichmentKind"
        },
        "source": {
          "$ref": "#/$defs/GroupedArtifactSource"
        },
        "prior_context": {
          "$ref": "#/$defs/PriorArtifactContext"
        },
        "field": {
          "type": "string"
        },
        "template": {
          "type": "string"
        },
        "source_artifact_name": {
          "type": "string"
        },
        "expected_dims": {
          "type": "integer",
          "minimum": 0
        },
        "vector_space": {
          "type": "string",
          "minLength": 1,
          "description": "Optional stable model/token-space identifier asserted for this embedding artifact."
        },
        "chunk_size": {
          "type": "integer",
          "minimum": 0
        },
        "chunk_overlap": {
          "type": "integer",
          "minimum": 0
        },
        "chunker": {
          "$ref": "#/$defs/ChunkerConfig"
        },
        "chunker_json": {
          "type": "string",
          "deprecated": true,
          "x-deprecated-reason": "Use the typed chunker field."
        },
        "full_text_index": {
          "type": "boolean",
          "default": false
        },
        "content_type": {
          "type": "string"
        },
        "neighbor_context": {
          "$ref": "#/$defs/EnrichmentNeighborContextConfig"
        },
        "execution": {
          "$ref": "#/$defs/ExecutionPolicy"
        }
      }
    },
    "CreatedFullTextIndex": {
      "description": "Normalized effective full-text index configuration returned after creation.",
      "allOf": [
        {
          "$ref": "#/$defs/CreatedIndexCommon"
        },
        {
          "$ref": "#/$defs/CreatedFullTextIndexConfig"
        },
        {
          "type": "object",
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "full_text"
              ]
            }
          }
        }
      ]
    },
    "CreatedFullTextIndexConfig": {
      "type": "object",
      "description": "Canonical full-text configuration returned after creation. Single-source alternative request forms are represented through sources.",
      "properties": {
        "sources": {
          "type": "array",
          "minItems": 1,
          "maxItems": 64,
          "uniqueItems": true,
          "items": {
            "$ref": "#/$defs/FullTextArtifactIndexSource"
          }
        },
        "mem_only": {
          "type": "boolean"
        },
        "field": {
          "type": "string"
        },
        "store_source": {
          "type": "boolean"
        },
        "analysis_config": {
          "$ref": "#/$defs/TextAnalysisConfig"
        }
      }
    },
    "CreatedGraphArtifactProducerConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "kind",
        "source"
      ],
      "description": "Credential-free graph artifact producer configuration returned after creation.",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "kind": {
          "type": "string",
          "enum": [
            "asset"
          ]
        },
        "source": {
          "$ref": "#/$defs/GraphArtifactProducerSourceConfig"
        },
        "content_type": {
          "type": "string"
        },
        "execution": {
          "$ref": "#/$defs/ExecutionPolicy"
        }
      }
    },
    "CreatedGraphArtifactSourceConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "artifact"
      ],
      "description": "Canonical artifact stream materialized into graph edges.",
      "properties": {
        "artifact": {
          "type": "string",
          "minLength": 1
        },
        "path": {
          "type": "string"
        },
        "format": {
          "type": "string",
          "enum": [
            "extraction_relation",
            "extraction_graph"
          ],
          "default": "extraction_relation"
        },
        "mention_edge_type": {
          "type": "string"
        },
        "nodes": {
          "$ref": "#/$defs/GraphArtifactNodeMappingConfig"
        },
        "edge": {
          "$ref": "#/$defs/GraphArtifactEdgeMappingConfig"
        },
        "context": {
          "$ref": "#/$defs/GraphArtifactContextConfig"
        }
      }
    },
    "CreatedGraphIndex": {
      "description": "Normalized effective graph index configuration returned after creation.",
      "allOf": [
        {
          "$ref": "#/$defs/CreatedIndexCommon"
        },
        {
          "$ref": "#/$defs/CreatedGraphIndexConfig"
        },
        {
          "type": "object",
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "graph"
              ]
            }
          }
        }
      ]
    },
    "CreatedGraphIndexConfig": {
      "type": "object",
      "description": "Credential-free normalized graph configuration returned after creation.",
      "properties": {
        "metrics": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/GraphMetricConfig"
          }
        },
        "summarizer": {
          "$ref": "#/$defs/CreatedProviderConfig"
        },
        "template": {
          "type": "string"
        },
        "edge_types": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/EdgeTypeConfig"
          }
        },
        "max_edges_per_document": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1000000,
          "description": "Maximum number of distinct visible edges materialized per document after source precedence and identity deduplication. Zero uses the server safety limit (currently 1,000,000). Independent aggregate reconciliation budgets bound work across overlapping source manifests."
        },
        "sources": {
          "type": "array",
          "minItems": 1,
          "maxItems": 64,
          "uniqueItems": true,
          "items": {
            "$ref": "#/$defs/CreatedGraphArtifactSourceConfig"
          }
        },
        "artifact": {
          "$ref": "#/$defs/CreatedGraphArtifactProducerConfig"
        },
        "algebraic_planning": {
          "$ref": "#/$defs/GraphAlgebraicPlanningConfig"
        },
        "resolvers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/GraphResolverConfig"
          }
        }
      }
    },
    "CreatedIndexCommon": {
      "type": "object",
      "description": "Fields returned for every newly created index. Provider credentials are write-only and are never returned.",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "Name of the created index"
        },
        "description": {
          "type": "string",
          "description": "Optional description of the index and its purpose"
        },
        "version": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "default": 0,
          "description": "Version of the index implementation. Defaults to 0."
        },
        "enrichments": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CreatedEnrichmentConfig"
          },
          "x-go-type-skip-optional-pointer": true,
          "description": "Normalized inline managed enrichment definitions required by this index."
        }
      }
    },
    "CreatedProviderConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "provider"
      ],
      "description": "Credential-free provider configuration returned after index creation. Only non-secret provider settings are represented.",
      "properties": {
        "provider": {
          "type": "string",
          "description": "Configured provider discriminator."
        },
        "model": {
          "type": "string",
          "description": "Configured provider model when applicable."
        },
        "request_format": {
          "type": "string"
        },
        "task_encoding": {
          "type": "string"
        },
        "model_identity": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$",
          "description": "Pinned immutable embedding asset and recipe identity."
        },
        "models": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "project_id": {
          "type": "string"
        },
        "location": {
          "type": "string"
        },
        "region": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "api_url": {
          "type": "string",
          "format": "uri"
        },
        "dimension": {
          "type": "integer",
          "minimum": 1
        },
        "dimensions": {
          "type": "integer",
          "minimum": 1
        },
        "input_type": {
          "type": "string"
        },
        "truncate": {
          "type": "string"
        },
        "strip_new_lines": {
          "type": "boolean"
        },
        "batch_size": {
          "type": "integer",
          "minimum": 1
        },
        "temperature": {
          "type": "number",
          "format": "float"
        },
        "max_tokens": {
          "type": "integer",
          "minimum": 1
        },
        "top_p": {
          "type": "number",
          "format": "float"
        },
        "top_k": {
          "type": "integer"
        },
        "frequency_penalty": {
          "type": "number",
          "format": "float"
        },
        "presence_penalty": {
          "type": "number",
          "format": "float"
        },
        "timeout": {
          "type": "integer",
          "minimum": 1
        }
      }
    },
    "CreatedRelationalIndex": {
      "description": "Effective schema-bound composite index configuration.",
      "allOf": [
        {
          "$ref": "#/$defs/CreatedIndexCommon"
        },
        {
          "$ref": "#/$defs/RelationalIndexConfig"
        },
        {
          "type": "object",
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "relational"
              ]
            }
          }
        }
      ]
    },
    "DeciderConfig": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "antfly",
            "jev",
            "openai",
            "cloudflare"
          ]
        },
        "decision_method": {
          "type": "string",
          "enum": [
            "typed",
            "embedding_similarity",
            "generated"
          ],
          "default": "typed",
          "description": "Explicit result contract. embedding_similarity is available with Antfly EmbeddingGemma 2 choice and multi_choice questions; rejects score and predicate requests and returns raw cosine similarities."
        },
        "generator": {
          "$ref": "#/$defs/GeneratorConfig",
          "description": "Required with decision_method=generated. Provider configuration belongs here rather than in the outer typed-decider fields."
        },
        "instructions": {
          "type": "string",
          "maxLength": 65536
        },
        "output": {
          "$ref": "#/$defs/ConstrainedOutput"
        },
        "probabilities": {
          "$ref": "#/$defs/ConstrainedProbabilities"
        },
        "batch": {
          "$ref": "#/$defs/ConstrainedGenerationBatch"
        },
        "model": {
          "type": "string",
          "description": "Required for Antfly, OpenAI, and Cloudflare; Jev defaults to jev-latest. Cloudflare uses @cf/cloudflare/clef or @cf/cloudflare/clef-flash."
        },
        "account_id": {
          "type": "string",
          "description": "Required with the cloudflare provider; Workers AI account identifier."
        },
        "gateway_id": {
          "type": "string",
          "description": "Optional Cloudflare AI Gateway identifier."
        },
        "model_identity": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$",
          "description": "Pin the exact EmbeddingGemma 2 assets and recipe. Requires embedding_similarity."
        },
        "embedder": {
          "type": "string",
          "minLength": 1,
          "description": "Named dense embedder for provider-neutral embedding_similarity routing. Specify matching embedding_options.dimensions. Native fitted calibrations require the original Antfly model path; hosted routes use explicit thresholds and estimated token admission."
        },
        "embedding_options": {
          "type": "object",
          "additionalProperties": false,
          "description": "Geometry and acceptance defaults for embedding_similarity decisions. Named embedders require dimensions matching their configured dense output. Direct Antfly model routes support EmbeddingGemma 2 dimensions and fitted calibrations. Acceptance is serialized onto each question and can be overridden per question. Raw cosine similarities never represent probabilities.",
          "properties": {
            "calibration_id": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,64}$",
              "description": "Qualified fitted raw thresholds in model/calibrations/{id}.json. Bound to the exact asset identity, task, renderer, dimensions and category prototypes; mutually exclusive with manual thresholds. Does not produce probabilities."
            },
            "task_type": {
              "type": "string",
              "enum": [
                "CLUSTERING",
                "CLASSIFICATION"
              ],
              "default": "CLUSTERING"
            },
            "dimensions": {
              "type": "integer",
              "minimum": 1,
              "maximum": 65535,
              "default": 768,
              "description": "Must match the named embedder's configured dimensions. Without embedder, the direct EmbeddingGemma 2 route accepts only 768, 512, 256 or 128."
            },
            "min_similarity": {
              "type": "number",
              "minimum": -1,
              "maximum": 1
            },
            "min_margin": {
              "type": "number",
              "minimum": 0,
              "maximum": 2
            }
          }
        },
        "url": {
          "type": "string",
          "description": "Provider base URL; endpoint path is selected by provider. OpenAI defaults to https://api.openai.com/v1 and appends /decisions."
        },
        "api_key": {
          "type": "string",
          "description": "API key or secret reference. Defaults to the provider environment variable."
        },
        "max_rows": {
          "type": "integer",
          "minimum": 1,
          "default": 10000
        },
        "max_input_tokens": {
          "type": "integer",
          "minimum": 1,
          "default": 1000000
        },
        "max_image_input_tokens": {
          "type": "integer",
          "format": "int64",
          "minimum": 1,
          "description": "Provider/model upper bound on the input-token contribution of one image. Required when sending images through typed hosted or generated deciders, including native generators and image URLs. The runtime reserves this allowance per image in addition to serialized non-image request bytes; actual usage can add shared quota debt. Generated deciders apply the allowance to the selected generator's shared quota. Omit for text-only deciders."
        },
        "rate_limit": {
          "$ref": "#/$defs/RateLimitConfig"
        },
        "batch_size": {
          "type": "integer",
          "minimum": 1,
          "maximum": 256,
          "default": 32
        }
      }
    },
    "DecisionChoice": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "value"
      ],
      "properties": {
        "value": {
          "type": "string",
          "minLength": 1
        },
        "description": {
          "type": "string",
          "minLength": 1
        }
      },
      "description": "Local decision models use string choice identifiers. Embedding category examples replace the description with their normalized centroid; trained models reject examples."
    },
    "DerivedCoveragePolicy": {
      "type": "string",
      "enum": [
        "strict",
        "partial",
        "best_effort"
      ],
      "default": "strict",
      "description": "How generation-scoped source outcomes determine derived-index completeness."
    },
    "DistanceMetric": {
      "x-go-type-skip-optional-pointer": true,
      "type": "string",
      "enum": [
        "l2_squared",
        "inner_product",
        "cosine"
      ],
      "default": "l2_squared",
      "description": "Distance metric for the vector index (dense only). Use \"cosine\" for models trained with cosine similarity (e.g. CLIP, OpenAI). Use \"inner_product\" for models trained with dot product similarity. Use \"l2_squared\" for models trained with Euclidean distance. The default is \"l2_squared\"."
    },
    "EdgeTypeConfig": {
      "type": "object",
      "description": "Configuration for a specific edge type",
      "properties": {
        "name": {
          "$ref": "#/$defs/GraphEdgeType"
        },
        "field": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Document field containing target node key(s) for automatic edge creation.\nSupports string (single target) or array of strings (multiple targets).\nWhen omitted, edges must be provided explicitly via _edges.\n"
        },
        "topology": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "enum": [
            "tree",
            "graph"
          ],
          "default": "graph",
          "description": "Topology constraint for this edge type:\n- tree: Single parent per node, no cycles\n- graph: No constraints (default)\n"
        }
      },
      "required": [
        "name"
      ]
    },
    "EmbeddingDecisionAcceptance": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "calibration_id": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{1,64}$",
          "description": "Public API identifier for a server-side fitted threshold artifact at model/calibrations/{id}.json. The server verifies qualification and the exact asset identity, prompt profile, dimensions, renderer and this question's label/prototype set. Mutually exclusive with manual thresholds; never produces probabilities."
        },
        "min_similarity": {
          "type": "number",
          "minimum": -1,
          "maximum": 1,
          "description": "For a single choice, abstain when the highest cosine similarity is below this value. It is a similarity threshold, not an accuracy or probability estimate."
        },
        "min_margin": {
          "type": "number",
          "minimum": 0,
          "maximum": 2,
          "description": "For a single choice, require this gap between the highest and second-highest cosine similarities. For multi_choice, require every score to be at least this distance from its own selection threshold; otherwise abstain."
        }
      },
      "description": "Question-specific acceptance policy for embedding similarity. Trained decision models reject it."
    },
    "EnrichmentKind": {
      "type": "string",
      "enum": [
        "chunk",
        "asset",
        "embedding",
        "group"
      ],
      "description": "Managed generated artifact kind."
    },
    "EnrichmentNeighborContextConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "graph_index"
      ],
      "description": "Bounded sample of the document's same-shard graph neighbors appended to an asset producer's rendered input as a compact JSON block ({\"neighbors\":[{\"edge_type\":...,\"direction\":...,\"target\":...,\"weight\":...}]}), ordered by edge type then target key. A conceptualizer enrichment on an entities table can thereby ground its abstractions in adjacent facts (\"started_by -> John Andrew Rice\"). The sampled block participates in the producer's skip state, so a changed adjacency re-runs the producer.",
      "properties": {
        "graph_index": {
          "type": "string",
          "minLength": 1,
          "description": "Name of a graph index on the same table whose local state is sampled. Validated at admission; cross-shard neighbors are not sampled."
        },
        "edge_types": {
          "x-go-type-skip-optional-pointer": true,
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "description": "Edge types to sample. Empty admits every edge type."
        },
        "direction": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "enum": [
            "out",
            "in",
            "both"
          ],
          "default": "both",
          "description": "Adjacency orientation to sample relative to the document."
        },
        "limit": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint32",
          "minimum": 1,
          "maximum": 64,
          "default": 8,
          "description": "Maximum neighbors rendered into the producer input, applied after deterministic ordering."
        }
      }
    },
    "ExecutionPolicy": {
      "type": "object",
      "additionalProperties": false,
      "description": "Non-semantic execution policy for one producer or index maintenance operation. These fields tune how work is batched and do not change generated artifact identity.",
      "properties": {
        "batch_items": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "minimum": 1,
          "description": "Maximum items to process in one batch for this operation."
        },
        "batch_bytes": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "minimum": 1,
          "format": "uint64",
          "description": "Approximate maximum source bytes to process in one batch for this operation."
        },
        "max_document_pages": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "minimum": 1,
          "format": "uint32",
          "description": "Maximum PDF pages admitted for one request-atomic document operation."
        }
      }
    },
    "FullTextArtifactIndexSource": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "artifact"
      ],
      "description": "Textual artifact stream consumed by a full-text index, with an optional source-local projection.",
      "properties": {
        "artifact": {
          "type": "string",
          "minLength": 1,
          "description": "Stable name of a chunk or textual asset artifact stream. Artifact names must be unique within the index."
        },
        "field": {
          "type": "string",
          "minLength": 1,
          "description": "Optional field selected from this artifact's records. When omitted, the index-level field is inherited; when both are omitted, Antfly indexes the default text projection."
        }
      }
    },
    "GeneratorConfig": {
      "description": "A unified configuration for a generative AI provider.\n",
      "allOf": [
        {
          "oneOf": [
            {
              "$ref": "#/$defs/CloudflareGeneratorConfig"
            },
            {
              "$ref": "#/$defs/GoogleGeneratorConfig"
            },
            {
              "$ref": "#/$defs/VertexGeneratorConfig"
            },
            {
              "$ref": "#/$defs/BedrockGeneratorConfig"
            },
            {
              "$ref": "#/$defs/AnthropicGeneratorConfig"
            },
            {
              "$ref": "#/$defs/OllamaGeneratorConfig"
            },
            {
              "$ref": "#/$defs/AntflyGeneratorConfig"
            },
            {
              "$ref": "#/$defs/ChatGPTGeneratorConfig"
            },
            {
              "$ref": "#/$defs/OpenAIGeneratorConfig"
            },
            {
              "$ref": "#/$defs/OpenRouterGeneratorConfig"
            },
            {
              "$ref": "#/$defs/AppleGeneratorConfig"
            }
          ]
        },
        {
          "properties": {
            "max_image_input_tokens": {
              "x-go-type-skip-optional-pointer": false,
              "type": "integer",
              "format": "int64",
              "minimum": 1,
              "description": "Conservative input-token ceiling per image. Required for image calls when tokens_per_minute is configured; choose a bound valid for the model and image policy."
            },
            "rate_limit": {
              "x-go-type-skip-optional-pointer": false,
              "$ref": "#/$defs/RateLimitConfig"
            },
            "provider": {
              "$ref": "#/$defs/GeneratorProvider"
            }
          },
          "required": [
            "provider"
          ]
        }
      ]
    },
    "GeneratorProvider": {
      "type": "string",
      "enum": [
        "cloudflare",
        "gemini",
        "vertex",
        "bedrock",
        "anthropic",
        "ollama",
        "openai",
        "chatgpt",
        "openrouter",
        "antfly",
        "apple"
      ],
      "description": "Generator providers implemented by Antfly's generation runtime."
    },
    "GoogleGeneratorConfig": {
      "type": "object",
      "description": "Configuration for the Google generative AI provider (Gemini).\n",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "gemini"
          ]
        },
        "project_id": {
          "type": "string",
          "description": "The Google Cloud project ID."
        },
        "location": {
          "type": "string",
          "description": "The Google Cloud location (e.g., 'us-central1')."
        },
        "model": {
          "type": "string",
          "description": "The name of the generative model to use.",
          "default": "gemini-2.5-flash"
        },
        "temperature": {
          "type": "number",
          "format": "float",
          "description": "Controls randomness in generation (0.0-2.0).",
          "minimum": 0.0,
          "maximum": 2.0
        },
        "max_tokens": {
          "type": "integer",
          "description": "Maximum number of tokens to generate."
        },
        "top_p": {
          "type": "number",
          "format": "float",
          "description": "Nucleus sampling parameter.",
          "minimum": 0.0,
          "maximum": 1.0
        },
        "top_k": {
          "type": "integer",
          "description": "Top-k sampling parameter."
        },
        "api_key": {
          "type": "string",
          "writeOnly": true,
          "description": "The Google API key."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "The URL of the Google API endpoint."
        }
      },
      "required": [
        "provider",
        "model"
      ]
    },
    "GraphAlgebraicPlanningConfig": {
      "type": "object",
      "additionalProperties": false,
      "description": "Optional algebraic planning features for graph traversal.",
      "properties": {
        "bounded_traversal": {
          "$ref": "#/$defs/GraphBoundedTraversalConfig"
        }
      }
    },
    "GraphArtifactContextConfig": {
      "type": "object",
      "additionalProperties": false,
      "description": "Document fields made available to graph mapping templates through `_doc.value`.",
      "properties": {
        "doc_fields": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        }
      }
    },
    "GraphArtifactEdgeMappingConfig": {
      "type": "object",
      "additionalProperties": false,
      "description": "Maps each artifact item to a relationship identity, type, weight, and public metadata.",
      "properties": {
        "edge_id": {
          "$ref": "#/$defs/GraphTemplateValue",
          "description": "Stable application relationship ID. Required with nodes.source. Replays update the same identity; distinct IDs preserve parallel relationships."
        },
        "type": {
          "$ref": "#/$defs/GraphTemplateValue"
        },
        "weight": {
          "$ref": "#/$defs/GraphTemplateValue"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": true,
          "description": "JSON metadata template copied onto each materialized edge. Sensitive keys are omitted from create responses."
        }
      }
    },
    "GraphArtifactNodeMappingConfig": {
      "type": "object",
      "additionalProperties": false,
      "description": "Maps each artifact item to graph node identifiers.",
      "properties": {
        "model": {
          "type": "string",
          "enum": [
            "document",
            "external"
          ],
          "default": "document"
        },
        "source": {
          "$ref": "#/$defs/GraphTemplateValue",
          "description": "Logical source endpoint. When set, edge.edge_id is required; the artifact document remains the durable owner."
        },
        "target": {
          "$ref": "#/$defs/GraphTemplateValue"
        }
      }
    },
    "GraphArtifactProducerSourceConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "value"
      ],
      "description": "Document input used by an artifact producer. Field sources read one document field; template sources render a Handlebars template.",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "field",
            "template"
          ]
        },
        "value": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    "GraphBoundedTraversalConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "law"
      ],
      "description": "Algebraic law used to combine bounded graph traversal provenance.",
      "properties": {
        "law": {
          "type": "string",
          "enum": [
            "provenance_semiring"
          ]
        }
      }
    },
    "GraphEdgeType": {
      "type": "string",
      "minLength": 1,
      "maxLength": 65536,
      "x-antfly-max-utf8-bytes": 65536,
      "description": "Durable graph edge type. Values must be valid UTF-8 and encode to at most 64 KiB; `maxLength` is the standard-schema code-point ceiling and `x-antfly-max-utf8-bytes` carries the exact wire-byte limit."
    },
    "GraphMetricConfig": {
      "type": "object",
      "additionalProperties": false,
      "description": "Published metric configuration. If kind is omitted, the metric name must be a supported kind.",
      "properties": {
        "enabled": {
          "type": "boolean",
          "default": true
        },
        "kind": {
          "type": "string",
          "enum": [
            "pagerank",
            "degree",
            "eigenvector",
            "hits_authority",
            "hits_hub"
          ]
        },
        "refresh": {
          "type": "string",
          "enum": [
            "background",
            "manual"
          ],
          "default": "background",
          "description": "Serverless accepts background only."
        },
        "damping": {
          "type": "number",
          "format": "double",
          "default": 0.85,
          "exclusiveMinimum": 0,
          "exclusiveMaximum": 1
        },
        "tolerance": {
          "type": "number",
          "format": "double",
          "default": 1e-06,
          "exclusiveMinimum": 0
        },
        "max_iterations": {
          "type": "integer",
          "format": "int32",
          "minimum": 1,
          "maximum": 1000,
          "default": 50
        },
        "edge_filter": {
          "$ref": "#/$defs/GraphMetricEdgeFilter"
        }
      }
    },
    "GraphMetricEdgeFilter": {
      "type": "object",
      "additionalProperties": false,
      "description": "Omitting this object selects all edge types. A types list selects only those types; mode and types cannot both be supplied.",
      "properties": {
        "mode": {
          "type": "string",
          "enum": [
            "all"
          ]
        },
        "types": {
          "type": "array",
          "minItems": 1,
          "uniqueItems": true,
          "items": {
            "$ref": "#/$defs/GraphEdgeType"
          }
        }
      }
    },
    "GraphResolverAdjudicationAcceptance": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "choice",
        "min_probability"
      ],
      "properties": {
        "choice": {
          "type": "string",
          "minLength": 1,
          "description": "A choice identifier in the configured question. Accept and reject must differ."
        },
        "min_probability": {
          "type": "number",
          "minimum": 0.5,
          "maximum": 1,
          "description": "Require this typed probability and a strict majority. Raw cosine is not a probability."
        }
      }
    },
    "GraphResolverAdjudicationConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "decider",
        "template",
        "question",
        "accept"
      ],
      "description": "Adjudicate the best deterministic REVIEW candidate with a typed decision. MATCH and NO_MATCH bypass the model. Evidence is authoritative resolution data, retained independently of work caches and reused on recovery. Changes trigger versioned re-resolution. This resolves mentions, not global key merges.",
      "properties": {
        "decider": {
          "$ref": "#/$defs/DeciderConfig",
          "description": "Frozen typed or generated decider configuration. Generated verdict-only thresholds must be zero or one."
        },
        "template": {
          "type": "string",
          "minLength": 1,
          "maxLength": 65536,
          "description": "Bounded interpolation of m.text, m.surface_form, m.canonical_text, m.label, m.description, c.canonical_name, c.label and c.description. Missing descriptions render empty text, allowing name-only decisions."
        },
        "question": {
          "$ref": "#/$defs/ChoiceDecisionQuestion"
        },
        "accept": {
          "$ref": "#/$defs/GraphResolverAdjudicationAcceptance"
        },
        "reject": {
          "$ref": "#/$defs/GraphResolverAdjudicationAcceptance",
          "description": "Optional confident negative choice. Without it, non-acceptance stays REVIEW."
        },
        "on_failure": {
          "type": "string",
          "enum": [
            "review",
            "mint"
          ],
          "default": "review",
          "description": "Failure or budget fallback. REVIEW remains unpromoted; mint explicitly permits a new identity."
        },
        "description_inputs": {
          "type": "object",
          "additionalProperties": false,
          "description": "Optional asset bindings. Resolution reads available data without waiting for promotion or producers.",
          "properties": {
            "mention_artifact": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "description": "Source-document asset containing a JSON object mapping local mention ids to description strings. Publication re-drives asset-scoped resolution."
            },
            "candidate_artifact": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "description": "Candidate-document text asset, such as a generated summary. Changes affect future decisions; explicitly re-resolve to revisit committed evidence."
            }
          }
        },
        "budget_ms": {
          "type": "integer",
          "minimum": 1,
          "maximum": 300000,
          "default": 10000,
          "description": "Total model-time budget per source artifact. Each call also obeys timeout_ms."
        },
        "max_pairs": {
          "type": "integer",
          "minimum": 1,
          "maximum": 256,
          "default": 32
        },
        "max_input_bytes": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1048576,
          "default": 16384
        },
        "timeout_ms": {
          "type": "integer",
          "minimum": 1,
          "maximum": 300000,
          "default": 10000
        }
      }
    },
    "GraphResolverConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "table",
        "source_artifact",
        "resolution_artifact",
        "key_template"
      ],
      "description": "Versioned entity resolver attached to an artifact-backed graph index.",
      "properties": {
        "name": {
          "type": "string"
        },
        "table": {
          "type": "string"
        },
        "source_artifact": {
          "type": "string"
        },
        "source_artifact_kind": {
          "type": "string",
          "enum": [
            "asset",
            "chunk",
            "any"
          ],
          "default": "asset"
        },
        "resolution_artifact": {
          "type": "string"
        },
        "key_template": {
          "type": "string"
        },
        "promote": {
          "type": "boolean",
          "default": true,
          "x-go-type-skip-optional-pointer": false,
          "description": "Materialize canonical entity documents. False resolves graph keys without promotion."
        },
        "aliases": {
          "type": "array",
          "description": "Explicit redirects between fully rendered keys in this resolver's table; no entity documents required. Changes trigger corpus re-resolution.",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "key",
              "target"
            ],
            "properties": {
              "key": {
                "type": "string",
                "minLength": 1
              },
              "target": {
                "type": "string",
                "minLength": 1
              }
            }
          }
        },
        "labels": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Mention labels this resolver consumes; empty consumes every label (catch-all). Labeled resolvers sharing a source artifact must claim disjoint label sets, and every catch-all on that artifact skips the labels claimed by labeled siblings, so extraction labels stay open-vocabulary while each mention routes to exactly one labeled resolver (label-routed tables, e.g. event mentions to an events table)."
        },
        "type_must_match": {
          "type": "boolean",
          "default": true
        },
        "scorer": {
          "$ref": "#/$defs/GraphResolverScorerConfig",
          "description": "Typed matcher scorer. Cannot be combined with scorer_json."
        },
        "adjudicate": {
          "$ref": "#/$defs/GraphResolverAdjudicationConfig"
        },
        "suppress": {
          "$ref": "#/$defs/GraphResolverSuppressionConfig"
        },
        "scorer_json": {
          "type": "string",
          "deprecated": true,
          "x-deprecated-reason": "Use the scorer field."
        },
        "candidate_search": {
          "type": "string",
          "enum": [
            "",
            "exact_key",
            "prefix",
            "ann"
          ]
        },
        "candidate_ann_index": {
          "type": "string"
        },
        "candidate_limit": {
          "type": "integer",
          "format": "uint",
          "minimum": 0
        },
        "name_embedding": {
          "type": "string"
        },
        "name_embedding_dims": {
          "type": "integer",
          "format": "uint",
          "minimum": 0
        },
        "fusion_combine": {
          "type": "string",
          "enum": [
            "",
            "noisy_or",
            "max",
            "mean"
          ]
        },
        "fusion_trust": {
          "type": "number",
          "format": "double",
          "minimum": 0,
          "maximum": 1
        },
        "fusion_prior": {
          "type": "number",
          "format": "double",
          "minimum": 0,
          "maximum": 1
        },
        "fusion_prior_weight": {
          "type": "number",
          "format": "double",
          "minimum": 0
        },
        "min_confidence": {
          "x-go-type-skip-optional-pointer": false,
          "type": "number",
          "format": "double",
          "minimum": 0,
          "maximum": 1,
          "description": "Mention admission floor: mentions whose extractor-asserted confidence is below this are never resolved — no canonical entity key, no mention edge, and relation endpoints referencing them are withheld. The cheap post-extraction junk filter for score-carrying extractors; omission defaults to 0 for trained extractors. Resolvers consuming verdict-only generated extraction must set this field explicitly, including when the chosen floor is zero."
        },
        "config_generation": {
          "type": "integer",
          "format": "uint64",
          "minimum": 0
        }
      }
    },
    "GraphResolverScorerComparison": {
      "type": "object",
      "required": [
        "name",
        "left",
        "right",
        "levels"
      ],
      "additionalProperties": false,
      "properties": {
        "name": {
          "type": "string"
        },
        "left": {
          "type": "string"
        },
        "right": {
          "type": "string"
        },
        "levels": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/GraphResolverScorerLevel"
          }
        }
      }
    },
    "GraphResolverScorerConfig": {
      "type": "object",
      "required": [
        "comparisons"
      ],
      "additionalProperties": false,
      "properties": {
        "comparisons": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/GraphResolverScorerComparison"
          }
        },
        "combine": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "bias": {
              "type": "number",
              "format": "double"
            }
          }
        },
        "decision": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "match": {
              "type": "number",
              "format": "double"
            },
            "review": {
              "type": "number",
              "format": "double"
            }
          }
        }
      }
    },
    "GraphResolverScorerLevel": {
      "type": "object",
      "required": [
        "weight"
      ],
      "additionalProperties": false,
      "properties": {
        "when": {
          "type": "string",
          "description": "Matcher condition, such as 'exact' or 'jaro_winkler >= 0.9'."
        },
        "else": {
          "type": "boolean",
          "description": "Catch-all level when no previous condition matched."
        },
        "weight": {
          "type": "number",
          "format": "double"
        }
      }
    },
    "GraphResolverSuppressionConfig": {
      "type": "object",
      "additionalProperties": false,
      "description": "Suppress mentions before candidate search, embedding, adjudication and promotion. Suppressed mentions remain explainable in resolution artifacts and contribute no canonical graph edges. Changes use the normal resolver generation and bounded backfill lifecycle. Redirects to suppressed keys are rejected. Runtime suppressions are additive and outlive index versions.",
      "properties": {
        "keys": {
          "type": "array",
          "maxItems": 100000,
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 16384
          },
          "description": "Exact rendered canonical keys in this resolver namespace."
        },
        "texts": {
          "type": "array",
          "maxItems": 100000,
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 16384
          },
          "description": "Mention texts normalized with the resolver Unicode slug rules."
        },
        "min_text_chars": {
          "type": "integer",
          "format": "uint32",
          "minimum": 0,
          "default": 0,
          "description": "Minimum Unicode scalar count after trimming surrounding ASCII whitespace."
        }
      }
    },
    "GraphTemplateValue": {
      "description": "A literal string or finite numeric value, or a Handlebars template evaluated for each materialized graph item.",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "number",
          "format": "double"
        }
      ]
    },
    "GroupedArtifactSource": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "group_by",
        "order_by",
        "field"
      ],
      "properties": {
        "group_by": {
          "type": "string",
          "minLength": 1
        },
        "order_by": {
          "type": "string",
          "minLength": 1,
          "description": "Field containing an integer ordinal. Ties use the document key."
        },
        "segment_by": {
          "type": "string",
          "minLength": 1
        },
        "field": {
          "type": "string",
          "minLength": 1
        },
        "filter": {
          "type": "object",
          "additionalProperties": true,
          "description": "Canonical row filter evaluated on the source projection."
        },
        "max_bytes": {
          "type": "integer",
          "minimum": 1,
          "maximum": 4194304,
          "default": 32768,
          "description": "UTF-8 text bytes per unit, including joining newlines. An oversized single member fails explicitly."
        },
        "max_members": {
          "type": "integer",
          "minimum": 1,
          "maximum": 4096,
          "default": 1024,
          "description": "Maximum members per unit; larger partitions emit multiple units."
        },
        "window_ordinals": {
          "type": "integer",
          "minimum": 1,
          "maximum": 4096,
          "default": 128,
          "description": "Fixed ordinal cells bound repartitioning and incremental work for long groups."
        }
      }
    },
    "IndexExecutionConfig": {
      "type": "object",
      "additionalProperties": false,
      "description": "Namespaced execution policy for managed index shorthand. Only namespaces with runtime effects are accepted.",
      "properties": {
        "chunking": {
          "$ref": "#/$defs/ExecutionPolicy",
          "description": "Chunk producer batching for shorthand-created chunk enrichments."
        },
        "embedding": {
          "$ref": "#/$defs/ExecutionPolicy",
          "description": "Embedding producer batching for shorthand-created embedding enrichments."
        }
      }
    },
    "IndexPublicationPolicy": {
      "type": "string",
      "enum": [
        "progressive",
        "atomic"
      ],
      "default": "progressive",
      "description": "Publication behavior for a managed embeddings index. `progressive` makes a safely checkpointed active generation queryable before initial source coverage is complete. `atomic` keeps a new generation unavailable until complete validation and activation."
    },
    "MediaChunkPolicy": {
      "type": "object",
      "description": "Semantic chunk policy. Execution batch size and queue depth are deliberately separate.",
      "properties": {
        "max_text_bytes": {
          "type": "integer",
          "minimum": 4,
          "maximum": 16777216,
          "default": 1048576,
          "description": "Explicit byte ceiling per text chunk, independently of the target tokenizer budget."
        },
        "target_tokens": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1000000,
          "default": 500
        },
        "overlap_tokens": {
          "x-go-type-skip-optional-pointer": false,
          "type": "integer",
          "minimum": 0,
          "default": 50
        },
        "window_ns": {
          "type": "integer",
          "format": "int64",
          "minimum": 1,
          "default": 32000000000
        },
        "overlap_ns": {
          "type": "integer",
          "format": "int64",
          "minimum": 0,
          "default": 0
        },
        "step_ns": {
          "type": "integer",
          "format": "int64",
          "minimum": 1,
          "default": 1000000000
        },
        "video_hold": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1,
          "default": 1,
          "x-go-type-skip-optional-pointer": false,
          "description": "Select the displayed picture at each video cadence target, including VFR holds. Zero retains at-or-after timestamp sampling."
        },
        "max_frames": {
          "type": "integer",
          "minimum": 1,
          "maximum": 32,
          "default": 32
        },
        "tile_width": {
          "type": "integer",
          "minimum": 0,
          "default": 0
        },
        "tile_height": {
          "type": "integer",
          "minimum": 0,
          "default": 0
        },
        "tile_overlap": {
          "type": "integer",
          "minimum": 0,
          "default": 0
        },
        "audio_speaker_turns": {
          "type": "boolean",
          "default": false,
          "description": "Split audio chunks at detected speaker transitions, additionally respecting the boundary model limits. Requires a diarization-enabled boundary target, zero overlap_ns and zero audio_pause_ns. The boundary diarization recipe participates in plan identity. Analysis runs even with execute=false because these boundaries depend on audio inference."
        },
        "audio_pause_ns": {
          "type": "integer",
          "format": "int64",
          "minimum": 0,
          "default": 0,
          "description": "Optional minimum silence duration for choosing an earlier boundary; no samples are discarded."
        },
        "audio_pause_search_ns": {
          "type": "integer",
          "format": "int64",
          "minimum": 0,
          "default": 5000000000
        },
        "audio_silence_milli": {
          "x-go-type-skip-optional-pointer": false,
          "type": "integer",
          "minimum": 0,
          "maximum": 1000,
          "default": 10,
          "description": "Absolute normalized PCM amplitude threshold in thousandths."
        }
      }
    },
    "OllamaGeneratorConfig": {
      "type": "object",
      "description": "Configuration for the Ollama generative AI provider.\n",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "ollama"
          ]
        },
        "model": {
          "type": "string",
          "description": "The name of the Ollama model to use."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "The URL of the Ollama API endpoint."
        },
        "temperature": {
          "type": "number",
          "format": "float",
          "description": "Controls randomness in generation (0.0-2.0).",
          "minimum": 0.0,
          "maximum": 2.0
        },
        "max_tokens": {
          "type": "integer",
          "description": "Maximum number of tokens to generate."
        },
        "top_p": {
          "type": "number",
          "format": "float",
          "description": "Nucleus sampling parameter.",
          "minimum": 0.0,
          "maximum": 1.0
        },
        "top_k": {
          "type": "integer",
          "description": "Top-k sampling parameter."
        },
        "timeout": {
          "type": "integer",
          "description": "HTTP response timeout in seconds for Ollama API calls.",
          "minimum": 1
        }
      },
      "required": [
        "provider",
        "model"
      ]
    },
    "OpenAIGeneratorConfig": {
      "type": "object",
      "description": "Configuration for the OpenAI generative AI provider.\n",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "openai"
          ]
        },
        "model": {
          "type": "string",
          "description": "The name of the OpenAI model to use.",
          "default": "gpt-4.1"
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "The URL of the OpenAI API endpoint."
        },
        "api_key": {
          "type": "string",
          "writeOnly": true,
          "description": "The OpenAI API key."
        },
        "temperature": {
          "type": "number",
          "format": "float",
          "description": "Controls randomness in generation (0.0-2.0).",
          "minimum": 0.0,
          "maximum": 2.0
        },
        "max_tokens": {
          "type": "integer",
          "description": "Maximum number of tokens to generate."
        },
        "max_completion_tokens": {
          "type": "integer",
          "minimum": 1,
          "description": "OpenAI completion budget, including visible output and reasoning tokens.\nUse for reasoning models instead of max_tokens; the two are mutually exclusive.\n"
        },
        "reasoning_effort": {
          "$ref": "#/$defs/OpenAIReasoningEffort",
          "description": "Optional reasoning effort. Supported values depend on the selected OpenAI model."
        },
        "top_p": {
          "type": "number",
          "format": "float",
          "description": "Nucleus sampling parameter.",
          "minimum": 0.0,
          "maximum": 1.0
        },
        "frequency_penalty": {
          "type": "number",
          "format": "float",
          "description": "Penalty for token frequency (-2.0 to 2.0).",
          "minimum": -2.0,
          "maximum": 2.0
        },
        "presence_penalty": {
          "type": "number",
          "format": "float",
          "description": "Penalty for token presence (-2.0 to 2.0).",
          "minimum": -2.0,
          "maximum": 2.0
        }
      },
      "required": [
        "provider",
        "model"
      ]
    },
    "OpenAIReasoningEffort": {
      "type": "string",
      "enum": [
        "none",
        "minimal",
        "low",
        "medium",
        "high",
        "xhigh",
        "max"
      ],
      "description": "OpenAI reasoning effort; model support varies. Omit to use the model default."
    },
    "OpenRouterGeneratorConfig": {
      "type": "object",
      "description": "Configuration for the OpenRouter generative AI provider.\n",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "openrouter"
          ]
        },
        "model": {
          "type": "string",
          "description": "The OpenRouter model identifier to use."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "The URL of the OpenRouter API endpoint.",
          "default": "https://openrouter.ai/api/v1"
        },
        "api_key": {
          "type": "string",
          "writeOnly": true,
          "description": "The OpenRouter API key."
        },
        "temperature": {
          "type": "number",
          "format": "float",
          "description": "Controls randomness in generation (0.0-2.0).",
          "minimum": 0.0,
          "maximum": 2.0
        },
        "max_tokens": {
          "type": "integer",
          "description": "Maximum number of tokens to generate in the response."
        },
        "top_p": {
          "type": "number",
          "format": "float",
          "description": "Nucleus sampling parameter (0.0-1.0).",
          "minimum": 0.0,
          "maximum": 1.0
        },
        "frequency_penalty": {
          "type": "number",
          "format": "float",
          "description": "Penalty for token frequency (-2.0 to 2.0).",
          "minimum": -2.0,
          "maximum": 2.0
        },
        "presence_penalty": {
          "type": "number",
          "format": "float",
          "description": "Penalty for token presence (-2.0 to 2.0).",
          "minimum": -2.0,
          "maximum": 2.0
        }
      },
      "required": [
        "provider",
        "model"
      ]
    },
    "PriorArtifactContext": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "artifact",
        "render"
      ],
      "properties": {
        "artifact": {
          "type": "string",
          "minLength": 1,
          "description": "Artifact providing earlier items, including this producer's own artifact."
        },
        "render": {
          "type": "string",
          "minLength": 1,
          "description": "Template rendered for each prior item, newest first."
        },
        "max_items": {
          "type": "integer",
          "minimum": 1,
          "maximum": 256,
          "default": 40
        },
        "max_bytes": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1048576,
          "default": 16384
        },
        "horizon_segments": {
          "type": "integer",
          "minimum": 1,
          "maximum": 128,
          "default": 8,
          "description": "Earlier segments available for context and the maximum later segments invalidated at each affected position of an original source change. A move invalidates the old and new neighborhoods independently; recomputed outputs never extend either interval."
        }
      }
    },
    "RateLimitConfig": {
      "type": "object",
      "x-go-type-skip-optional-pointer": false,
      "additionalProperties": false,
      "description": "Outbound provider limits shared within one Antfly process by effective\nendpoint, operation, model, credential source, project and region/location.\nConflicting policies for an active scope are rejected. These limits do\nnot coordinate across replicas or infer the provider's account quota.\n",
      "properties": {
        "pacing": {
          "$ref": "#/$defs/RequestPacing",
          "description": "Request pacing mode. Defaults to token_bucket. Legacy flat embedder RPM with burst=1 uses completion pacing."
        },
        "requests_per_minute": {
          "type": "integer",
          "format": "int64",
          "minimum": 1,
          "maximum": 4294967295
        },
        "burst": {
          "type": "integer",
          "format": "int64",
          "minimum": 1,
          "maximum": 4294967295,
          "default": 1
        },
        "tokens_per_minute": {
          "type": "integer",
          "format": "int64",
          "minimum": 1,
          "description": "Conservative text budget: each HTTP attempt reserves its serialized\nUTF-8 body byte count plus the configured generation output cap.\nReservations are not refunded. A request larger than this budget\nis rejected. This is not provider billing token accounting; media\nrequests are not supported with this limit.\n"
        },
        "max_concurrency": {
          "type": "integer",
          "format": "int64",
          "minimum": 1,
          "maximum": 4294967295,
          "description": "Maximum in-flight HTTP attempts, held through response completion."
        }
      }
    },
    "RelationalComparisonOp": {
      "type": "string",
      "enum": [
        "is_null",
        "is_not_null",
        "eq",
        "ne",
        "gt",
        "gte",
        "lt",
        "lte",
        "is_distinct",
        "is_not_distinct"
      ]
    },
    "RelationalExpressionOp": {
      "type": "string",
      "enum": [
        "literal",
        "column",
        "add",
        "subtract",
        "multiply",
        "divide",
        "negate",
        "concat",
        "coalesce",
        "lower_ascii",
        "upper_ascii",
        "eq",
        "ne",
        "gt",
        "gte",
        "lt",
        "lte",
        "is_null",
        "is_not_null",
        "is_distinct",
        "is_not_distinct",
        "and",
        "or",
        "not",
        "cast",
        "case_when",
        "modulo",
        "in_list",
        "not_in_list",
        "array"
      ]
    },
    "RelationalExpressionType": {
      "type": "string",
      "enum": [
        "string",
        "blob",
        "boolean",
        "datetime",
        "integer",
        "number",
        "numeric",
        "sql_array"
      ]
    },
    "RelationalIndexConfig": {
      "type": "object",
      "required": [
        "keys"
      ],
      "description": "Schema-bound composite ordered index on a relational table. Keys use stable typed comparison semantics and independent direction, null placement, and string collation. Existing rows build asynchronously; indexed queries require complete owner coverage. The table schema is the single durable authority for these definitions.\n",
      "properties": {
        "keys": {
          "type": "array",
          "minItems": 1,
          "maxItems": 32,
          "items": {
            "$ref": "#/$defs/RelationalIndexKey"
          }
        },
        "include_columns": {
          "type": "array",
          "maxItems": 256,
          "uniqueItems": true,
          "description": "Non-key columns stored for index-only projection; distinct from keys.",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "where": {
          "type": "array",
          "maxItems": 256,
          "description": "Optional conjunction selecting index members. Queries must explicitly include all typed conjuncts.",
          "items": {
            "$ref": "#/$defs/RelationalIndexPredicate"
          }
        }
      }
    },
    "RelationalIndexKey": {
      "type": "object",
      "additionalProperties": false,
      "description": "Ordered component of a relational ordered-tuple index key. Supply\neither a declared column or a deterministic typed scalar expression\nwith its result_type. Composite keys may mix both forms. Bounds use\nthe expression result type, not its input columns.\n",
      "properties": {
        "column": {
          "type": "string",
          "minLength": 1,
          "description": "Declared relational column used by this key component."
        },
        "expression": {
          "$ref": "#/$defs/RelationalScalarExpression"
        },
        "result_type": {
          "$ref": "#/$defs/RelationalExpressionType"
        },
        "collation": {
          "type": "string",
          "minLength": 1,
          "description": "String-key collation. Omission selects binary ordering. Supported\nbinary aliases are C, POSIX, and binary. The aliases ci,\ncase_insensitive, and antfly.case_insensitive select ASCII-only\ncase folding, not locale-aware or Unicode case folding.\n"
        },
        "direction": {
          "$ref": "#/$defs/RelationalIndexKeyDirection"
        },
        "nulls": {
          "$ref": "#/$defs/RelationalIndexKeyNulls"
        }
      }
    },
    "RelationalIndexKeyDirection": {
      "type": "string",
      "enum": [
        "asc",
        "desc"
      ],
      "description": "Direction of one ordered index key component. Omission selects asc."
    },
    "RelationalIndexKeyNulls": {
      "type": "string",
      "enum": [
        "default",
        "first",
        "last"
      ],
      "description": "Null placement for one ordered index key component. The default is\nlast for ascending keys and first for descending keys. Omission selects default.\n"
    },
    "RelationalIndexPredicate": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "column",
        "op"
      ],
      "description": "A typed partial-index conjunct. Only TRUE is indexed; FALSE and SQL UNKNOWN are excluded.",
      "properties": {
        "column": {
          "type": "string",
          "minLength": 1
        },
        "op": {
          "$ref": "#/$defs/RelationalComparisonOp"
        },
        "value": {
          "description": "Typed scalar operand; integer columns also accept exact decimal strings. Omission means NULL."
        },
        "collation": {
          "type": "string",
          "description": "String comparison collation with the same semantics as ordered keys."
        }
      }
    },
    "RelationalScalarExpression": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "op"
      ],
      "description": "Immutable typed scalar expression, limited to 128 nodes and 16 levels.\nA literal requires type; omitted value means typed null. A column\nrequires column; other\noperations require args. Unknown or irrelevant fields are rejected.\nArithmetic operands have the same integer or number type. Integer\ndivision truncates toward zero. Overflow and division by zero reject\nthe write. Arithmetic and string operations propagate null. ASCII case\noperations leave non-ASCII bytes unchanged. No volatile functions are\naccepted. Allocated results are bounded to 1 MiB each. Allocations\nand byte-comparison operand work share a 4 MiB evaluation budget per\nrow and expression set. An integer literal may use a decimal string\nfor exact int64 transport; blob uses base64 and datetime uses the\nnormal relational datetime representation.\nComparisons require operands of compatible types (integer and number may mix) and return boolean or\nSQL UNKNOWN (null); is_distinct and is_not_distinct always return a\nboolean. Unary is_null and is_not_null test presence/null. AND and OR\nevaluate left to right with SQL three-valued short-circuit semantics;\nNOT preserves UNKNOWN. CHECK accepts TRUE and UNKNOWN, rejecting FALSE.\nNumeric literals and arithmetic operations may specify sql_type to\nretain PostgreSQL builtin overflow and float4 rounding semantics.\nWithout it, integer and number operations retain int64 and float64\nsemantics. Numeric cast requires type and sql_type, takes one numeric\nargument, and performs a checked conversion when evaluated (not when\nthe schema is compiled). Floating-to-integer casts round ties to even.\nThe numeric expression type uses exact PostgreSQL NUMERIC values and\nmay specify sql_type numeric. Its literals accept decimal strings or\nexact JSON numeric lexemes, including string-valued special values.\nExact NUMERIC programs require reader capability version 21 even when\ntheir result is boolean or integer. Float/integer assignment casts keep\ntheir declared PostgreSQL rounding and overflow semantics.\nA cast to numeric may specify numeric_modifier for PostgreSQL precision\nand signed-scale coercion. Overflow is checked when the selected cast\nexecutes; unselected lazy branches do not fail. Modifier-bearing programs\nrequire reader capability version 23 even with integer/boolean output.\nThe sql_array expression type requires sql_type on literals, including\ntyped NULL, to declare the element builtin. Non-null literals use the\nordinal SQL array envelope (dimensions with length/lower_bound, values,\nand sql_nulls), retaining shape and lower bounds. Array columns derive\ntheir exact element identity from the immutable schema. Comparisons,\nIN, COALESCE and CASE require matching array element identities; no\nelement type is inferred from values. Array-dependent programs require\nreader capability version 24 even with scalar output. Assignment to a\nNUMERIC array column applies its precision/signed-scale modifier to\neach element. Array casts require type sql_array and an explicit matching\nsql_type; identity casts borrow the immutable input. Casts of numeric\narrays may additionally specify numeric_modifier, coercing each non-NULL\nelement with PostgreSQL precision and signed-scale semantics while\npreserving dimensions, lower bounds and NULL slots. Coercion is lazy\nand shares invocation admission with the surrounding expression.\nArray-valued ordered index keys and element-changing array casts are\nnot supported by this expression contract.\nThe array constructor requires sql_type and zero to 32 arguments.\nConstructor programs additionally require reader capability version 25,\nincluding constructors hidden inside scalar/boolean expressions.\nScalar arguments must have the declared element domain, with explicit\nwidth-preserving numeric casts where needed. SQL NULL arguments become\nNULL elements. Array arguments must all have matching element types,\ndimensions and lower bounds; one leading dimension with lower bound 1\nis added. All empty/NULL subarrays produce an empty array; mixing an\nempty/NULL subarray with a nonempty one is a dimension mismatch. Child\nexpressions execute once, with shared work/cancellation and byte limits.\ncase_when takes alternating boolean conditions and result expressions,\nfollowed by a mandatory fallback result (3 to 31 arguments, at most\n15 branches). Conditions are evaluated in order; only the selected\nresult is evaluated, and a NULL condition is not TRUE. All result\nexpressions must have the same physical type. Numeric SQL lowering\nrecords builtin result-domain promotions as explicit casts. This\noperation requires schema capability version 18.\nmodulo takes two same-domain integer or NUMERIC operands and returns the signed\nremainder (minInt modulo -1 is zero); a zero divisor rejects the write.\nin_list and not_in_list take one probe followed by 1 to 127 same-domain\ncandidates. The probe is evaluated once; NULL probes return UNKNOWN.\nA matching candidate wins over NULL candidates; otherwise a NULL\ncandidate makes the result UNKNOWN. These operations require schema\ncapability version 19.\n",
      "properties": {
        "op": {
          "$ref": "#/$defs/RelationalExpressionOp"
        },
        "type": {
          "$ref": "#/$defs/RelationalExpressionType"
        },
        "sql_type": {
          "$ref": "#/$defs/SQLBuiltinType",
          "description": "Numeric builtin result identity on numeric literals, arithmetic, negate, and cast (capability version 18), or required array element identity on sql_array literals including typed NULL (capability version 24)."
        },
        "numeric_modifier": {
          "$ref": "#/$defs/SQLNumericModifier",
          "description": "Optional precision/signed-scale coercion; accepted only on cast with type numeric and sql_type numeric. Requires reader capability version 23."
        },
        "value": {
          "description": "Typed literal value, including null."
        },
        "column": {
          "type": "string",
          "minLength": 1
        },
        "collation": {
          "type": "string",
          "description": "Optional binary or ASCII case-insensitive collation for string comparisons and in_list; aliases match ordered indexes."
        },
        "args": {
          "type": "array",
          "maxItems": 128,
          "items": {
            "$ref": "#/$defs/RelationalScalarExpression"
          }
        }
      }
    },
    "RequestPacing": {
      "type": "string",
      "enum": [
        "token_bucket",
        "completion"
      ],
      "description": "token_bucket limits admission rate while allowing overlapping attempts.\ncompletion serializes attempts and waits one RPM interval after each\nattempt finishes, including streamed writes and transport failures.\nThis prevents delayed connection setup from compressing successful\nrequest spacing, at the cost of response latency plus one interval per\nrequest. Requires requests_per_minute and burst=1. Neither mode can\nguarantee zero upstream 429s or coordinate other processes.\n"
    },
    "SQLBuiltinType": {
      "type": "string",
      "description": "Exact PostgreSQL builtin identity for a relational root scalar column.\nSQL array columns use SQLArrayElementType for their element identity.\nSet the JSON Schema property's `x-antfly-sql-type` annotation to one of\nthese values. The underlying property type must match. SQL array storage\nis not implied by this annotation. Existing unannotated schemas retain\ntheir original domains.\nThe numeric identity uses an underlying number property and exact\nPostgreSQL NUMERIC semantics, never binary float. Submit finite values\nas JSON numeric lexemes or decimal strings; special values use strings\nNaN, Infinity and -Infinity. Const/enum finite numeric members must be\nJSON numbers, not strings. Bounds and multipleOf are exact decimals.\nPublic scalar NUMERIC schemas require reader capability version 22.\nTo constrain a NUMERIC scalar or SQL-array column, set the root\nproperty's `x-antfly-sql-numeric-modifier` annotation to an object with\nprecision (1..1000) and signed scale (-1000..1000). The annotation\nrequires numeric identity and reader capability version 23. Assignment\nrounds before constraints, indexes and generated dependents; overflow\nrejects the write. Restore verifies stored values without rounding.\n",
      "enum": [
        "text",
        "int16",
        "int32",
        "int64",
        "float32",
        "float64",
        "boolean",
        "uuid",
        "jsonb",
        "numeric"
      ]
    },
    "SQLNumericModifier": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "precision",
        "scale"
      ],
      "description": "PostgreSQL NUMERIC precision and signed scale. For arrays this describes every element, not dimensions. Absent means unconstrained NUMERIC.",
      "properties": {
        "precision": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1000
        },
        "scale": {
          "type": "integer",
          "minimum": -1000,
          "maximum": 1000
        }
      }
    },
    "TextAnalysisComponent": {
      "type": "object",
      "required": [
        "type"
      ],
      "description": "One named analysis component: its type and type-specific configuration.",
      "properties": {
        "type": {
          "type": "string"
        },
        "config": {
          "type": "object",
          "additionalProperties": true
        }
      }
    },
    "TextAnalysisConfig": {
      "type": "object",
      "description": "Custom text analysis for a full-text index. Component maps are keyed\nby the name that analyzers and `field_analyzers` reference. Built-in\nanalyzers (`standard`, `simple`, `keyword`, `html`, `search_as_you_type`,\n`substring`, and the language analyzers such as `german`) are always\navailable without declaring them.\n\nExample: split camelCase identifiers and match them as substrings.\n\n```json\n{\n  \"analysis_config\": {\n    \"field_analyzers\": {\"symbol\": \"code\"},\n    \"token_filters\": {\n      \"tails\": {\"type\": \"suffix\", \"config\": {\"min\": 3, \"max\": 24}}\n    },\n    \"analyzers\": {\n      \"code\": {\n        \"type\": \"custom\",\n        \"config\": {\n          \"tokenizer\": \"whitespace\",\n          \"token_filters\": [\"camel_case\", \"unique\", \"tails\"]\n        }\n      }\n    }\n  }\n}\n```\n",
      "properties": {
        "field_analyzers": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Map of indexed field name to analyzer name. Overrides the analyzer derived from the table schema for that field."
        },
        "char_filters": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/TextAnalysisComponent"
          },
          "description": "Named character filters. Types: `html_strip` (alias `html`), `ascii_fold`, `zero_width_non_joiner`."
        },
        "tokenizers": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/TextAnalysisComponent"
          },
          "description": "Named tokenizers. Types: `unicode` (alias `unicode_words`), `whitespace`, `keyword`, `character`, `ngram` (`config.min`, `config.max`), `edge_ngram` (`config.min`, `config.max`, `config.side` of `front` or `back`)."
        },
        "token_filters": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/TextAnalysisComponent"
          },
          "description": "Named token filters. Types: `lowercase` (alias `to_lower`), `stop_words` (alias `stop`; optional `config.language`), `stemmer` (optional `config.language`), `ngram` and `edge_ngram` (`config.min`, `config.max`), `shingle` (`config.min`, `config.max`, `config.separator` of `space` or `none`), `suffix` (`config.min`, `config.max`; emits every suffix of each token so prefix queries answer containment), `length` (`config.min`, `config.max`), `truncate` (`config.length`), `camel_case`, `unique`, `reverse`, `elision`, `apostrophe`. Languages: english, german, french, spanish, italian, portuguese, dutch, swedish, norwegian, danish, finnish."
        },
        "analyzers": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/TextAnalysisComponent"
          },
          "description": "Named analyzers of type `custom`. `config.tokenizer` names a built-in or declared tokenizer; `config.char_filters` and `config.token_filters` list built-in or declared component names in application order. Configuration-free filters (`lowercase`, `stop_words`, `stemmer`, `camel_case`, `unique`, `reverse`, `elision`, `apostrophe`, `suffix`) can be listed by name without declaring them."
        },
        "default_datetime_parser": {
          "type": "string",
          "description": "Name of the date-time parser applied to datetime fields without a field-specific parser."
        },
        "field_date_time_parsers": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Map of field name to date-time parser name."
        },
        "date_time_parsers": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/TextAnalysisComponent"
          },
          "description": "Named date-time parsers. Type `sanitizedgo` accepts `config.layouts`, a list of Go reference-time layouts tried in order."
        }
      }
    },
    "TextChunkOptions": {
      "type": "object",
      "description": "Options specific to text chunking.",
      "properties": {
        "target_tokens": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1000000,
          "description": "Target number of tokens per chunk."
        },
        "overlap_tokens": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1000000,
          "description": "Number of tokens to overlap between consecutive chunks. Helps maintain context across chunk boundaries. Only used by fixed-size chunkers."
        },
        "separator": {
          "type": "string",
          "description": "Separator string for splitting (e.g., '\\n\\n' for paragraphs). Only used by fixed-size chunkers."
        }
      }
    },
    "VertexGeneratorConfig": {
      "type": "object",
      "description": "Configuration for Google Cloud Vertex AI generative models.\n",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "vertex"
          ]
        },
        "model": {
          "type": "string",
          "description": "The name of the Vertex AI model to use.",
          "default": "gemini-2.5-flash"
        },
        "project_id": {
          "type": "string",
          "description": "Google Cloud project ID."
        },
        "location": {
          "type": "string",
          "description": "Google Cloud region for Vertex AI API.",
          "default": "us-central1"
        },
        "credentials_path": {
          "type": "string",
          "writeOnly": true,
          "description": "Path to service account JSON key file."
        },
        "temperature": {
          "type": "number",
          "format": "float",
          "description": "Controls randomness in generation (0.0-2.0).",
          "minimum": 0.0,
          "maximum": 2.0
        },
        "max_tokens": {
          "type": "integer",
          "description": "Maximum number of tokens to generate in the response."
        },
        "top_p": {
          "type": "number",
          "format": "float",
          "description": "Nucleus sampling parameter (0.0-1.0).",
          "minimum": 0.0,
          "maximum": 1.0
        },
        "top_k": {
          "type": "integer",
          "description": "Top-k sampling parameter."
        }
      },
      "required": [
        "provider",
        "model"
      ]
    }
  }
}