{
  "$ref": "#/definitions/MemoryRecord",
  "definitions": {
    "MemoryRecord": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "layer": {
          "type": "string",
          "enum": [
            "stm",
            "ltm",
            "episodic",
            "semantic",
            "documentary"
          ]
        },
        "content": {
          "type": "string"
        },
        "metadata": {
          "type": "object",
          "properties": {},
          "additionalProperties": {}
        },
        "createdAt": {
          "type": "number"
        },
        "updatedAt": {
          "type": "number"
        },
        "importance": {
          "type": "number"
        },
        "sessionId": {
          "type": [
            "string",
            "null"
          ]
        },
        "episodeId": {
          "type": [
            "string",
            "null"
          ]
        },
        "summary": {
          "type": [
            "string",
            "null"
          ]
        },
        "embeddingId": {
          "type": [
            "string",
            "null"
          ]
        },
        "references": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "docId": {
                "type": "string"
              },
              "chunkId": {
                "type": "string"
              },
              "score": {
                "type": "number"
              },
              "relation": {
                "type": "string"
              }
            },
            "required": [
              "docId"
            ],
            "additionalProperties": false
          }
        }
      },
      "required": [
        "id",
        "layer",
        "content",
        "metadata",
        "createdAt",
        "updatedAt",
        "importance"
      ],
      "additionalProperties": false
    }
  },
  "$schema": "http://json-schema.org/draft-07/schema#"
}