{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/tryorcha-com/json-schema/tryorcha-com-search-request-schema.json",
  "title": "SearchRequest",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/tryorcha-com-openapi.json#/components/schemas/SearchRequest",
  "type": "object",
  "required": [
    "query"
  ],
  "properties": {
    "query": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1000,
      "description": "Supports websearch syntax: quoted phrases and -excluded terms"
    },
    "searches": {
      "type": "array",
      "maxItems": 8,
      "description": "Typed sub-queries fused with the original query by weighted reciprocal-rank fusion; the original query runs at double weight",
      "items": {
        "type": "object",
        "required": [
          "type",
          "text"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "lex",
              "vec",
              "hyde"
            ],
            "description": "lex routes to full-text search; vec and hyde to vector search (hyde is a short hypothetical answer passage)"
          },
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          }
        }
      }
    },
    "strategy": {
      "type": "string",
      "enum": [
        "keyword",
        "semantic",
        "hybrid"
      ],
      "default": "hybrid"
    },
    "mode": {
      "type": "string",
      "enum": [
        "fast",
        "balanced",
        "fresh"
      ],
      "default": "balanced",
      "description": "fast searches retained content only; balanced adds the connected-source catalog with bounded live fetches of decisive matches; fresh additionally consults live-mode providers"
    },
    "sourceIds": {
      "type": "array",
      "maxItems": 10,
      "items": {
        "type": "string",
        "format": "uuid"
      },
      "description": "Restrict results to specific connected sources"
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 50,
      "default": 10
    },
    "minScore": {
      "type": "number",
      "description": "Drop results scoring below this value"
    },
    "tokenBudget": {
      "type": "integer",
      "description": "Pack results within an approximate token budget"
    },
    "explain": {
      "type": "boolean",
      "default": false,
      "description": "Attach per-result score traces"
    }
  },
  "additionalProperties": false
}