{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/studiomeyer-io/json-schema/studiomeyer-io-search-response-schema.json",
  "title": "SearchResponse",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/memory-openapi.json#/components/schemas/SearchResponse",
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "count": {
      "type": "integer"
    },
    "abstain": {
      "type": "boolean"
    },
    "answerConfidence": {
      "type": "number"
    },
    "abstainNote": {
      "type": "string"
    },
    "rerankProvider": {
      "type": "string"
    },
    "rerankMs": {
      "type": "number"
    },
    "tagFilter": {
      "type": "object",
      "properties": {
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "match": {
          "const": "all"
        },
        "supportedTypes": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "learning",
              "decision",
              "skill"
            ]
          }
        }
      },
      "required": [
        "tags",
        "match",
        "supportedTypes"
      ]
    },
    "queryExpansion": {
      "type": "object",
      "properties": {
        "subQueries": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "isListQuery": {
          "type": "boolean"
        },
        "isTemporalComputation": {
          "type": "boolean"
        },
        "expandedKeywords": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "subQueries",
        "isListQuery",
        "isTemporalComputation",
        "expandedKeywords"
      ]
    },
    "results": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/SearchResult"
      }
    }
  },
  "required": [
    "success",
    "count",
    "abstain",
    "results"
  ],
  "$defs": {
    "SearchResult": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "decision",
            "learning",
            "session",
            "skill",
            "evolution",
            "entity"
          ]
        },
        "id": {
          "type": "string"
        },
        "date": {
          "type": "string",
          "format": "date-time"
        },
        "content": {
          "type": "string"
        },
        "category": {
          "type": "string"
        },
        "project": {
          "type": [
            "string",
            "null"
          ]
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "relevance": {
          "type": "number"
        },
        "recency": {
          "type": "number"
        },
        "rank": {
          "type": "number"
        },
        "matchMethod": {
          "type": "string"
        },
        "confidence": {
          "type": "number"
        },
        "verified": {
          "type": "boolean"
        },
        "rrfScore": {
          "type": "number"
        },
        "importanceScore": {
          "type": "number"
        },
        "lifecycleState": {
          "type": "string"
        },
        "agentId": {
          "type": "string"
        },
        "validFrom": {
          "type": "string",
          "format": "date-time"
        },
        "validTo": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "ingestedAt": {
          "type": "string",
          "format": "date-time"
        },
        "superseded": {
          "type": "boolean"
        },
        "memoryType": {
          "type": "string",
          "enum": [
            "episodic",
            "semantic"
          ]
        },
        "explanation": {
          "type": "object",
          "additionalProperties": true
        }
      },
      "required": [
        "type",
        "id",
        "date",
        "content",
        "relevance",
        "recency",
        "rank",
        "matchMethod"
      ]
    }
  }
}