{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/callidus-legal-ai/json-schema/callidus-legal-ai-deep-search-request-schema.json",
  "title": "DeepSearchRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/callidus-legal-ai-cases-api-openapi.yml#/components/schemas/DeepSearchRequest",
  "properties": {
    "query": {
      "type": "string",
      "title": "Query"
    },
    "db_jurisdictions": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Db Jurisdictions"
    },
    "max_cases": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Max Cases"
    },
    "vector_search_config": {
      "anyOf": [
        {
          "$ref": "#/$defs/VectorSearchConfig"
        },
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Vector Search Config"
    },
    "use_optimized_query": {
      "type": "boolean",
      "title": "Use Optimized Query",
      "default": false
    }
  },
  "type": "object",
  "required": [
    "query",
    "db_jurisdictions"
  ],
  "$defs": {
    "VectorSearchConfig": {
      "properties": {
        "max_vector_results": {
          "type": "integer",
          "title": "Max Vector Results"
        },
        "ann_k_scale": {
          "type": "integer",
          "title": "Ann K Scale"
        },
        "ann_k_max": {
          "type": "integer",
          "title": "Ann K Max"
        },
        "ef_search": {
          "type": "integer",
          "title": "Ef Search"
        },
        "rerank_candidates": {
          "type": "integer",
          "title": "Rerank Candidates"
        }
      },
      "type": "object",
      "required": [
        "max_vector_results",
        "ann_k_scale",
        "ann_k_max",
        "ef_search",
        "rerank_candidates"
      ],
      "title": "VectorSearchConfig",
      "description": "Tunable configuration for the vector search step.\n\nThis centralizes the main \"levers\" for ANN + HNSW search so we can:\n- Log the exact settings used for a given run\n- Vary them per-environment via env/config\n- Optionally override them per-request when experimenting."
    }
  }
}