{
  "id": "tablestore-mem",
  "name": "TableStore Memory",
  "description": "OpenClaw memory plugin backed by TableStore memory APIs.",
  "kind": "memory",
  "configSchema": {
    "type": "object",
    "additionalProperties": true,
    "properties": {
      "endpoint": {
        "type": "string"
      },
      "otsInstanceName": {
        "type": "string",
        "pattern": "^[A-Za-z0-9_-]{1,64}$"
      },
      "accessKeyId": {
        "type": "string"
      },
      "accessKeySecret": {
        "type": "string"
      },
      "apiKey": {
        "type": "string"
      },
      "api_key": {
        "type": "string"
      },
      "appId": {
        "type": "string"
      },
      "app_id": {
        "type": "string"
      },
      "tenantId": {
        "type": "string"
      },
      "tenant_id": {
        "type": "string"
      },
      "memoryStoreName": {
        "type": "string",
        "pattern": "^[A-Za-z0-9_]{1,32}$"
      },
      "extractInstructions": {
        "type": "string",
        "maxLength": 4096
      },
      "searchTopK": {
        "type": "number",
        "minimum": 1,
        "maximum": 50
      },
      "minSimilarity": {
        "type": "number",
        "minimum": 0,
        "maximum": 1
      },
      "enableRerank": {
        "type": "boolean"
      },
      "autoCreateMemoryStore": {
        "type": "boolean"
      },
      "writebackEnabled": {
        "type": "boolean"
      },
      "writebackCursorPersist": {
        "type": "boolean"
      },
      "includeScores": {
        "type": "boolean"
      },
      "minQueryLength": {
        "type": "number",
        "minimum": 0
      },
      "dreamEnabled": {
        "type": "boolean"
      },
      "dreamIntervalHours": {
        "type": "number",
        "minimum": 0
      },
      "dreamMinIntervalHours": {
        "type": "number",
        "minimum": 0
      },
      "dreamApplyMode": {
        "type": "string",
        "enum": ["safe_auto", "proposal"]
      },
      "dreamConfidenceThreshold": {
        "type": "number",
        "minimum": 0,
        "maximum": 1
      },
      "dreamConfidenceThresholds": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "add": { "type": "number", "minimum": 0, "maximum": 1 },
          "update": { "type": "number", "minimum": 0, "maximum": 1 },
          "merge": { "type": "number", "minimum": 0, "maximum": 1 }
        }
      },
      "dreamInstructions": {
        "type": "string",
        "maxLength": 4000
      },
      "dreamMaxScopesPerRun": {
        "type": "number",
        "minimum": 1,
        "maximum": 20
      },
      "dreamOnSessionEnd": {
        "type": "boolean"
      }
    }
  },
  "uiHints": {
    "endpoint": {
      "label": "OTS Endpoint",
      "help": "Optional TableStore endpoint. If unset, the plugin derives it from the instance name or auto-creates a Beijing instance."
    },
    "otsInstanceName": {
      "label": "OTS Instance Name",
      "help": "Optional TableStore instance name. If unset, the plugin auto-creates and persists one in Beijing."
    },
    "accessKeyId": {
      "label": "Access Key ID",
      "help": "TableStore access key id",
      "sensitive": true
    },
    "accessKeySecret": {
      "label": "Access Key Secret",
      "help": "TableStore access key secret",
      "sensitive": true
    },
    "apiKey": {
      "label": "API Key",
      "help": "Optional TableStore memory API Key. When set, it is used instead of AccessKey, and requires an explicit https endpoint and instance name (no managed-instance auto-create).",
      "sensitive": true
    },
    "memoryStoreName": {
      "label": "Memory Store Name",
      "help": "Optional memory store name. Defaults to openclaw_mem."
    },
    "extractInstructions": {
      "label": "Extract Instructions",
      "help": "Memory-store-level custom extraction prompt (<=4096 chars) guiding which long-term memories are extracted"
    },
    "searchTopK": {
      "label": "Search Top K",
      "help": "How many memories to inject before each turn"
    },
    "minSimilarity": {
      "label": "Min Similarity",
      "help": "Filter out retrieved memories whose normalized cosine similarity is below this value (0..1; 0 = no filter)"
    },
    "enableRerank": {
      "label": "Enable Rerank",
      "help": "Whether SearchMemories should request reranking"
    },
    "autoCreateMemoryStore": {
      "label": "Auto Create Store",
      "help": "Create the memory store automatically on first use when missing"
    },
    "writebackEnabled": {
      "label": "Writeback Enabled",
      "help": "Store turn messages after each successful agent run"
    },
    "writebackCursorPersist": {
      "label": "Persist Writeback Cursor",
      "help": "Persist the per-session writeback position to disk so a gateway restart does not re-ingest the session history (default on)"
    },
    "includeScores": {
      "label": "Include Scores",
      "help": "Include result scores in injected context"
    },
    "minQueryLength": {
      "label": "Min Query Length",
      "help": "Skip automatic retrieval for very short prompts"
    },
    "dreamEnabled": {
      "label": "Dream Enabled",
      "help": "Run offline Dream memory consolidation in the background and queue written scopes for cleanup"
    },
    "dreamIntervalHours": {
      "label": "Dream Interval (hours)",
      "help": "How often the background Dream consolidation cycle runs"
    },
    "dreamMinIntervalHours": {
      "label": "Dream Min Interval (hours)",
      "help": "Minimum time before the same scope is consolidated again"
    },
    "dreamApplyMode": {
      "label": "Dream Apply Mode",
      "help": "safe_auto applies high-confidence consolidations automatically; proposal only generates proposals"
    },
    "dreamConfidenceThreshold": {
      "label": "Dream Confidence Threshold",
      "help": "Default confidence (0-1) required for safe_auto to auto-apply add/update/merge actions"
    },
    "dreamConfidenceThresholds": {
      "label": "Dream Confidence Thresholds (per action)",
      "help": "Per-action safe_auto thresholds (add/update/merge); falls back to Dream Confidence Threshold for unset actions"
    },
    "dreamInstructions": {
      "label": "Dream Instructions",
      "help": "Custom consolidation instructions (<=4000 chars) passed to each Dream task"
    },
    "dreamMaxScopesPerRun": {
      "label": "Dream Max Scopes Per Run",
      "help": "Maximum number of scopes consolidated in one Dream cycle (max 20)"
    },
    "dreamOnSessionEnd": {
      "label": "Dream On Session End",
      "help": "Consolidate a session's memory as soon as it ends (rotation/reset/idle), in addition to the periodic cycle"
    }
  }
}
