{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/codai-ro/json-schema/codai-ro-memory-list-schema.json",
  "title": "MemoryList",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/codai-ro-memory-api-openapi.yml#/components/schemas/MemoryList",
  "type": "object",
  "required": [
    "memories",
    "total"
  ],
  "properties": {
    "memories": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/MemoryItem"
      }
    },
    "total": {
      "type": "integer",
      "minimum": 0,
      "description": "Total memories matching the filter."
    }
  },
  "$defs": {
    "MemoryItem": {
      "type": "object",
      "description": "One stored memory.",
      "required": [
        "id",
        "tier",
        "content",
        "importance",
        "createdAt"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "tier": {
          "type": "string",
          "enum": [
            "semantic",
            "episodic",
            "procedural",
            "graph"
          ]
        },
        "content": {
          "type": "string"
        },
        "importance": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Importance from 0 to 1, rounded to 2 decimals."
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "description": "When the memory was stored (ISO 8601)."
        }
      }
    }
  }
}