{
  "type": "record",
  "name": "MemoryEntry",
  "namespace": "orka.memory",
  "doc": "OrKa memory entry with structured content and metadata",
  "fields": [
    {
      "name": "id",
      "type": "string",
      "doc": "Unique identifier for the memory entry"
    },
    {
      "name": "content",
      "type": "string",
      "doc": "The actual content/text of the memory"
    },
    {
      "name": "metadata",
      "type": {
        "type": "record",
        "name": "MemoryMetadata",
        "fields": [
          {
            "name": "source",
            "type": "string",
            "doc": "Source of the memory (e.g., validation-guard, user-input)"
          },
          {
            "name": "confidence",
            "type": "double",
            "doc": "Confidence score (0.0 to 1.0)"
          },
          {
            "name": "reason",
            "type": ["null", "string"],
            "default": null,
            "doc": "Optional reason or explanation"
          },
          {
            "name": "fact",
            "type": ["null", "string"],
            "default": null,
            "doc": "Extracted fact or insight"
          },
          {
            "name": "timestamp",
            "type": "double",
            "doc": "Unix timestamp when created"
          },
          {
            "name": "agent_id",
            "type": "string",
            "doc": "ID of the agent that created this memory"
          },
          {
            "name": "query",
            "type": ["null", "string"],
            "default": null,
            "doc": "Original query that led to this memory"
          },
          {
            "name": "tags",
            "type": {
              "type": "array",
              "items": "string"
            },
            "default": [],
            "doc": "Tags for categorization"
          },
          {
            "name": "vector_embedding",
            "type": ["null", {
              "type": "array",
              "items": "double"
            }],
            "default": null,
            "doc": "Optional vector embedding for semantic search"
          },
          {
            "name": "category",
            "type": ["null", "string"],
            "default": null,
            "doc": "Category for memory separation (log, stored, etc.)"
          }
        ]
      },
      "doc": "Metadata associated with the memory entry"
    },
    {
      "name": "similarity",
      "type": ["null", "double"],
      "default": null,
      "doc": "Similarity score when retrieved from search"
    },
    {
      "name": "ts",
      "type": "long",
      "doc": "Timestamp in nanoseconds"
    },
    {
      "name": "match_type",
      "type": {
        "type": "enum",
        "name": "MatchType",
        "symbols": ["exact", "semantic", "fuzzy", "stream", "hybrid"]
      },
      "default": "semantic",
      "doc": "Type of match when retrieved"
    },
    {
      "name": "stream_key",
      "type": "string",
      "doc": "Stream/topic key for partitioning"
    }
  ]
} 