{"owner":"TencentCloud","repo":"TencentDB-Agent-Memory","hasSkills":true,"totalSkillsCount":3,"totalTokensCount":7763,"categories":["plugin-manifest","anthropic-skill"],"hasMcp":false,"mcpConfig":null,"found":["MemoryCore/openclaw-plugin/openclaw.plugin.json","MemoryCore/SKILL.md","MemoryCore/openclaw.plugin.json"],"skills":{"MemoryCore/openclaw-plugin/openclaw.plugin.json":"{\n  \"id\": \"memory-tencentdb-client\",\n  \"name\": \"Memory TencentDB (Client)\",\n  \"version\": \"1.0.0-beta.1\",\n  \"description\": \"长期记忆插件（客户端接入版 /v3）— 通过远端 Memory Gateway 提供四层记忆能力\",\n  \"author\": \"TDAI Team\",\n  \"activation\": {\n    \"onStartup\": true\n  },\n  \"contracts\": {\n    \"tools\": [\n      \"tdai_memory_search\",\n      \"tdai_conversation_search\",\n      \"tdai_read_file\"\n    ]\n  },\n  \"configSchema\": {\n    \"type\": \"object\",\n    \"properties\": {\n      \"server\": {\n        \"type\": \"object\",\n        \"description\": \"远端 memory server 连接与 v3 isolation 配置\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\",\n            \"default\": \"http://127.0.0.1:8420\",\n            \"description\": \"Memory server URL\"\n          },\n          \"apiKey\": {\n            \"type\": \"string\",\n            \"default\": \"local\",\n            \"description\": \"API Key（Bearer）；local 模式可用 local\"\n          },\n          \"instanceId\": {\n            \"type\": \"string\",\n            \"default\": \"default\",\n            \"description\": \"Memory instance id（HTTP header x-tdai-service-id）\"\n          },\n          \"teamId\": {\n            \"type\": \"string\",\n            \"default\": \"default\",\n            \"description\": \"v3 isolation team_id（local 默认与 DEFAULT_ISOLATION_ID 一致）\"\n          },\n          \"agentId\": {\n            \"type\": \"string\",\n            \"default\": \"default\",\n            \"description\": \"v3 isolation agent_id\"\n          },\n          \"userId\": {\n            \"type\": \"string\",\n            \"default\": \"default\",\n            \"description\": \"v3 isolation user_id\"\n          },\n          \"rejectUnauthorized\": {\n            \"type\": \"boolean\",\n            \"default\": true,\n            \"description\": \"是否校验 HTTPS 证书。默认 true；仅自签证书测试环境需要显式设为 false\"\n          }\n        }\n      },\n      \"recall\": {\n        \"type\": \"object\",\n        \"description\": \"记忆召回设置\",\n        \"properties\": {\n          \"maxResults\": {\n            \"type\": \"number\",\n            \"default\": 5,\n            \"description\": \"每轮最多注入多少条 L1 记忆\"\n          },\n          \"includePersona\": {\n            \"type\": \"boolean\",\n            \"default\": true,\n            \"description\": \"是否注入 L3 画像\"\n          },\n          \"includeSceneNav\": {\n            \"type\": \"boolean\",\n            \"default\": true,\n            \"description\": \"是否注入 L2 场景导航索引\"\n          }\n        }\n      },\n      \"capture\": {\n        \"type\": \"object\",\n        \"description\": \"对话捕获设置\",\n        \"properties\": {\n          \"enabled\": {\n            \"type\": \"boolean\",\n            \"default\": true,\n            \"description\": \"是否启用自动对话捕获 (L0)\"\n          }\n        }\n      }\n    }\n  }\n}\n","MemoryCore/SKILL.md":"---\nname: openclaw-memory-tencentdb-setup\ndescription: 用于在 OpenClaw 环境中安装、配置并验证 @tencentdb-agent-memory/memory-tencentdb 插件。当用户提到\"安装记忆插件\"\"配置 memory-tencentdb\"\"开启长期记忆/召回\"或出现相关报错时应触发。\nversion: 1.0.0\n---\n\n## 目的\n\n在不依赖外部托管记忆服务的前提下，为 OpenClaw 提供可持续的本地长期记忆能力（L0→L1→L2→L3），并完成从安装、配置到验收的一次性闭环。\n\n## 适用场景\n\n- 用户要求在 OpenClaw 中安装或启用 `memory-tencentdb`\n- 用户需要配置召回、提取、画像、清理等参数\n- 用户反馈\"插件已装但无记忆 / 无召回 / 无向量检索\"\n\n## 不适用场景\n\n- 用户只需要解释 memory 理念，不要求实际落地\n- 用户要接入非 OpenClaw 宿主（先确认目标框架）\n\n## 标准工作流\n\n### 1) 环境预检\n\n先确认基础版本满足要求：\n\n- OpenClaw: `>= 2026.3.13`\n- Node.js: `>= 22.16.0`\n\n执行：\n\n```bash\nopenclaw --version\nnode -v\n```\n\n若版本不满足，先升级再继续。\n\n### 2) 安装插件\n\n执行安装命令：\n\n```bash\nopenclaw plugins install @tencentdb-agent-memory/memory-tencentdb\n```\n\n如已安装则执行更新：\n\n```bash\nopenclaw plugins update memory-tencentdb\n```\n\n### 3) 写入最小配置\n\n编辑 `~/.openclaw/openclaw.json`，确保存在：\n\n```json\n{\n  \"memory-tencentdb\": {\n    \"enabled\": true\n  }\n}\n```\n\n说明：该插件支持零配置启动；不补充其它字段也能运行基础能力。\n\n### 4) 按需追加推荐配置（生产常用）\n\n根据用户需求补充如下分组：\n\n- `capture`: 对话捕获与保留策略\n- `extraction`: L1 提取与去重\n- `pipeline`: L1→L2→L3 调度\n- `recall`: 召回数量、阈值、策略\n- `persona`: 场景与画像触发参数\n- `embedding`: 向量检索配置（远端 OpenAI 兼容）\n\n推荐模板：\n\n```json\n{\n  \"memory-tencentdb\": {\n    \"capture\": {\n      \"enabled\": true,\n      \"excludeAgents\": [],\n      \"l0l1RetentionDays\": 90,\n      \"cleanTime\": \"03:00\"\n    },\n    \"extraction\": {\n      \"enabled\": true,\n      \"enableDedup\": true,\n      \"maxMemoriesPerSession\": 10,\n      \"model\": \"provider/model\"\n    },\n    \"pipeline\": {\n      \"everyNConversations\": 5,\n      \"enableWarmup\": true,\n      \"l1IdleTimeoutSeconds\": 600,\n      \"l2DelayAfterL1Seconds\": 10,\n      \"l2MinIntervalSeconds\": 900,\n      \"l2MaxIntervalSeconds\": 3600,\n      \"sessionActiveWindowHours\": 24\n    },\n    \"recall\": {\n      \"enabled\": true,\n      \"maxResults\": 5,\n      \"scoreThreshold\": 0.3,\n      \"strategy\": \"hybrid\"\n    },\n    \"persona\": {\n      \"triggerEveryN\": 50,\n      \"maxScenes\": 15,\n      \"backupCount\": 3,\n      \"sceneBackupCount\": 10,\n      \"model\": \"provider/model\"\n    },\n    \"embedding\": {\n      \"enabled\": true,\n      \"provider\": \"openai\",\n      \"baseUrl\": \"https://api.openai.com/v1\",\n      \"apiKey\": \"${EMBEDDING_API_KEY}\",\n      \"model\": \"text-embedding-3-small\",\n      \"dimensions\": 1536,\n      \"conflictRecallTopK\": 5\n    }\n  }\n}\n```\n\n### 5) 关键配置规则（避免隐性失败）\n\n- `embedding.provider = \"none\"` 时，向量能力会禁用，仅保留关键词路径。\n- 若配置远端 `provider`（如 `openai` / `deepseek`），必须同时提供：\n  - `apiKey`\n  - `baseUrl`\n  - `model`\n  - `dimensions`\n- 上述任一缺失时，插件会继续运行，但自动降级为非向量模式。\n- `l0l1RetentionDays`：\n  - `0` 表示不清理\n  - 非 `0` 时建议 `>=3`\n  - 若设为 `1~2`，需显式开启 `allowAggressiveCleanup`\n\n### 6) 重启并验证生效\n\n执行：\n\n```bash\nopenclaw gateway restart\n```\n\n检查项：\n\n- Gateway 日志中出现 `[memory-tdai]` 前缀\n- 数据目录已创建：`~/.openclaw/state/memory-tdai/`\n- 至少包含：`conversations/`、`records/`、`scene_blocks/`、`vectors.db`\n\n### 7) 功能冒烟测试\n\n执行一次最小对话回路并验证：\n\n1. 连续对话 2~3 轮，提供可记忆信息（偏好、约束、背景）。\n2. 发起新一轮对话，观察是否出现召回上下文注入。\n3. 在 Agent 中调用：\n   - `tdai_memory_search`\n   - `tdai_conversation_search`\n4. 确认能检索到刚刚产生的内容。\n\n## 故障排查速查\n\n- 插件无日志：检查 `openclaw.json` 中 `memory-tencentdb.enabled` 是否为 `true`，并确认已重启 Gateway。\n- 有记录无召回：检查 `recall.enabled`、`scoreThreshold` 是否过高。\n- 无向量结果：检查 `embedding` 四元组（`apiKey/baseUrl/model/dimensions`）是否齐全。\n- 清理过猛导致历史过少：检查 `l0l1RetentionDays` 与 `allowAggressiveCleanup`。\n- 配置已改但行为不变：确认修改的是 `~/.openclaw/openclaw.json`，并再次重启 Gateway。\n\n## 安全与合规约束\n\n- 将 `apiKey` 视为敏感信息；不在聊天、日志、截图中明文扩散。\n- 优先使用环境变量注入密钥；配置示例中仅保留占位符。\n- 仅修改 `memory-tencentdb` 对应配置段，避免覆盖用户其它插件配置。\n\n## 完成定义（Definition of Done）\n\n在结束任务前，必须同时满足：\n\n- 插件安装/更新命令执行成功\n- `openclaw.json` 已存在有效 `memory-tencentdb` 配置\n- Gateway 已重启\n- `[memory-tdai]` 日志可见\n- 数据目录与关键文件已生成\n- 至少 1 次检索工具调用成功返回结果\n\n## 交付话术模板\n\n可在完成后向用户输出：\n\n- 已完成 `memory-tencentdb` 安装与配置，并重启 Gateway。\n- 已验证日志与数据目录生效，记忆链路可用。\n- 如需下一步优化，可继续调优 `recall.scoreThreshold`、`pipeline.everyNConversations`、`persona.triggerEveryN` 与 `embedding` 模型参数。","MemoryCore/openclaw.plugin.json":"{\n  \"id\": \"memory-tencentdb\",\n  \"name\": \"Memory (TencentDB)\",\n  \"description\": \"Four-layer memory system — auto-captures, structures, and profiles conversational knowledge\",\n  \"commandAliases\": [\"memory-tdai\"],\n  \"activation\": {\n    \"onStartup\": true\n  },\n  \"contracts\": {\n    \"tools\": [\"tdai_memory_search\", \"tdai_conversation_search\", \"tdai_read_file\"]\n  },\n  \"configSchema\": {\n    \"type\": \"object\",\n    \"additionalProperties\": true,\n    \"properties\": {\n      \"mode\": {\n        \"type\": \"string\",\n        \"enum\": [\"local\", \"function\", \"client\", \"gateway\", \"remote\"],\n        \"default\": \"local\",\n        \"description\": \"OpenClaw 接入模式：local/function（默认，本地进程内运行，使用 OpenClaw function/host LLM runner）或 client/gateway/remote（轻量客户端模式，连接外部 Memory Gateway）\"\n      },\n      \"storeBackend\": {\n        \"type\": \"string\",\n        \"enum\": [\"sqlite\", \"tcvdb\"],\n        \"default\": \"sqlite\",\n        \"description\": \"存储后端：sqlite（本地 SQLite + sqlite-vec）或 tcvdb（腾讯云向量数据库）。仅 local/function 模式生效\"\n      },\n      \"server\": {\n        \"type\": \"object\",\n        \"description\": \"client/gateway/remote 模式下的外部 Memory Gateway 连接配置\",\n        \"properties\": {\n          \"url\": { \"type\": \"string\", \"default\": \"http://127.0.0.1:8420\", \"description\": \"Memory Gateway URL\" },\n          \"apiKey\": { \"type\": \"string\", \"default\": \"local\", \"description\": \"API Key for Gateway authentication\" },\n          \"instanceId\": { \"type\": \"string\", \"default\": \"default\", \"description\": \"Memory instance id（HTTP header x-tdai-service-id）\" }\n        }\n      },\n      \"capture\": {\n        \"type\": \"object\",\n        \"description\": \"对话自动捕获设置 (L0)\",\n        \"properties\": {\n          \"enabled\": { \"type\": \"boolean\", \"default\": true, \"description\": \"是否启用自动对话捕获\" },\n          \"excludeAgents\": { \"type\": \"array\", \"items\": { \"type\": \"string\" }, \"default\": [], \"description\": \"排除的 Agent glob 模式列表（如 bench-judge-*），匹配的 agent 不会被捕获、召回或参与 pipeline 调度\" },\n          \"l0l1RetentionDays\": { \"type\": \"number\", \"default\": 0, \"description\": \"L0/L1 本地文件保留天数（单位天）。0=不清理；非0时默认必须>=3。若为1或2，需显式开启 allowAggressiveCleanup\" },\n          \"allowAggressiveCleanup\": { \"type\": \"boolean\", \"default\": false, \"description\": \"是否允许高风险清理配置（l0l1RetentionDays=1或2）\" },\n          \"cleanTime\": { \"type\": \"string\", \"default\": \"03:00\", \"description\": \"每日清理执行时间（HH:mm）\" }\n        }\n      },\n      \"extraction\": {\n        \"type\": \"object\",\n        \"description\": \"记忆提取设置 (L1)\",\n        \"properties\": {\n          \"enabled\": { \"type\": \"boolean\", \"default\": true, \"description\": \"是否启用后台提取\" },\n          \"enableDedup\": { \"type\": \"boolean\", \"default\": true, \"description\": \"L1 智能去重（基于向量相似度或关键词进行冲突检测）\" },\n          \"maxMemoriesPerSession\": { \"type\": \"number\", \"default\": 20, \"description\": \"单次 L1 提取每 session 最大记忆条数\" },\n          \"model\": { \"type\": \"string\", \"description\": \"提取使用模型 (格式: provider/model)，未填写时使用openclaw默认模型\" }\n        }\n      },\n      \"persona\": {\n        \"type\": \"object\",\n        \"description\": \"场景归纳与用户画像设置 (L2/L3)\",\n        \"properties\": {\n          \"triggerEveryN\": { \"type\": \"number\", \"default\": 50, \"description\": \"每 N 条新记忆触发画像生成\" },\n          \"maxScenes\": { \"type\": \"number\", \"default\": 15, \"description\": \"最大场景数\" },\n          \"backupCount\": { \"type\": \"number\", \"default\": 3, \"description\": \"画像备份保留数量\" },\n          \"sceneBackupCount\": { \"type\": \"number\", \"default\": 10, \"description\": \"场景块备份保留数量\" },\n          \"model\": { \"type\": \"string\", \"description\": \"画像生成模型 (格式: provider/model)，未填写时使用openclaw默认模型\" },\n          \"triggerMode\": { \"type\": \"string\", \"enum\": [\"current\", \"jev\"], \"default\": \"current\", \"description\": \"L3触发策略；jev在现有触发器未命中时判断是否立即同步\" },\n          \"jev\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"endpoint\": { \"type\": \"string\", \"description\": \"System One HTTPS endpoint\" },\n              \"apiKey\": { \"type\": \"string\", \"description\": \"JEV密钥；优先使用TYPESAFE_API_KEY环境变量\" },\n              \"model\": { \"type\": \"string\", \"description\": \"JEV模型或TokenHub服务ID\" },\n              \"timeoutMs\": { \"type\": \"number\", \"minimum\": 100, \"maximum\": 3000, \"default\": 3000 },\n              \"diagnostics\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"mode\": { \"type\": \"string\", \"enum\": [\"off\", \"metadata\", \"full\"], \"default\": \"off\" }\n                }\n              }\n            }\n          }\n        }\n      },\n      \"pipeline\": {\n        \"type\": \"object\",\n        \"description\": \"L1→L2→L3 管线调度设置\",\n        \"properties\": {\n          \"everyNConversations\": { \"type\": \"number\", \"default\": 5, \"description\": \"每 N 轮对话触发 L1 批处理\" },\n          \"enableWarmup\": { \"type\": \"boolean\", \"default\": true, \"description\": \"Warm-up 模式：新 session 从 1 轮触发开始，每次 L1 后翻倍（1→2→4→...→everyN），加速早期记忆提取\" },\n          \"l1IdleTimeoutSeconds\": { \"type\": \"number\", \"default\": 600, \"description\": \"L1 空闲超时（秒）：用户停止对话后多久触发 L1 批处理\" },\n          \"l2DelayAfterL1Seconds\": { \"type\": \"number\", \"default\": 10, \"description\": \"L1 完成后延迟多久触发 L2（秒）\" },\n          \"l2MinIntervalSeconds\": { \"type\": \"number\", \"default\": 900, \"description\": \"同一 session 两次 L2 抽取的最小间隔（秒）\" },\n          \"l2MaxIntervalSeconds\": { \"type\": \"number\", \"default\": 3600, \"description\": \"同一活跃 session 的 L2 最大轮询间隔（秒）\" },\n          \"sessionActiveWindowHours\": { \"type\": \"number\", \"default\": 24, \"description\": \"session 活跃窗口（小时），超过此时间不活跃的 session 停止 L2 轮询\" }\n        }\n      },\n      \"recall\": {\n        \"type\": \"object\",\n        \"description\": \"记忆召回设置\",\n        \"properties\": {\n          \"enabled\": { \"type\": \"boolean\", \"default\": true, \"description\": \"是否启用自动召回\" },\n          \"maxResults\": { \"type\": \"number\", \"default\": 5, \"description\": \"召回最大结果数\" },\n          \"maxCharsPerMemory\": { \"type\": \"number\", \"default\": 0, \"description\": \"单条 L1 记忆注入的最大字符数；填 0 表示不限制\" },\n          \"maxTotalRecallChars\": { \"type\": \"number\", \"default\": 0, \"description\": \"本轮 auto-recall 注入的 L1 记忆总字符预算；填 0 表示不限制\" },\n          \"scoreThreshold\": { \"type\": \"number\", \"default\": 0.3, \"description\": \"最低分数阈值\" },\n          \"strategy\": { \"type\": \"string\", \"enum\": [\"embedding\", \"keyword\", \"hybrid\"], \"default\": \"hybrid\", \"description\": \"搜索策略：keyword(关键词)、embedding(向量)、hybrid(混合RRF融合，推荐)\" },\n          \"timeoutMs\": { \"type\": \"number\", \"default\": 5000, \"description\": \"召回整体超时（毫秒），超时后跳过记忆注入并打印警告日志\" }\n        }\n      },\n      \"embedding\": {\n        \"type\": \"object\",\n        \"description\": \"向量搜索 (Embedding) 配置\",\n        \"properties\": {\n          \"enabled\": { \"type\": \"boolean\", \"default\": true, \"description\": \"是否启用向量搜索（若 provider=none，则实际会被禁用）\" },\n          \"provider\": { \"type\": \"string\", \"default\": \"none\", \"description\": \"Embedding 服务提供者：填写兼容 OpenAI API 的远端服务名称（如 openai、deepseek 等）；不填或填 none 则禁用向量搜索\" },\n          \"proxyUrl\": { \"type\": \"string\", \"description\": \"本地代理地址（仅 provider=qclaw 时必填）。配置后 embedding 请求将通过该代理转发，原始 baseUrl 作为 Remote-URL 头传递\" },\n          \"baseUrl\": { \"type\": \"string\", \"description\": \"API Base URL（必填）：填写对应 provider 的 API 地址\" },\n          \"apiKey\": { \"type\": \"string\", \"description\": \"API Key（必填）\" },\n          \"model\": { \"type\": \"string\", \"description\": \"模型名称（必填）\" },\n          \"dimensions\": { \"type\": \"number\", \"description\": \"向量维度（必填，需与所选模型匹配）\" },\n          \"sendDimensions\": { \"type\": \"boolean\", \"default\": true, \"description\": \"是否在请求体中携带 dimensions 字段。默认 true（兼容 OpenAI text-embedding-3-* 的 Matryoshka 截断）。当目标服务为 BGE-M3 等不支持自定义维度的固定维度模型时，请设为 false，否则会被服务端以 HTTP 400 拒绝（'does not support matryoshka representation'）。\" },\n          \"conflictRecallTopK\": { \"type\": \"number\", \"default\": 5, \"description\": \"冲突检测时召回 Top-K 数\" },\n          \"maxInputChars\": { \"type\": \"number\", \"default\": 5000, \"description\": \"Embedding 输入文本最大字符数，超出时截断并打印警告日志（默认 5000，适合大多数模型的 token 上限）\" },\n          \"timeoutMs\": { \"type\": \"number\", \"default\": 10000, \"description\": \"单次 embedding API 调用超时（毫秒），超时后该次请求中止且不重试\" },\n          \"recallTimeoutMs\": { \"type\": \"number\", \"description\": \"recall 路径 embedding 超时（毫秒），覆盖 timeoutMs。用户等待中，建议设短一些（如 3000）\" },\n          \"captureTimeoutMs\": { \"type\": \"number\", \"description\": \"capture 路径 embedding 超时（毫秒），覆盖 timeoutMs。后台运行，可设长一些（如 15000）\" }\n        }\n      },\n      \"tcvdb\": {\n        \"type\": \"object\",\n        \"description\": \"腾讯云向量数据库配置（仅 storeBackend=tcvdb 时生效）\",\n        \"properties\": {\n          \"url\": { \"type\": \"string\", \"description\": \"实例 URL（必填，如 http://10.0.1.1:8100）\" },\n          \"username\": { \"type\": \"string\", \"default\": \"root\", \"description\": \"账户名\" },\n          \"apiKey\": { \"type\": \"string\", \"description\": \"API Key（必填）\" },\n          \"database\": { \"type\": \"string\", \"description\": \"数据库名（未填写时默认根据实例 ID 自动生成）\" },\n          \"alias\": { \"type\": \"string\", \"description\": \"用户友好别名（可选，用于 database.json 中识别）\" },\n          \"embeddingModel\": { \"type\": \"string\", \"default\": \"bge-large-zh\", \"description\": \"服务端 embedding 模型\" },\n          \"timeout\": { \"type\": \"number\", \"default\": 10000, \"description\": \"请求超时（毫秒）\" },\n          \"caPemPath\": { \"type\": \"string\", \"description\": \"CA 证书 PEM 文件路径（HTTPS 连接时使用）\" }\n        }\n      },\n      \"bm25\": {\n        \"type\": \"object\",\n        \"description\": \"BM25 稀疏向量编码设置（主要用于 tcvdb 后端）\",\n        \"properties\": {\n          \"enabled\": { \"type\": \"boolean\", \"default\": true, \"description\": \"是否启用 BM25 稀疏向量编码\" },\n          \"language\": { \"type\": \"string\", \"enum\": [\"zh\", \"en\"], \"default\": \"zh\", \"description\": \"分词语言：zh（中文）或 en（英文）\" }\n        }\n      },\n      \"report\": {\n        \"type\": \"object\",\n        \"description\": \"指标上报设置\",\n        \"properties\": {\n          \"enabled\": { \"type\": \"boolean\", \"default\": false, \"description\": \"是否启用指标上报（通过 Gateway 日志输出结构化 METRIC JSON）\" },\n          \"type\": { \"type\": \"string\", \"default\": \"local\", \"description\": \"上报方式：local 表示通过 logger 输出结构化 JSON 日志\" }\n        }\n      },\n      \"llm\": {\n        \"type\": \"object\",\n        \"description\": \"独立 LLM 配置 — 开启后 L1/L2/L3 提取绕过 OpenClaw 的内置模型，改用指定的 OpenAI-compatible API 直接调用。默认关闭（使用 OpenClaw 宿主模型）。\",\n        \"properties\": {\n          \"enabled\": { \"type\": \"boolean\", \"default\": false, \"description\": \"是否启用独立 LLM 模式。关闭时使用 OpenClaw 宿主模型。\" },\n          \"baseUrl\": { \"type\": \"string\", \"default\": \"https://api.openai.com/v1\", \"description\": \"OpenAI-compatible API 地址\" },\n          \"apiKey\": { \"type\": \"string\", \"description\": \"API Key\" },\n          \"model\": { \"type\": \"string\", \"default\": \"gpt-4o\", \"description\": \"模型名称（如 gpt-4o, deepseek-v3, claude-sonnet-4-6）\" },\n          \"maxTokens\": { \"type\": \"number\", \"default\": 4096, \"description\": \"最大输出 token 数\" },\n          \"timeoutMs\": { \"type\": \"number\", \"default\": 120000, \"description\": \"请求超时（毫秒）\" },\n          \"stream\": { \"type\": \"boolean\", \"default\": false, \"description\": \"是否用流式请求(streamText)调用上游。默认 false(非流式)。个别只接受流式请求的 OpenAI 兼容上游需置 true。⚠️ 仅在启用独立 LLM(llm.enabled=true)时生效；未启用时走 OpenClaw host runner，此开关被忽略。\" }\n        }\n      },\n      \"offload\": {\n        \"type\": \"object\",\n        \"description\": \"Context Offload 设置 — 多层上下文压缩系统（独立开关，默认关闭）。支持 local（本地 LLM 处理）和 client（复用 server.url 远端服务）两种模式\",\n        \"properties\": {\n          \"enabled\": { \"type\": \"boolean\", \"default\": false, \"description\": \"是否启用 Context Offload（默认关闭，不影响 Memory 功能）\" },\n          \"mode\": { \"type\": \"string\", \"enum\": [\"local\", \"backend\", \"client\", \"collect\"], \"description\": \"Offload 运行模式：local（本地 LLM 处理）、backend（走 backendUrl 远端 v1 服务）、client（复用 server.url 远端 offload v2 服务）、collect（仅数据采集，不压缩）。未设置时自动推导：有 backendUrl → backend，有 server.url → client，否则 → local\" },\n          \"model\": { \"type\": \"string\", \"description\": \"【local 模式】Offload 使用的 LLM 模型（格式: provider/model），未填写时使用 openclaw 默认模型\" },\n          \"temperature\": { \"type\": \"number\", \"default\": 0.2, \"description\": \"【local 模式】LLM 温度参数\" },\n          \"stream\": { \"type\": \"boolean\", \"default\": false, \"description\": \"【仅 mode=local 生效】是否用流式请求(streamText)调用上游。默认 false(非流式)。个别只接受流式请求的 OpenAI 兼容上游需置 true。backend/client/collect 模式由远端 offload server 主导调用，此开关被忽略。\" },\n          \"forceTriggerThreshold\": { \"type\": \"number\", \"default\": 4, \"description\": \"【local 模式】累积多少个 tool pair 后强制触发 L1\" },\n          \"dataDir\": { \"type\": \"string\", \"description\": \"【local 模式】自定义数据目录（绝对路径），默认 ~/.openclaw/context-offload\" },\n          \"defaultContextWindow\": { \"type\": \"number\", \"default\": 200000, \"description\": \"默认上下文窗口大小\" },\n          \"maxPairsPerBatch\": { \"type\": \"number\", \"default\": 20, \"description\": \"【local 模式】L1 每批最大 tool pair 数\" },\n          \"l2NullThreshold\": { \"type\": \"number\", \"default\": 4, \"description\": \"【local 模式】offload.jsonl 中 node_id=null 数量达到此阈值时触发 L2\" },\n          \"l2TimeoutSeconds\": { \"type\": \"number\", \"default\": 300, \"description\": \"【local 模式】距上次 L2 超过此秒数时触发 L2\" },\n          \"mildOffloadRatio\": { \"type\": \"number\", \"default\": 0.5, \"description\": \"温和压缩触发比例（占 context window）\" },\n          \"aggressiveCompressRatio\": { \"type\": \"number\", \"default\": 0.85, \"description\": \"激进压缩触发比例\" },\n          \"mmdMaxTokenRatio\": { \"type\": \"number\", \"default\": 0.2, \"description\": \"【local 模式】MMD 注入 token 预算比例\" },\n          \"compactionRatio\": { \"type\": \"number\", \"default\": 0.5, \"description\": \"【client 模式】上下文占比超过此阈值时触发压缩（0-1），复用 server.url 作为后端地址\" },\n          \"ingestTimeoutMs\": { \"type\": \"number\", \"default\": 5000, \"description\": \"【client 模式】Ingest 请求超时（毫秒）\" },\n          \"compactionTimeoutMs\": { \"type\": \"number\", \"default\": 30000, \"description\": \"【client 模式】Compaction 请求超时（毫秒）\" },\n          \"backendUrl\": { \"type\": \"string\", \"description\": \"【已废弃，请使用 mode=client】后端服务 URL，配置后 L1/L1.5/L2/L4 走后端\" },\n          \"backendApiKey\": { \"type\": \"string\", \"description\": \"【已废弃，请使用 mode=client】后端 API 认证 token\" },\n          \"backendTimeoutMs\": { \"type\": \"number\", \"default\": 10000, \"description\": \"【已废弃，请使用 mode=client】后端调用超时（毫秒）\" }\n        }\n      }\n    }\n  }\n}\n"},"files":{"MemoryCore/openclaw-plugin/openclaw.plugin.json":"{\n  \"id\": \"memory-tencentdb-client\",\n  \"name\": \"Memory TencentDB (Client)\",\n  \"version\": \"1.0.0-beta.1\",\n  \"description\": \"长期记忆插件（客户端接入版 /v3）— 通过远端 Memory Gateway 提供四层记忆能力\",\n  \"author\": \"TDAI Team\",\n  \"activation\": {\n    \"onStartup\": true\n  },\n  \"contracts\": {\n    \"tools\": [\n      \"tdai_memory_search\",\n      \"tdai_conversation_search\",\n      \"tdai_read_file\"\n    ]\n  },\n  \"configSchema\": {\n    \"type\": \"object\",\n    \"properties\": {\n      \"server\": {\n        \"type\": \"object\",\n        \"description\": \"远端 memory server 连接与 v3 isolation 配置\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\",\n            \"default\": \"http://127.0.0.1:8420\",\n            \"description\": \"Memory server URL\"\n          },\n          \"apiKey\": {\n            \"type\": \"string\",\n            \"default\": \"local\",\n            \"description\": \"API Key（Bearer）；local 模式可用 local\"\n          },\n          \"instanceId\": {\n            \"type\": \"string\",\n            \"default\": \"default\",\n            \"description\": \"Memory instance id（HTTP header x-tdai-service-id）\"\n          },\n          \"teamId\": {\n            \"type\": \"string\",\n            \"default\": \"default\",\n            \"description\": \"v3 isolation team_id（local 默认与 DEFAULT_ISOLATION_ID 一致）\"\n          },\n          \"agentId\": {\n            \"type\": \"string\",\n            \"default\": \"default\",\n            \"description\": \"v3 isolation agent_id\"\n          },\n          \"userId\": {\n            \"type\": \"string\",\n            \"default\": \"default\",\n            \"description\": \"v3 isolation user_id\"\n          },\n          \"rejectUnauthorized\": {\n            \"type\": \"boolean\",\n            \"default\": true,\n            \"description\": \"是否校验 HTTPS 证书。默认 true；仅自签证书测试环境需要显式设为 false\"\n          }\n        }\n      },\n      \"recall\": {\n        \"type\": \"object\",\n        \"description\": \"记忆召回设置\",\n        \"properties\": {\n          \"maxResults\": {\n            \"type\": \"number\",\n            \"default\": 5,\n            \"description\": \"每轮最多注入多少条 L1 记忆\"\n          },\n          \"includePersona\": {\n            \"type\": \"boolean\",\n            \"default\": true,\n            \"description\": \"是否注入 L3 画像\"\n          },\n          \"includeSceneNav\": {\n            \"type\": \"boolean\",\n            \"default\": true,\n            \"description\": \"是否注入 L2 场景导航索引\"\n          }\n        }\n      },\n      \"capture\": {\n        \"type\": \"object\",\n        \"description\": \"对话捕获设置\",\n        \"properties\": {\n          \"enabled\": {\n            \"type\": \"boolean\",\n            \"default\": true,\n            \"description\": \"是否启用自动对话捕获 (L0)\"\n          }\n        }\n      }\n    }\n  }\n}\n","MemoryCore/SKILL.md":"---\nname: openclaw-memory-tencentdb-setup\ndescription: 用于在 OpenClaw 环境中安装、配置并验证 @tencentdb-agent-memory/memory-tencentdb 插件。当用户提到\"安装记忆插件\"\"配置 memory-tencentdb\"\"开启长期记忆/召回\"或出现相关报错时应触发。\nversion: 1.0.0\n---\n\n## 目的\n\n在不依赖外部托管记忆服务的前提下，为 OpenClaw 提供可持续的本地长期记忆能力（L0→L1→L2→L3），并完成从安装、配置到验收的一次性闭环。\n\n## 适用场景\n\n- 用户要求在 OpenClaw 中安装或启用 `memory-tencentdb`\n- 用户需要配置召回、提取、画像、清理等参数\n- 用户反馈\"插件已装但无记忆 / 无召回 / 无向量检索\"\n\n## 不适用场景\n\n- 用户只需要解释 memory 理念，不要求实际落地\n- 用户要接入非 OpenClaw 宿主（先确认目标框架）\n\n## 标准工作流\n\n### 1) 环境预检\n\n先确认基础版本满足要求：\n\n- OpenClaw: `>= 2026.3.13`\n- Node.js: `>= 22.16.0`\n\n执行：\n\n```bash\nopenclaw --version\nnode -v\n```\n\n若版本不满足，先升级再继续。\n\n### 2) 安装插件\n\n执行安装命令：\n\n```bash\nopenclaw plugins install @tencentdb-agent-memory/memory-tencentdb\n```\n\n如已安装则执行更新：\n\n```bash\nopenclaw plugins update memory-tencentdb\n```\n\n### 3) 写入最小配置\n\n编辑 `~/.openclaw/openclaw.json`，确保存在：\n\n```json\n{\n  \"memory-tencentdb\": {\n    \"enabled\": true\n  }\n}\n```\n\n说明：该插件支持零配置启动；不补充其它字段也能运行基础能力。\n\n### 4) 按需追加推荐配置（生产常用）\n\n根据用户需求补充如下分组：\n\n- `capture`: 对话捕获与保留策略\n- `extraction`: L1 提取与去重\n- `pipeline`: L1→L2→L3 调度\n- `recall`: 召回数量、阈值、策略\n- `persona`: 场景与画像触发参数\n- `embedding`: 向量检索配置（远端 OpenAI 兼容）\n\n推荐模板：\n\n```json\n{\n  \"memory-tencentdb\": {\n    \"capture\": {\n      \"enabled\": true,\n      \"excludeAgents\": [],\n      \"l0l1RetentionDays\": 90,\n      \"cleanTime\": \"03:00\"\n    },\n    \"extraction\": {\n      \"enabled\": true,\n      \"enableDedup\": true,\n      \"maxMemoriesPerSession\": 10,\n      \"model\": \"provider/model\"\n    },\n    \"pipeline\": {\n      \"everyNConversations\": 5,\n      \"enableWarmup\": true,\n      \"l1IdleTimeoutSeconds\": 600,\n      \"l2DelayAfterL1Seconds\": 10,\n      \"l2MinIntervalSeconds\": 900,\n      \"l2MaxIntervalSeconds\": 3600,\n      \"sessionActiveWindowHours\": 24\n    },\n    \"recall\": {\n      \"enabled\": true,\n      \"maxResults\": 5,\n      \"scoreThreshold\": 0.3,\n      \"strategy\": \"hybrid\"\n    },\n    \"persona\": {\n      \"triggerEveryN\": 50,\n      \"maxScenes\": 15,\n      \"backupCount\": 3,\n      \"sceneBackupCount\": 10,\n      \"model\": \"provider/model\"\n    },\n    \"embedding\": {\n      \"enabled\": true,\n      \"provider\": \"openai\",\n      \"baseUrl\": \"https://api.openai.com/v1\",\n      \"apiKey\": \"${EMBEDDING_API_KEY}\",\n      \"model\": \"text-embedding-3-small\",\n      \"dimensions\": 1536,\n      \"conflictRecallTopK\": 5\n    }\n  }\n}\n```\n\n### 5) 关键配置规则（避免隐性失败）\n\n- `embedding.provider = \"none\"` 时，向量能力会禁用，仅保留关键词路径。\n- 若配置远端 `provider`（如 `openai` / `deepseek`），必须同时提供：\n  - `apiKey`\n  - `baseUrl`\n  - `model`\n  - `dimensions`\n- 上述任一缺失时，插件会继续运行，但自动降级为非向量模式。\n- `l0l1RetentionDays`：\n  - `0` 表示不清理\n  - 非 `0` 时建议 `>=3`\n  - 若设为 `1~2`，需显式开启 `allowAggressiveCleanup`\n\n### 6) 重启并验证生效\n\n执行：\n\n```bash\nopenclaw gateway restart\n```\n\n检查项：\n\n- Gateway 日志中出现 `[memory-tdai]` 前缀\n- 数据目录已创建：`~/.openclaw/state/memory-tdai/`\n- 至少包含：`conversations/`、`records/`、`scene_blocks/`、`vectors.db`\n\n### 7) 功能冒烟测试\n\n执行一次最小对话回路并验证：\n\n1. 连续对话 2~3 轮，提供可记忆信息（偏好、约束、背景）。\n2. 发起新一轮对话，观察是否出现召回上下文注入。\n3. 在 Agent 中调用：\n   - `tdai_memory_search`\n   - `tdai_conversation_search`\n4. 确认能检索到刚刚产生的内容。\n\n## 故障排查速查\n\n- 插件无日志：检查 `openclaw.json` 中 `memory-tencentdb.enabled` 是否为 `true`，并确认已重启 Gateway。\n- 有记录无召回：检查 `recall.enabled`、`scoreThreshold` 是否过高。\n- 无向量结果：检查 `embedding` 四元组（`apiKey/baseUrl/model/dimensions`）是否齐全。\n- 清理过猛导致历史过少：检查 `l0l1RetentionDays` 与 `allowAggressiveCleanup`。\n- 配置已改但行为不变：确认修改的是 `~/.openclaw/openclaw.json`，并再次重启 Gateway。\n\n## 安全与合规约束\n\n- 将 `apiKey` 视为敏感信息；不在聊天、日志、截图中明文扩散。\n- 优先使用环境变量注入密钥；配置示例中仅保留占位符。\n- 仅修改 `memory-tencentdb` 对应配置段，避免覆盖用户其它插件配置。\n\n## 完成定义（Definition of Done）\n\n在结束任务前，必须同时满足：\n\n- 插件安装/更新命令执行成功\n- `openclaw.json` 已存在有效 `memory-tencentdb` 配置\n- Gateway 已重启\n- `[memory-tdai]` 日志可见\n- 数据目录与关键文件已生成\n- 至少 1 次检索工具调用成功返回结果\n\n## 交付话术模板\n\n可在完成后向用户输出：\n\n- 已完成 `memory-tencentdb` 安装与配置，并重启 Gateway。\n- 已验证日志与数据目录生效，记忆链路可用。\n- 如需下一步优化，可继续调优 `recall.scoreThreshold`、`pipeline.everyNConversations`、`persona.triggerEveryN` 与 `embedding` 模型参数。","MemoryCore/openclaw.plugin.json":"{\n  \"id\": \"memory-tencentdb\",\n  \"name\": \"Memory (TencentDB)\",\n  \"description\": \"Four-layer memory system — auto-captures, structures, and profiles conversational knowledge\",\n  \"commandAliases\": [\"memory-tdai\"],\n  \"activation\": {\n    \"onStartup\": true\n  },\n  \"contracts\": {\n    \"tools\": [\"tdai_memory_search\", \"tdai_conversation_search\", \"tdai_read_file\"]\n  },\n  \"configSchema\": {\n    \"type\": \"object\",\n    \"additionalProperties\": true,\n    \"properties\": {\n      \"mode\": {\n        \"type\": \"string\",\n        \"enum\": [\"local\", \"function\", \"client\", \"gateway\", \"remote\"],\n        \"default\": \"local\",\n        \"description\": \"OpenClaw 接入模式：local/function（默认，本地进程内运行，使用 OpenClaw function/host LLM runner）或 client/gateway/remote（轻量客户端模式，连接外部 Memory Gateway）\"\n      },\n      \"storeBackend\": {\n        \"type\": \"string\",\n        \"enum\": [\"sqlite\", \"tcvdb\"],\n        \"default\": \"sqlite\",\n        \"description\": \"存储后端：sqlite（本地 SQLite + sqlite-vec）或 tcvdb（腾讯云向量数据库）。仅 local/function 模式生效\"\n      },\n      \"server\": {\n        \"type\": \"object\",\n        \"description\": \"client/gateway/remote 模式下的外部 Memory Gateway 连接配置\",\n        \"properties\": {\n          \"url\": { \"type\": \"string\", \"default\": \"http://127.0.0.1:8420\", \"description\": \"Memory Gateway URL\" },\n          \"apiKey\": { \"type\": \"string\", \"default\": \"local\", \"description\": \"API Key for Gateway authentication\" },\n          \"instanceId\": { \"type\": \"string\", \"default\": \"default\", \"description\": \"Memory instance id（HTTP header x-tdai-service-id）\" }\n        }\n      },\n      \"capture\": {\n        \"type\": \"object\",\n        \"description\": \"对话自动捕获设置 (L0)\",\n        \"properties\": {\n          \"enabled\": { \"type\": \"boolean\", \"default\": true, \"description\": \"是否启用自动对话捕获\" },\n          \"excludeAgents\": { \"type\": \"array\", \"items\": { \"type\": \"string\" }, \"default\": [], \"description\": \"排除的 Agent glob 模式列表（如 bench-judge-*），匹配的 agent 不会被捕获、召回或参与 pipeline 调度\" },\n          \"l0l1RetentionDays\": { \"type\": \"number\", \"default\": 0, \"description\": \"L0/L1 本地文件保留天数（单位天）。0=不清理；非0时默认必须>=3。若为1或2，需显式开启 allowAggressiveCleanup\" },\n          \"allowAggressiveCleanup\": { \"type\": \"boolean\", \"default\": false, \"description\": \"是否允许高风险清理配置（l0l1RetentionDays=1或2）\" },\n          \"cleanTime\": { \"type\": \"string\", \"default\": \"03:00\", \"description\": \"每日清理执行时间（HH:mm）\" }\n        }\n      },\n      \"extraction\": {\n        \"type\": \"object\",\n        \"description\": \"记忆提取设置 (L1)\",\n        \"properties\": {\n          \"enabled\": { \"type\": \"boolean\", \"default\": true, \"description\": \"是否启用后台提取\" },\n          \"enableDedup\": { \"type\": \"boolean\", \"default\": true, \"description\": \"L1 智能去重（基于向量相似度或关键词进行冲突检测）\" },\n          \"maxMemoriesPerSession\": { \"type\": \"number\", \"default\": 20, \"description\": \"单次 L1 提取每 session 最大记忆条数\" },\n          \"model\": { \"type\": \"string\", \"description\": \"提取使用模型 (格式: provider/model)，未填写时使用openclaw默认模型\" }\n        }\n      },\n      \"persona\": {\n        \"type\": \"object\",\n        \"description\": \"场景归纳与用户画像设置 (L2/L3)\",\n        \"properties\": {\n          \"triggerEveryN\": { \"type\": \"number\", \"default\": 50, \"description\": \"每 N 条新记忆触发画像生成\" },\n          \"maxScenes\": { \"type\": \"number\", \"default\": 15, \"description\": \"最大场景数\" },\n          \"backupCount\": { \"type\": \"number\", \"default\": 3, \"description\": \"画像备份保留数量\" },\n          \"sceneBackupCount\": { \"type\": \"number\", \"default\": 10, \"description\": \"场景块备份保留数量\" },\n          \"model\": { \"type\": \"string\", \"description\": \"画像生成模型 (格式: provider/model)，未填写时使用openclaw默认模型\" },\n          \"triggerMode\": { \"type\": \"string\", \"enum\": [\"current\", \"jev\"], \"default\": \"current\", \"description\": \"L3触发策略；jev在现有触发器未命中时判断是否立即同步\" },\n          \"jev\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"endpoint\": { \"type\": \"string\", \"description\": \"System One HTTPS endpoint\" },\n              \"apiKey\": { \"type\": \"string\", \"description\": \"JEV密钥；优先使用TYPESAFE_API_KEY环境变量\" },\n              \"model\": { \"type\": \"string\", \"description\": \"JEV模型或TokenHub服务ID\" },\n              \"timeoutMs\": { \"type\": \"number\", \"minimum\": 100, \"maximum\": 3000, \"default\": 3000 },\n              \"diagnostics\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"mode\": { \"type\": \"string\", \"enum\": [\"off\", \"metadata\", \"full\"], \"default\": \"off\" }\n                }\n              }\n            }\n          }\n        }\n      },\n      \"pipeline\": {\n        \"type\": \"object\",\n        \"description\": \"L1→L2→L3 管线调度设置\",\n        \"properties\": {\n          \"everyNConversations\": { \"type\": \"number\", \"default\": 5, \"description\": \"每 N 轮对话触发 L1 批处理\" },\n          \"enableWarmup\": { \"type\": \"boolean\", \"default\": true, \"description\": \"Warm-up 模式：新 session 从 1 轮触发开始，每次 L1 后翻倍（1→2→4→...→everyN），加速早期记忆提取\" },\n          \"l1IdleTimeoutSeconds\": { \"type\": \"number\", \"default\": 600, \"description\": \"L1 空闲超时（秒）：用户停止对话后多久触发 L1 批处理\" },\n          \"l2DelayAfterL1Seconds\": { \"type\": \"number\", \"default\": 10, \"description\": \"L1 完成后延迟多久触发 L2（秒）\" },\n          \"l2MinIntervalSeconds\": { \"type\": \"number\", \"default\": 900, \"description\": \"同一 session 两次 L2 抽取的最小间隔（秒）\" },\n          \"l2MaxIntervalSeconds\": { \"type\": \"number\", \"default\": 3600, \"description\": \"同一活跃 session 的 L2 最大轮询间隔（秒）\" },\n          \"sessionActiveWindowHours\": { \"type\": \"number\", \"default\": 24, \"description\": \"session 活跃窗口（小时），超过此时间不活跃的 session 停止 L2 轮询\" }\n        }\n      },\n      \"recall\": {\n        \"type\": \"object\",\n        \"description\": \"记忆召回设置\",\n        \"properties\": {\n          \"enabled\": { \"type\": \"boolean\", \"default\": true, \"description\": \"是否启用自动召回\" },\n          \"maxResults\": { \"type\": \"number\", \"default\": 5, \"description\": \"召回最大结果数\" },\n          \"maxCharsPerMemory\": { \"type\": \"number\", \"default\": 0, \"description\": \"单条 L1 记忆注入的最大字符数；填 0 表示不限制\" },\n          \"maxTotalRecallChars\": { \"type\": \"number\", \"default\": 0, \"description\": \"本轮 auto-recall 注入的 L1 记忆总字符预算；填 0 表示不限制\" },\n          \"scoreThreshold\": { \"type\": \"number\", \"default\": 0.3, \"description\": \"最低分数阈值\" },\n          \"strategy\": { \"type\": \"string\", \"enum\": [\"embedding\", \"keyword\", \"hybrid\"], \"default\": \"hybrid\", \"description\": \"搜索策略：keyword(关键词)、embedding(向量)、hybrid(混合RRF融合，推荐)\" },\n          \"timeoutMs\": { \"type\": \"number\", \"default\": 5000, \"description\": \"召回整体超时（毫秒），超时后跳过记忆注入并打印警告日志\" }\n        }\n      },\n      \"embedding\": {\n        \"type\": \"object\",\n        \"description\": \"向量搜索 (Embedding) 配置\",\n        \"properties\": {\n          \"enabled\": { \"type\": \"boolean\", \"default\": true, \"description\": \"是否启用向量搜索（若 provider=none，则实际会被禁用）\" },\n          \"provider\": { \"type\": \"string\", \"default\": \"none\", \"description\": \"Embedding 服务提供者：填写兼容 OpenAI API 的远端服务名称（如 openai、deepseek 等）；不填或填 none 则禁用向量搜索\" },\n          \"proxyUrl\": { \"type\": \"string\", \"description\": \"本地代理地址（仅 provider=qclaw 时必填）。配置后 embedding 请求将通过该代理转发，原始 baseUrl 作为 Remote-URL 头传递\" },\n          \"baseUrl\": { \"type\": \"string\", \"description\": \"API Base URL（必填）：填写对应 provider 的 API 地址\" },\n          \"apiKey\": { \"type\": \"string\", \"description\": \"API Key（必填）\" },\n          \"model\": { \"type\": \"string\", \"description\": \"模型名称（必填）\" },\n          \"dimensions\": { \"type\": \"number\", \"description\": \"向量维度（必填，需与所选模型匹配）\" },\n          \"sendDimensions\": { \"type\": \"boolean\", \"default\": true, \"description\": \"是否在请求体中携带 dimensions 字段。默认 true（兼容 OpenAI text-embedding-3-* 的 Matryoshka 截断）。当目标服务为 BGE-M3 等不支持自定义维度的固定维度模型时，请设为 false，否则会被服务端以 HTTP 400 拒绝（'does not support matryoshka representation'）。\" },\n          \"conflictRecallTopK\": { \"type\": \"number\", \"default\": 5, \"description\": \"冲突检测时召回 Top-K 数\" },\n          \"maxInputChars\": { \"type\": \"number\", \"default\": 5000, \"description\": \"Embedding 输入文本最大字符数，超出时截断并打印警告日志（默认 5000，适合大多数模型的 token 上限）\" },\n          \"timeoutMs\": { \"type\": \"number\", \"default\": 10000, \"description\": \"单次 embedding API 调用超时（毫秒），超时后该次请求中止且不重试\" },\n          \"recallTimeoutMs\": { \"type\": \"number\", \"description\": \"recall 路径 embedding 超时（毫秒），覆盖 timeoutMs。用户等待中，建议设短一些（如 3000）\" },\n          \"captureTimeoutMs\": { \"type\": \"number\", \"description\": \"capture 路径 embedding 超时（毫秒），覆盖 timeoutMs。后台运行，可设长一些（如 15000）\" }\n        }\n      },\n      \"tcvdb\": {\n        \"type\": \"object\",\n        \"description\": \"腾讯云向量数据库配置（仅 storeBackend=tcvdb 时生效）\",\n        \"properties\": {\n          \"url\": { \"type\": \"string\", \"description\": \"实例 URL（必填，如 http://10.0.1.1:8100）\" },\n          \"username\": { \"type\": \"string\", \"default\": \"root\", \"description\": \"账户名\" },\n          \"apiKey\": { \"type\": \"string\", \"description\": \"API Key（必填）\" },\n          \"database\": { \"type\": \"string\", \"description\": \"数据库名（未填写时默认根据实例 ID 自动生成）\" },\n          \"alias\": { \"type\": \"string\", \"description\": \"用户友好别名（可选，用于 database.json 中识别）\" },\n          \"embeddingModel\": { \"type\": \"string\", \"default\": \"bge-large-zh\", \"description\": \"服务端 embedding 模型\" },\n          \"timeout\": { \"type\": \"number\", \"default\": 10000, \"description\": \"请求超时（毫秒）\" },\n          \"caPemPath\": { \"type\": \"string\", \"description\": \"CA 证书 PEM 文件路径（HTTPS 连接时使用）\" }\n        }\n      },\n      \"bm25\": {\n        \"type\": \"object\",\n        \"description\": \"BM25 稀疏向量编码设置（主要用于 tcvdb 后端）\",\n        \"properties\": {\n          \"enabled\": { \"type\": \"boolean\", \"default\": true, \"description\": \"是否启用 BM25 稀疏向量编码\" },\n          \"language\": { \"type\": \"string\", \"enum\": [\"zh\", \"en\"], \"default\": \"zh\", \"description\": \"分词语言：zh（中文）或 en（英文）\" }\n        }\n      },\n      \"report\": {\n        \"type\": \"object\",\n        \"description\": \"指标上报设置\",\n        \"properties\": {\n          \"enabled\": { \"type\": \"boolean\", \"default\": false, \"description\": \"是否启用指标上报（通过 Gateway 日志输出结构化 METRIC JSON）\" },\n          \"type\": { \"type\": \"string\", \"default\": \"local\", \"description\": \"上报方式：local 表示通过 logger 输出结构化 JSON 日志\" }\n        }\n      },\n      \"llm\": {\n        \"type\": \"object\",\n        \"description\": \"独立 LLM 配置 — 开启后 L1/L2/L3 提取绕过 OpenClaw 的内置模型，改用指定的 OpenAI-compatible API 直接调用。默认关闭（使用 OpenClaw 宿主模型）。\",\n        \"properties\": {\n          \"enabled\": { \"type\": \"boolean\", \"default\": false, \"description\": \"是否启用独立 LLM 模式。关闭时使用 OpenClaw 宿主模型。\" },\n          \"baseUrl\": { \"type\": \"string\", \"default\": \"https://api.openai.com/v1\", \"description\": \"OpenAI-compatible API 地址\" },\n          \"apiKey\": { \"type\": \"string\", \"description\": \"API Key\" },\n          \"model\": { \"type\": \"string\", \"default\": \"gpt-4o\", \"description\": \"模型名称（如 gpt-4o, deepseek-v3, claude-sonnet-4-6）\" },\n          \"maxTokens\": { \"type\": \"number\", \"default\": 4096, \"description\": \"最大输出 token 数\" },\n          \"timeoutMs\": { \"type\": \"number\", \"default\": 120000, \"description\": \"请求超时（毫秒）\" },\n          \"stream\": { \"type\": \"boolean\", \"default\": false, \"description\": \"是否用流式请求(streamText)调用上游。默认 false(非流式)。个别只接受流式请求的 OpenAI 兼容上游需置 true。⚠️ 仅在启用独立 LLM(llm.enabled=true)时生效；未启用时走 OpenClaw host runner，此开关被忽略。\" }\n        }\n      },\n      \"offload\": {\n        \"type\": \"object\",\n        \"description\": \"Context Offload 设置 — 多层上下文压缩系统（独立开关，默认关闭）。支持 local（本地 LLM 处理）和 client（复用 server.url 远端服务）两种模式\",\n        \"properties\": {\n          \"enabled\": { \"type\": \"boolean\", \"default\": false, \"description\": \"是否启用 Context Offload（默认关闭，不影响 Memory 功能）\" },\n          \"mode\": { \"type\": \"string\", \"enum\": [\"local\", \"backend\", \"client\", \"collect\"], \"description\": \"Offload 运行模式：local（本地 LLM 处理）、backend（走 backendUrl 远端 v1 服务）、client（复用 server.url 远端 offload v2 服务）、collect（仅数据采集，不压缩）。未设置时自动推导：有 backendUrl → backend，有 server.url → client，否则 → local\" },\n          \"model\": { \"type\": \"string\", \"description\": \"【local 模式】Offload 使用的 LLM 模型（格式: provider/model），未填写时使用 openclaw 默认模型\" },\n          \"temperature\": { \"type\": \"number\", \"default\": 0.2, \"description\": \"【local 模式】LLM 温度参数\" },\n          \"stream\": { \"type\": \"boolean\", \"default\": false, \"description\": \"【仅 mode=local 生效】是否用流式请求(streamText)调用上游。默认 false(非流式)。个别只接受流式请求的 OpenAI 兼容上游需置 true。backend/client/collect 模式由远端 offload server 主导调用，此开关被忽略。\" },\n          \"forceTriggerThreshold\": { \"type\": \"number\", \"default\": 4, \"description\": \"【local 模式】累积多少个 tool pair 后强制触发 L1\" },\n          \"dataDir\": { \"type\": \"string\", \"description\": \"【local 模式】自定义数据目录（绝对路径），默认 ~/.openclaw/context-offload\" },\n          \"defaultContextWindow\": { \"type\": \"number\", \"default\": 200000, \"description\": \"默认上下文窗口大小\" },\n          \"maxPairsPerBatch\": { \"type\": \"number\", \"default\": 20, \"description\": \"【local 模式】L1 每批最大 tool pair 数\" },\n          \"l2NullThreshold\": { \"type\": \"number\", \"default\": 4, \"description\": \"【local 模式】offload.jsonl 中 node_id=null 数量达到此阈值时触发 L2\" },\n          \"l2TimeoutSeconds\": { \"type\": \"number\", \"default\": 300, \"description\": \"【local 模式】距上次 L2 超过此秒数时触发 L2\" },\n          \"mildOffloadRatio\": { \"type\": \"number\", \"default\": 0.5, \"description\": \"温和压缩触发比例（占 context window）\" },\n          \"aggressiveCompressRatio\": { \"type\": \"number\", \"default\": 0.85, \"description\": \"激进压缩触发比例\" },\n          \"mmdMaxTokenRatio\": { \"type\": \"number\", \"default\": 0.2, \"description\": \"【local 模式】MMD 注入 token 预算比例\" },\n          \"compactionRatio\": { \"type\": \"number\", \"default\": 0.5, \"description\": \"【client 模式】上下文占比超过此阈值时触发压缩（0-1），复用 server.url 作为后端地址\" },\n          \"ingestTimeoutMs\": { \"type\": \"number\", \"default\": 5000, \"description\": \"【client 模式】Ingest 请求超时（毫秒）\" },\n          \"compactionTimeoutMs\": { \"type\": \"number\", \"default\": 30000, \"description\": \"【client 模式】Compaction 请求超时（毫秒）\" },\n          \"backendUrl\": { \"type\": \"string\", \"description\": \"【已废弃，请使用 mode=client】后端服务 URL，配置后 L1/L1.5/L2/L4 走后端\" },\n          \"backendApiKey\": { \"type\": \"string\", \"description\": \"【已废弃，请使用 mode=client】后端 API 认证 token\" },\n          \"backendTimeoutMs\": { \"type\": \"number\", \"default\": 10000, \"description\": \"【已废弃，请使用 mode=client】后端调用超时（毫秒）\" }\n        }\n      }\n    }\n  }\n}\n"},"items":[{"name":"SKILL.md","path":"MemoryCore/SKILL.md","rawUrl":"https://raw.githubusercontent.com/TencentCloud/TencentDB-Agent-Memory/HEAD/MemoryCore/SKILL.md","title":"openclaw-memory-tencentdb-setup","category":"anthropic-skill","format":"markdown","content":"---\nname: openclaw-memory-tencentdb-setup\ndescription: 用于在 OpenClaw 环境中安装、配置并验证 @tencentdb-agent-memory/memory-tencentdb 插件。当用户提到\"安装记忆插件\"\"配置 memory-tencentdb\"\"开启长期记忆/召回\"或出现相关报错时应触发。\nversion: 1.0.0\n---\n\n## 目的\n\n在不依赖外部托管记忆服务的前提下，为 OpenClaw 提供可持续的本地长期记忆能力（L0→L1→L2→L3），并完成从安装、配置到验收的一次性闭环。\n\n## 适用场景\n\n- 用户要求在 OpenClaw 中安装或启用 `memory-tencentdb`\n- 用户需要配置召回、提取、画像、清理等参数\n- 用户反馈\"插件已装但无记忆 / 无召回 / 无向量检索\"\n\n## 不适用场景\n\n- 用户只需要解释 memory 理念，不要求实际落地\n- 用户要接入非 OpenClaw 宿主（先确认目标框架）\n\n## 标准工作流\n\n### 1) 环境预检\n\n先确认基础版本满足要求：\n\n- OpenClaw: `>= 2026.3.13`\n- Node.js: `>= 22.16.0`\n\n执行：\n\n```bash\nopenclaw --version\nnode -v\n```\n\n若版本不满足，先升级再继续。\n\n### 2) 安装插件\n\n执行安装命令：\n\n```bash\nopenclaw plugins install @tencentdb-agent-memory/memory-tencentdb\n```\n\n如已安装则执行更新：\n\n```bash\nopenclaw plugins update memory-tencentdb\n```\n\n### 3) 写入最小配置\n\n编辑 `~/.openclaw/openclaw.json`，确保存在：\n\n```json\n{\n  \"memory-tencentdb\": {\n    \"enabled\": true\n  }\n}\n```\n\n说明：该插件支持零配置启动；不补充其它字段也能运行基础能力。\n\n### 4) 按需追加推荐配置（生产常用）\n\n根据用户需求补充如下分组：\n\n- `capture`: 对话捕获与保留策略\n- `extraction`: L1 提取与去重\n- `pipeline`: L1→L2→L3 调度\n- `recall`: 召回数量、阈值、策略\n- `persona`: 场景与画像触发参数\n- `embedding`: 向量检索配置（远端 OpenAI 兼容）\n\n推荐模板：\n\n```json\n{\n  \"memory-tencentdb\": {\n    \"capture\": {\n      \"enabled\": true,\n      \"excludeAgents\": [],\n      \"l0l1RetentionDays\": 90,\n      \"cleanTime\": \"03:00\"\n    },\n    \"extraction\": {\n      \"enabled\": true,\n      \"enableDedup\": true,\n      \"maxMemoriesPerSession\": 10,\n      \"model\": \"provider/model\"\n    },\n    \"pipeline\": {\n      \"everyNConversations\": 5,\n      \"enableWarmup\": true,\n      \"l1IdleTimeoutSeconds\": 600,\n      \"l2DelayAfterL1Seconds\": 10,\n      \"l2MinIntervalSeconds\": 900,\n      \"l2MaxIntervalSeconds\": 3600,\n      \"sessionActiveWindowHours\": 24\n    },\n    \"recall\": {\n      \"enabled\": true,\n      \"maxResults\": 5,\n      \"scoreThreshold\": 0.3,\n      \"strategy\": \"hybrid\"\n    },\n    \"persona\": {\n      \"triggerEveryN\": 50,\n      \"maxScenes\": 15,\n      \"backupCount\": 3,\n      \"sceneBackupCount\": 10,\n      \"model\": \"provider/model\"\n    },\n    \"embedding\": {\n      \"enabled\": true,\n      \"provider\": \"openai\",\n      \"baseUrl\": \"https://api.openai.com/v1\",\n      \"apiKey\": \"${EMBEDDING_API_KEY}\",\n      \"model\": \"text-embedding-3-small\",\n      \"dimensions\": 1536,\n      \"conflictRecallTopK\": 5\n    }\n  }\n}\n```\n\n### 5) 关键配置规则（避免隐性失败）\n\n- `embedding.provider = \"none\"` 时，向量能力会禁用，仅保留关键词路径。\n- 若配置远端 `provider`（如 `openai` / `deepseek`），必须同时提供：\n  - `apiKey`\n  - `baseUrl`\n  - `model`\n  - `dimensions`\n- 上述任一缺失时，插件会继续运行，但自动降级为非向量模式。\n- `l0l1RetentionDays`：\n  - `0` 表示不清理\n  - 非 `0` 时建议 `>=3`\n  - 若设为 `1~2`，需显式开启 `allowAggressiveCleanup`\n\n### 6) 重启并验证生效\n\n执行：\n\n```bash\nopenclaw gateway restart\n```\n\n检查项：\n\n- Gateway 日志中出现 `[memory-tdai]` 前缀\n- 数据目录已创建：`~/.openclaw/state/memory-tdai/`\n- 至少包含：`conversations/`、`records/`、`scene_blocks/`、`vectors.db`\n\n### 7) 功能冒烟测试\n\n执行一次最小对话回路并验证：\n\n1. 连续对话 2~3 轮，提供可记忆信息（偏好、约束、背景）。\n2. 发起新一轮对话，观察是否出现召回上下文注入。\n3. 在 Agent 中调用：\n   - `tdai_memory_search`\n   - `tdai_conversation_search`\n4. 确认能检索到刚刚产生的内容。\n\n## 故障排查速查\n\n- 插件无日志：检查 `openclaw.json` 中 `memory-tencentdb.enabled` 是否为 `true`，并确认已重启 Gateway。\n- 有记录无召回：检查 `recall.enabled`、`scoreThreshold` 是否过高。\n- 无向量结果：检查 `embedding` 四元组（`apiKey/baseUrl/model/dimensions`）是否齐全。\n- 清理过猛导致历史过少：检查 `l0l1RetentionDays` 与 `allowAggressiveCleanup`。\n- 配置已改但行为不变：确认修改的是 `~/.openclaw/openclaw.json`，并再次重启 Gateway。\n\n## 安全与合规约束\n\n- 将 `apiKey` 视为敏感信息；不在聊天、日志、截图中明文扩散。\n- 优先使用环境变量注入密钥；配置示例中仅保留占位符。\n- 仅修改 `memory-tencentdb` 对应配置段，避免覆盖用户其它插件配置。\n\n## 完成定义（Definition of Done）\n\n在结束任务前，必须同时满足：\n\n- 插件安装/更新命令执行成功\n- `openclaw.json` 已存在有效 `memory-tencentdb` 配置\n- Gateway 已重启\n- `[memory-tdai]` 日志可见\n- 数据目录与关键文件已生成\n- 至少 1 次检索工具调用成功返回结果\n\n## 交付话术模板\n\n可在完成后向用户输出：\n\n- 已完成 `memory-tencentdb` 安装与配置，并重启 Gateway。\n- 已验证日志与数据目录生效，记忆链路可用。\n- 如需下一步优化，可继续调优 `recall.scoreThreshold`、`pipeline.everyNConversations`、`persona.triggerEveryN` 与 `embedding` 模型参数。","frontmatter":{"name":"openclaw-memory-tencentdb-setup","description":"用于在 OpenClaw 环境中安装、配置并验证 @tencentdb-agent-memory/memory-tencentdb 插件。当用户提到\"安装记忆插件\"\"配置 memory-tencentdb\"\"开启长期记忆/召回\"或出现相关报错时应触发。","version":"1.0.0"},"isInternal":false,"tokens":1963,"sizeBytes":5664},{"name":"openclaw.plugin.json","path":"MemoryCore/openclaw-plugin/openclaw.plugin.json","rawUrl":"https://raw.githubusercontent.com/TencentCloud/TencentDB-Agent-Memory/HEAD/MemoryCore/openclaw-plugin/openclaw.plugin.json","title":"Memory TencentDB (Client)","category":"plugin-manifest","format":"json","content":"{\n  \"id\": \"memory-tencentdb-client\",\n  \"name\": \"Memory TencentDB (Client)\",\n  \"version\": \"1.0.0-beta.1\",\n  \"description\": \"长期记忆插件（客户端接入版 /v3）— 通过远端 Memory Gateway 提供四层记忆能力\",\n  \"author\": \"TDAI Team\",\n  \"activation\": {\n    \"onStartup\": true\n  },\n  \"contracts\": {\n    \"tools\": [\n      \"tdai_memory_search\",\n      \"tdai_conversation_search\",\n      \"tdai_read_file\"\n    ]\n  },\n  \"configSchema\": {\n    \"type\": \"object\",\n    \"properties\": {\n      \"server\": {\n        \"type\": \"object\",\n        \"description\": \"远端 memory server 连接与 v3 isolation 配置\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\",\n            \"default\": \"http://127.0.0.1:8420\",\n            \"description\": \"Memory server URL\"\n          },\n          \"apiKey\": {\n            \"type\": \"string\",\n            \"default\": \"local\",\n            \"description\": \"API Key（Bearer）；local 模式可用 local\"\n          },\n          \"instanceId\": {\n            \"type\": \"string\",\n            \"default\": \"default\",\n            \"description\": \"Memory instance id（HTTP header x-tdai-service-id）\"\n          },\n          \"teamId\": {\n            \"type\": \"string\",\n            \"default\": \"default\",\n            \"description\": \"v3 isolation team_id（local 默认与 DEFAULT_ISOLATION_ID 一致）\"\n          },\n          \"agentId\": {\n            \"type\": \"string\",\n            \"default\": \"default\",\n            \"description\": \"v3 isolation agent_id\"\n          },\n          \"userId\": {\n            \"type\": \"string\",\n            \"default\": \"default\",\n            \"description\": \"v3 isolation user_id\"\n          },\n          \"rejectUnauthorized\": {\n            \"type\": \"boolean\",\n            \"default\": true,\n            \"description\": \"是否校验 HTTPS 证书。默认 true；仅自签证书测试环境需要显式设为 false\"\n          }\n        }\n      },\n      \"recall\": {\n        \"type\": \"object\",\n        \"description\": \"记忆召回设置\",\n        \"properties\": {\n          \"maxResults\": {\n            \"type\": \"number\",\n            \"default\": 5,\n            \"description\": \"每轮最多注入多少条 L1 记忆\"\n          },\n          \"includePersona\": {\n            \"type\": \"boolean\",\n            \"default\": true,\n            \"description\": \"是否注入 L3 画像\"\n          },\n          \"includeSceneNav\": {\n            \"type\": \"boolean\",\n            \"default\": true,\n            \"description\": \"是否注入 L2 场景导航索引\"\n          }\n        }\n      },\n      \"capture\": {\n        \"type\": \"object\",\n        \"description\": \"对话捕获设置\",\n        \"properties\": {\n          \"enabled\": {\n            \"type\": \"boolean\",\n            \"default\": true,\n            \"description\": \"是否启用自动对话捕获 (L0)\"\n          }\n        }\n      }\n    }\n  }\n}\n","frontmatter":{"id":"memory-tencentdb-client","name":"Memory TencentDB (Client)","version":"1.0.0-beta.1","description":"长期记忆插件（客户端接入版 /v3）— 通过远端 Memory Gateway 提供四层记忆能力","author":"TDAI Team","activation":{"onStartup":true},"contracts":{"tools":["tdai_memory_search","tdai_conversation_search","tdai_read_file"]},"configSchema":{"type":"object","properties":{"server":{"type":"object","description":"远端 memory server 连接与 v3 isolation 配置","properties":{"url":{"type":"string","default":"http://127.0.0.1:8420","description":"Memory server URL"},"apiKey":{"type":"string","default":"local","description":"API Key（Bearer）；local 模式可用 local"},"instanceId":{"type":"string","default":"default","description":"Memory instance id（HTTP header x-tdai-service-id）"},"teamId":{"type":"string","default":"default","description":"v3 isolation team_id（local 默认与 DEFAULT_ISOLATION_ID 一致）"},"agentId":{"type":"string","default":"default","description":"v3 isolation agent_id"},"userId":{"type":"string","default":"default","description":"v3 isolation user_id"},"rejectUnauthorized":{"type":"boolean","default":true,"description":"是否校验 HTTPS 证书。默认 true；仅自签证书测试环境需要显式设为 false"}}},"recall":{"type":"object","description":"记忆召回设置","properties":{"maxResults":{"type":"number","default":5,"description":"每轮最多注入多少条 L1 记忆"},"includePersona":{"type":"boolean","default":true,"description":"是否注入 L3 画像"},"includeSceneNav":{"type":"boolean","default":true,"description":"是否注入 L2 场景导航索引"}}},"capture":{"type":"object","description":"对话捕获设置","properties":{"enabled":{"type":"boolean","default":true,"description":"是否启用自动对话捕获 (L0)"}}}}}},"isInternal":false,"tokens":723,"sizeBytes":2815},{"name":"openclaw.plugin.json","path":"MemoryCore/openclaw.plugin.json","rawUrl":"https://raw.githubusercontent.com/TencentCloud/TencentDB-Agent-Memory/HEAD/MemoryCore/openclaw.plugin.json","title":"Memory (TencentDB)","category":"plugin-manifest","format":"json","content":"{\n  \"id\": \"memory-tencentdb\",\n  \"name\": \"Memory (TencentDB)\",\n  \"description\": \"Four-layer memory system — auto-captures, structures, and profiles conversational knowledge\",\n  \"commandAliases\": [\"memory-tdai\"],\n  \"activation\": {\n    \"onStartup\": true\n  },\n  \"contracts\": {\n    \"tools\": [\"tdai_memory_search\", \"tdai_conversation_search\", \"tdai_read_file\"]\n  },\n  \"configSchema\": {\n    \"type\": \"object\",\n    \"additionalProperties\": true,\n    \"properties\": {\n      \"mode\": {\n        \"type\": \"string\",\n        \"enum\": [\"local\", \"function\", \"client\", \"gateway\", \"remote\"],\n        \"default\": \"local\",\n        \"description\": \"OpenClaw 接入模式：local/function（默认，本地进程内运行，使用 OpenClaw function/host LLM runner）或 client/gateway/remote（轻量客户端模式，连接外部 Memory Gateway）\"\n      },\n      \"storeBackend\": {\n        \"type\": \"string\",\n        \"enum\": [\"sqlite\", \"tcvdb\"],\n        \"default\": \"sqlite\",\n        \"description\": \"存储后端：sqlite（本地 SQLite + sqlite-vec）或 tcvdb（腾讯云向量数据库）。仅 local/function 模式生效\"\n      },\n      \"server\": {\n        \"type\": \"object\",\n        \"description\": \"client/gateway/remote 模式下的外部 Memory Gateway 连接配置\",\n        \"properties\": {\n          \"url\": { \"type\": \"string\", \"default\": \"http://127.0.0.1:8420\", \"description\": \"Memory Gateway URL\" },\n          \"apiKey\": { \"type\": \"string\", \"default\": \"local\", \"description\": \"API Key for Gateway authentication\" },\n          \"instanceId\": { \"type\": \"string\", \"default\": \"default\", \"description\": \"Memory instance id（HTTP header x-tdai-service-id）\" }\n        }\n      },\n      \"capture\": {\n        \"type\": \"object\",\n        \"description\": \"对话自动捕获设置 (L0)\",\n        \"properties\": {\n          \"enabled\": { \"type\": \"boolean\", \"default\": true, \"description\": \"是否启用自动对话捕获\" },\n          \"excludeAgents\": { \"type\": \"array\", \"items\": { \"type\": \"string\" }, \"default\": [], \"description\": \"排除的 Agent glob 模式列表（如 bench-judge-*），匹配的 agent 不会被捕获、召回或参与 pipeline 调度\" },\n          \"l0l1RetentionDays\": { \"type\": \"number\", \"default\": 0, \"description\": \"L0/L1 本地文件保留天数（单位天）。0=不清理；非0时默认必须>=3。若为1或2，需显式开启 allowAggressiveCleanup\" },\n          \"allowAggressiveCleanup\": { \"type\": \"boolean\", \"default\": false, \"description\": \"是否允许高风险清理配置（l0l1RetentionDays=1或2）\" },\n          \"cleanTime\": { \"type\": \"string\", \"default\": \"03:00\", \"description\": \"每日清理执行时间（HH:mm）\" }\n        }\n      },\n      \"extraction\": {\n        \"type\": \"object\",\n        \"description\": \"记忆提取设置 (L1)\",\n        \"properties\": {\n          \"enabled\": { \"type\": \"boolean\", \"default\": true, \"description\": \"是否启用后台提取\" },\n          \"enableDedup\": { \"type\": \"boolean\", \"default\": true, \"description\": \"L1 智能去重（基于向量相似度或关键词进行冲突检测）\" },\n          \"maxMemoriesPerSession\": { \"type\": \"number\", \"default\": 20, \"description\": \"单次 L1 提取每 session 最大记忆条数\" },\n          \"model\": { \"type\": \"string\", \"description\": \"提取使用模型 (格式: provider/model)，未填写时使用openclaw默认模型\" }\n        }\n      },\n      \"persona\": {\n        \"type\": \"object\",\n        \"description\": \"场景归纳与用户画像设置 (L2/L3)\",\n        \"properties\": {\n          \"triggerEveryN\": { \"type\": \"number\", \"default\": 50, \"description\": \"每 N 条新记忆触发画像生成\" },\n          \"maxScenes\": { \"type\": \"number\", \"default\": 15, \"description\": \"最大场景数\" },\n          \"backupCount\": { \"type\": \"number\", \"default\": 3, \"description\": \"画像备份保留数量\" },\n          \"sceneBackupCount\": { \"type\": \"number\", \"default\": 10, \"description\": \"场景块备份保留数量\" },\n          \"model\": { \"type\": \"string\", \"description\": \"画像生成模型 (格式: provider/model)，未填写时使用openclaw默认模型\" },\n          \"triggerMode\": { \"type\": \"string\", \"enum\": [\"current\", \"jev\"], \"default\": \"current\", \"description\": \"L3触发策略；jev在现有触发器未命中时判断是否立即同步\" },\n          \"jev\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"endpoint\": { \"type\": \"string\", \"description\": \"System One HTTPS endpoint\" },\n              \"apiKey\": { \"type\": \"string\", \"description\": \"JEV密钥；优先使用TYPESAFE_API_KEY环境变量\" },\n              \"model\": { \"type\": \"string\", \"description\": \"JEV模型或TokenHub服务ID\" },\n              \"timeoutMs\": { \"type\": \"number\", \"minimum\": 100, \"maximum\": 3000, \"default\": 3000 },\n              \"diagnostics\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"mode\": { \"type\": \"string\", \"enum\": [\"off\", \"metadata\", \"full\"], \"default\": \"off\" }\n                }\n              }\n            }\n          }\n        }\n      },\n      \"pipeline\": {\n        \"type\": \"object\",\n        \"description\": \"L1→L2→L3 管线调度设置\",\n        \"properties\": {\n          \"everyNConversations\": { \"type\": \"number\", \"default\": 5, \"description\": \"每 N 轮对话触发 L1 批处理\" },\n          \"enableWarmup\": { \"type\": \"boolean\", \"default\": true, \"description\": \"Warm-up 模式：新 session 从 1 轮触发开始，每次 L1 后翻倍（1→2→4→...→everyN），加速早期记忆提取\" },\n          \"l1IdleTimeoutSeconds\": { \"type\": \"number\", \"default\": 600, \"description\": \"L1 空闲超时（秒）：用户停止对话后多久触发 L1 批处理\" },\n          \"l2DelayAfterL1Seconds\": { \"type\": \"number\", \"default\": 10, \"description\": \"L1 完成后延迟多久触发 L2（秒）\" },\n          \"l2MinIntervalSeconds\": { \"type\": \"number\", \"default\": 900, \"description\": \"同一 session 两次 L2 抽取的最小间隔（秒）\" },\n          \"l2MaxIntervalSeconds\": { \"type\": \"number\", \"default\": 3600, \"description\": \"同一活跃 session 的 L2 最大轮询间隔（秒）\" },\n          \"sessionActiveWindowHours\": { \"type\": \"number\", \"default\": 24, \"description\": \"session 活跃窗口（小时），超过此时间不活跃的 session 停止 L2 轮询\" }\n        }\n      },\n      \"recall\": {\n        \"type\": \"object\",\n        \"description\": \"记忆召回设置\",\n        \"properties\": {\n          \"enabled\": { \"type\": \"boolean\", \"default\": true, \"description\": \"是否启用自动召回\" },\n          \"maxResults\": { \"type\": \"number\", \"default\": 5, \"description\": \"召回最大结果数\" },\n          \"maxCharsPerMemory\": { \"type\": \"number\", \"default\": 0, \"description\": \"单条 L1 记忆注入的最大字符数；填 0 表示不限制\" },\n          \"maxTotalRecallChars\": { \"type\": \"number\", \"default\": 0, \"description\": \"本轮 auto-recall 注入的 L1 记忆总字符预算；填 0 表示不限制\" },\n          \"scoreThreshold\": { \"type\": \"number\", \"default\": 0.3, \"description\": \"最低分数阈值\" },\n          \"strategy\": { \"type\": \"string\", \"enum\": [\"embedding\", \"keyword\", \"hybrid\"], \"default\": \"hybrid\", \"description\": \"搜索策略：keyword(关键词)、embedding(向量)、hybrid(混合RRF融合，推荐)\" },\n          \"timeoutMs\": { \"type\": \"number\", \"default\": 5000, \"description\": \"召回整体超时（毫秒），超时后跳过记忆注入并打印警告日志\" }\n        }\n      },\n      \"embedding\": {\n        \"type\": \"object\",\n        \"description\": \"向量搜索 (Embedding) 配置\",\n        \"properties\": {\n          \"enabled\": { \"type\": \"boolean\", \"default\": true, \"description\": \"是否启用向量搜索（若 provider=none，则实际会被禁用）\" },\n          \"provider\": { \"type\": \"string\", \"default\": \"none\", \"description\": \"Embedding 服务提供者：填写兼容 OpenAI API 的远端服务名称（如 openai、deepseek 等）；不填或填 none 则禁用向量搜索\" },\n          \"proxyUrl\": { \"type\": \"string\", \"description\": \"本地代理地址（仅 provider=qclaw 时必填）。配置后 embedding 请求将通过该代理转发，原始 baseUrl 作为 Remote-URL 头传递\" },\n          \"baseUrl\": { \"type\": \"string\", \"description\": \"API Base URL（必填）：填写对应 provider 的 API 地址\" },\n          \"apiKey\": { \"type\": \"string\", \"description\": \"API Key（必填）\" },\n          \"model\": { \"type\": \"string\", \"description\": \"模型名称（必填）\" },\n          \"dimensions\": { \"type\": \"number\", \"description\": \"向量维度（必填，需与所选模型匹配）\" },\n          \"sendDimensions\": { \"type\": \"boolean\", \"default\": true, \"description\": \"是否在请求体中携带 dimensions 字段。默认 true（兼容 OpenAI text-embedding-3-* 的 Matryoshka 截断）。当目标服务为 BGE-M3 等不支持自定义维度的固定维度模型时，请设为 false，否则会被服务端以 HTTP 400 拒绝（'does not support matryoshka representation'）。\" },\n          \"conflictRecallTopK\": { \"type\": \"number\", \"default\": 5, \"description\": \"冲突检测时召回 Top-K 数\" },\n          \"maxInputChars\": { \"type\": \"number\", \"default\": 5000, \"description\": \"Embedding 输入文本最大字符数，超出时截断并打印警告日志（默认 5000，适合大多数模型的 token 上限）\" },\n          \"timeoutMs\": { \"type\": \"number\", \"default\": 10000, \"description\": \"单次 embedding API 调用超时（毫秒），超时后该次请求中止且不重试\" },\n          \"recallTimeoutMs\": { \"type\": \"number\", \"description\": \"recall 路径 embedding 超时（毫秒），覆盖 timeoutMs。用户等待中，建议设短一些（如 3000）\" },\n          \"captureTimeoutMs\": { \"type\": \"number\", \"description\": \"capture 路径 embedding 超时（毫秒），覆盖 timeoutMs。后台运行，可设长一些（如 15000）\" }\n        }\n      },\n      \"tcvdb\": {\n        \"type\": \"object\",\n        \"description\": \"腾讯云向量数据库配置（仅 storeBackend=tcvdb 时生效）\",\n        \"properties\": {\n          \"url\": { \"type\": \"string\", \"description\": \"实例 URL（必填，如 http://10.0.1.1:8100）\" },\n          \"username\": { \"type\": \"string\", \"default\": \"root\", \"description\": \"账户名\" },\n          \"apiKey\": { \"type\": \"string\", \"description\": \"API Key（必填）\" },\n          \"database\": { \"type\": \"string\", \"description\": \"数据库名（未填写时默认根据实例 ID 自动生成）\" },\n          \"alias\": { \"type\": \"string\", \"description\": \"用户友好别名（可选，用于 database.json 中识别）\" },\n          \"embeddingModel\": { \"type\": \"string\", \"default\": \"bge-large-zh\", \"description\": \"服务端 embedding 模型\" },\n          \"timeout\": { \"type\": \"number\", \"default\": 10000, \"description\": \"请求超时（毫秒）\" },\n          \"caPemPath\": { \"type\": \"string\", \"description\": \"CA 证书 PEM 文件路径（HTTPS 连接时使用）\" }\n        }\n      },\n      \"bm25\": {\n        \"type\": \"object\",\n        \"description\": \"BM25 稀疏向量编码设置（主要用于 tcvdb 后端）\",\n        \"properties\": {\n          \"enabled\": { \"type\": \"boolean\", \"default\": true, \"description\": \"是否启用 BM25 稀疏向量编码\" },\n          \"language\": { \"type\": \"string\", \"enum\": [\"zh\", \"en\"], \"default\": \"zh\", \"description\": \"分词语言：zh（中文）或 en（英文）\" }\n        }\n      },\n      \"report\": {\n        \"type\": \"object\",\n        \"description\": \"指标上报设置\",\n        \"properties\": {\n          \"enabled\": { \"type\": \"boolean\", \"default\": false, \"description\": \"是否启用指标上报（通过 Gateway 日志输出结构化 METRIC JSON）\" },\n          \"type\": { \"type\": \"string\", \"default\": \"local\", \"description\": \"上报方式：local 表示通过 logger 输出结构化 JSON 日志\" }\n        }\n      },\n      \"llm\": {\n        \"type\": \"object\",\n        \"description\": \"独立 LLM 配置 — 开启后 L1/L2/L3 提取绕过 OpenClaw 的内置模型，改用指定的 OpenAI-compatible API 直接调用。默认关闭（使用 OpenClaw 宿主模型）。\",\n        \"properties\": {\n          \"enabled\": { \"type\": \"boolean\", \"default\": false, \"description\": \"是否启用独立 LLM 模式。关闭时使用 OpenClaw 宿主模型。\" },\n          \"baseUrl\": { \"type\": \"string\", \"default\": \"https://api.openai.com/v1\", \"description\": \"OpenAI-compatible API 地址\" },\n          \"apiKey\": { \"type\": \"string\", \"description\": \"API Key\" },\n          \"model\": { \"type\": \"string\", \"default\": \"gpt-4o\", \"description\": \"模型名称（如 gpt-4o, deepseek-v3, claude-sonnet-4-6）\" },\n          \"maxTokens\": { \"type\": \"number\", \"default\": 4096, \"description\": \"最大输出 token 数\" },\n          \"timeoutMs\": { \"type\": \"number\", \"default\": 120000, \"description\": \"请求超时（毫秒）\" },\n          \"stream\": { \"type\": \"boolean\", \"default\": false, \"description\": \"是否用流式请求(streamText)调用上游。默认 false(非流式)。个别只接受流式请求的 OpenAI 兼容上游需置 true。⚠️ 仅在启用独立 LLM(llm.enabled=true)时生效；未启用时走 OpenClaw host runner，此开关被忽略。\" }\n        }\n      },\n      \"offload\": {\n        \"type\": \"object\",\n        \"description\": \"Context Offload 设置 — 多层上下文压缩系统（独立开关，默认关闭）。支持 local（本地 LLM 处理）和 client（复用 server.url 远端服务）两种模式\",\n        \"properties\": {\n          \"enabled\": { \"type\": \"boolean\", \"default\": false, \"description\": \"是否启用 Context Offload（默认关闭，不影响 Memory 功能）\" },\n          \"mode\": { \"type\": \"string\", \"enum\": [\"local\", \"backend\", \"client\", \"collect\"], \"description\": \"Offload 运行模式：local（本地 LLM 处理）、backend（走 backendUrl 远端 v1 服务）、client（复用 server.url 远端 offload v2 服务）、collect（仅数据采集，不压缩）。未设置时自动推导：有 backendUrl → backend，有 server.url → client，否则 → local\" },\n          \"model\": { \"type\": \"string\", \"description\": \"【local 模式】Offload 使用的 LLM 模型（格式: provider/model），未填写时使用 openclaw 默认模型\" },\n          \"temperature\": { \"type\": \"number\", \"default\": 0.2, \"description\": \"【local 模式】LLM 温度参数\" },\n          \"stream\": { \"type\": \"boolean\", \"default\": false, \"description\": \"【仅 mode=local 生效】是否用流式请求(streamText)调用上游。默认 false(非流式)。个别只接受流式请求的 OpenAI 兼容上游需置 true。backend/client/collect 模式由远端 offload server 主导调用，此开关被忽略。\" },\n          \"forceTriggerThreshold\": { \"type\": \"number\", \"default\": 4, \"description\": \"【local 模式】累积多少个 tool pair 后强制触发 L1\" },\n          \"dataDir\": { \"type\": \"string\", \"description\": \"【local 模式】自定义数据目录（绝对路径），默认 ~/.openclaw/context-offload\" },\n          \"defaultContextWindow\": { \"type\": \"number\", \"default\": 200000, \"description\": \"默认上下文窗口大小\" },\n          \"maxPairsPerBatch\": { \"type\": \"number\", \"default\": 20, \"description\": \"【local 模式】L1 每批最大 tool pair 数\" },\n          \"l2NullThreshold\": { \"type\": \"number\", \"default\": 4, \"description\": \"【local 模式】offload.jsonl 中 node_id=null 数量达到此阈值时触发 L2\" },\n          \"l2TimeoutSeconds\": { \"type\": \"number\", \"default\": 300, \"description\": \"【local 模式】距上次 L2 超过此秒数时触发 L2\" },\n          \"mildOffloadRatio\": { \"type\": \"number\", \"default\": 0.5, \"description\": \"温和压缩触发比例（占 context window）\" },\n          \"aggressiveCompressRatio\": { \"type\": \"number\", \"default\": 0.85, \"description\": \"激进压缩触发比例\" },\n          \"mmdMaxTokenRatio\": { \"type\": \"number\", \"default\": 0.2, \"description\": \"【local 模式】MMD 注入 token 预算比例\" },\n          \"compactionRatio\": { \"type\": \"number\", \"default\": 0.5, \"description\": \"【client 模式】上下文占比超过此阈值时触发压缩（0-1），复用 server.url 作为后端地址\" },\n          \"ingestTimeoutMs\": { \"type\": \"number\", \"default\": 5000, \"description\": \"【client 模式】Ingest 请求超时（毫秒）\" },\n          \"compactionTimeoutMs\": { \"type\": \"number\", \"default\": 30000, \"description\": \"【client 模式】Compaction 请求超时（毫秒）\" },\n          \"backendUrl\": { \"type\": \"string\", \"description\": \"【已废弃，请使用 mode=client】后端服务 URL，配置后 L1/L1.5/L2/L4 走后端\" },\n          \"backendApiKey\": { \"type\": \"string\", \"description\": \"【已废弃，请使用 mode=client】后端 API 认证 token\" },\n          \"backendTimeoutMs\": { \"type\": \"number\", \"default\": 10000, \"description\": \"【已废弃，请使用 mode=client】后端调用超时（毫秒）\" }\n        }\n      }\n    }\n  }\n}\n","frontmatter":{"id":"memory-tencentdb","name":"Memory (TencentDB)","description":"Four-layer memory system — auto-captures, structures, and profiles conversational knowledge","commandAliases":["memory-tdai"],"activation":{"onStartup":true},"contracts":{"tools":["tdai_memory_search","tdai_conversation_search","tdai_read_file"]},"configSchema":{"type":"object","additionalProperties":true,"properties":{"mode":{"type":"string","enum":["local","function","client","gateway","remote"],"default":"local","description":"OpenClaw 接入模式：local/function（默认，本地进程内运行，使用 OpenClaw function/host LLM runner）或 client/gateway/remote（轻量客户端模式，连接外部 Memory Gateway）"},"storeBackend":{"type":"string","enum":["sqlite","tcvdb"],"default":"sqlite","description":"存储后端：sqlite（本地 SQLite + sqlite-vec）或 tcvdb（腾讯云向量数据库）。仅 local/function 模式生效"},"server":{"type":"object","description":"client/gateway/remote 模式下的外部 Memory Gateway 连接配置","properties":{"url":{"type":"string","default":"http://127.0.0.1:8420","description":"Memory Gateway URL"},"apiKey":{"type":"string","default":"local","description":"API Key for Gateway authentication"},"instanceId":{"type":"string","default":"default","description":"Memory instance id（HTTP header x-tdai-service-id）"}}},"capture":{"type":"object","description":"对话自动捕获设置 (L0)","properties":{"enabled":{"type":"boolean","default":true,"description":"是否启用自动对话捕获"},"excludeAgents":{"type":"array","items":{"type":"string"},"default":[],"description":"排除的 Agent glob 模式列表（如 bench-judge-*），匹配的 agent 不会被捕获、召回或参与 pipeline 调度"},"l0l1RetentionDays":{"type":"number","default":0,"description":"L0/L1 本地文件保留天数（单位天）。0=不清理；非0时默认必须>=3。若为1或2，需显式开启 allowAggressiveCleanup"},"allowAggressiveCleanup":{"type":"boolean","default":false,"description":"是否允许高风险清理配置（l0l1RetentionDays=1或2）"},"cleanTime":{"type":"string","default":"03:00","description":"每日清理执行时间（HH:mm）"}}},"extraction":{"type":"object","description":"记忆提取设置 (L1)","properties":{"enabled":{"type":"boolean","default":true,"description":"是否启用后台提取"},"enableDedup":{"type":"boolean","default":true,"description":"L1 智能去重（基于向量相似度或关键词进行冲突检测）"},"maxMemoriesPerSession":{"type":"number","default":20,"description":"单次 L1 提取每 session 最大记忆条数"},"model":{"type":"string","description":"提取使用模型 (格式: provider/model)，未填写时使用openclaw默认模型"}}},"persona":{"type":"object","description":"场景归纳与用户画像设置 (L2/L3)","properties":{"triggerEveryN":{"type":"number","default":50,"description":"每 N 条新记忆触发画像生成"},"maxScenes":{"type":"number","default":15,"description":"最大场景数"},"backupCount":{"type":"number","default":3,"description":"画像备份保留数量"},"sceneBackupCount":{"type":"number","default":10,"description":"场景块备份保留数量"},"model":{"type":"string","description":"画像生成模型 (格式: provider/model)，未填写时使用openclaw默认模型"},"triggerMode":{"type":"string","enum":["current","jev"],"default":"current","description":"L3触发策略；jev在现有触发器未命中时判断是否立即同步"},"jev":{"type":"object","properties":{"endpoint":{"type":"string","description":"System One HTTPS endpoint"},"apiKey":{"type":"string","description":"JEV密钥；优先使用TYPESAFE_API_KEY环境变量"},"model":{"type":"string","description":"JEV模型或TokenHub服务ID"},"timeoutMs":{"type":"number","minimum":100,"maximum":3000,"default":3000},"diagnostics":{"type":"object","properties":{"mode":{"type":"string","enum":["off","metadata","full"],"default":"off"}}}}}}},"pipeline":{"type":"object","description":"L1→L2→L3 管线调度设置","properties":{"everyNConversations":{"type":"number","default":5,"description":"每 N 轮对话触发 L1 批处理"},"enableWarmup":{"type":"boolean","default":true,"description":"Warm-up 模式：新 session 从 1 轮触发开始，每次 L1 后翻倍（1→2→4→...→everyN），加速早期记忆提取"},"l1IdleTimeoutSeconds":{"type":"number","default":600,"description":"L1 空闲超时（秒）：用户停止对话后多久触发 L1 批处理"},"l2DelayAfterL1Seconds":{"type":"number","default":10,"description":"L1 完成后延迟多久触发 L2（秒）"},"l2MinIntervalSeconds":{"type":"number","default":900,"description":"同一 session 两次 L2 抽取的最小间隔（秒）"},"l2MaxIntervalSeconds":{"type":"number","default":3600,"description":"同一活跃 session 的 L2 最大轮询间隔（秒）"},"sessionActiveWindowHours":{"type":"number","default":24,"description":"session 活跃窗口（小时），超过此时间不活跃的 session 停止 L2 轮询"}}},"recall":{"type":"object","description":"记忆召回设置","properties":{"enabled":{"type":"boolean","default":true,"description":"是否启用自动召回"},"maxResults":{"type":"number","default":5,"description":"召回最大结果数"},"maxCharsPerMemory":{"type":"number","default":0,"description":"单条 L1 记忆注入的最大字符数；填 0 表示不限制"},"maxTotalRecallChars":{"type":"number","default":0,"description":"本轮 auto-recall 注入的 L1 记忆总字符预算；填 0 表示不限制"},"scoreThreshold":{"type":"number","default":0.3,"description":"最低分数阈值"},"strategy":{"type":"string","enum":["embedding","keyword","hybrid"],"default":"hybrid","description":"搜索策略：keyword(关键词)、embedding(向量)、hybrid(混合RRF融合，推荐)"},"timeoutMs":{"type":"number","default":5000,"description":"召回整体超时（毫秒），超时后跳过记忆注入并打印警告日志"}}},"embedding":{"type":"object","description":"向量搜索 (Embedding) 配置","properties":{"enabled":{"type":"boolean","default":true,"description":"是否启用向量搜索（若 provider=none，则实际会被禁用）"},"provider":{"type":"string","default":"none","description":"Embedding 服务提供者：填写兼容 OpenAI API 的远端服务名称（如 openai、deepseek 等）；不填或填 none 则禁用向量搜索"},"proxyUrl":{"type":"string","description":"本地代理地址（仅 provider=qclaw 时必填）。配置后 embedding 请求将通过该代理转发，原始 baseUrl 作为 Remote-URL 头传递"},"baseUrl":{"type":"string","description":"API Base URL（必填）：填写对应 provider 的 API 地址"},"apiKey":{"type":"string","description":"API Key（必填）"},"model":{"type":"string","description":"模型名称（必填）"},"dimensions":{"type":"number","description":"向量维度（必填，需与所选模型匹配）"},"sendDimensions":{"type":"boolean","default":true,"description":"是否在请求体中携带 dimensions 字段。默认 true（兼容 OpenAI text-embedding-3-* 的 Matryoshka 截断）。当目标服务为 BGE-M3 等不支持自定义维度的固定维度模型时，请设为 false，否则会被服务端以 HTTP 400 拒绝（'does not support matryoshka representation'）。"},"conflictRecallTopK":{"type":"number","default":5,"description":"冲突检测时召回 Top-K 数"},"maxInputChars":{"type":"number","default":5000,"description":"Embedding 输入文本最大字符数，超出时截断并打印警告日志（默认 5000，适合大多数模型的 token 上限）"},"timeoutMs":{"type":"number","default":10000,"description":"单次 embedding API 调用超时（毫秒），超时后该次请求中止且不重试"},"recallTimeoutMs":{"type":"number","description":"recall 路径 embedding 超时（毫秒），覆盖 timeoutMs。用户等待中，建议设短一些（如 3000）"},"captureTimeoutMs":{"type":"number","description":"capture 路径 embedding 超时（毫秒），覆盖 timeoutMs。后台运行，可设长一些（如 15000）"}}},"tcvdb":{"type":"object","description":"腾讯云向量数据库配置（仅 storeBackend=tcvdb 时生效）","properties":{"url":{"type":"string","description":"实例 URL（必填，如 http://10.0.1.1:8100）"},"username":{"type":"string","default":"root","description":"账户名"},"apiKey":{"type":"string","description":"API Key（必填）"},"database":{"type":"string","description":"数据库名（未填写时默认根据实例 ID 自动生成）"},"alias":{"type":"string","description":"用户友好别名（可选，用于 database.json 中识别）"},"embeddingModel":{"type":"string","default":"bge-large-zh","description":"服务端 embedding 模型"},"timeout":{"type":"number","default":10000,"description":"请求超时（毫秒）"},"caPemPath":{"type":"string","description":"CA 证书 PEM 文件路径（HTTPS 连接时使用）"}}},"bm25":{"type":"object","description":"BM25 稀疏向量编码设置（主要用于 tcvdb 后端）","properties":{"enabled":{"type":"boolean","default":true,"description":"是否启用 BM25 稀疏向量编码"},"language":{"type":"string","enum":["zh","en"],"default":"zh","description":"分词语言：zh（中文）或 en（英文）"}}},"report":{"type":"object","description":"指标上报设置","properties":{"enabled":{"type":"boolean","default":false,"description":"是否启用指标上报（通过 Gateway 日志输出结构化 METRIC JSON）"},"type":{"type":"string","default":"local","description":"上报方式：local 表示通过 logger 输出结构化 JSON 日志"}}},"llm":{"type":"object","description":"独立 LLM 配置 — 开启后 L1/L2/L3 提取绕过 OpenClaw 的内置模型，改用指定的 OpenAI-compatible API 直接调用。默认关闭（使用 OpenClaw 宿主模型）。","properties":{"enabled":{"type":"boolean","default":false,"description":"是否启用独立 LLM 模式。关闭时使用 OpenClaw 宿主模型。"},"baseUrl":{"type":"string","default":"https://api.openai.com/v1","description":"OpenAI-compatible API 地址"},"apiKey":{"type":"string","description":"API Key"},"model":{"type":"string","default":"gpt-4o","description":"模型名称（如 gpt-4o, deepseek-v3, claude-sonnet-4-6）"},"maxTokens":{"type":"number","default":4096,"description":"最大输出 token 数"},"timeoutMs":{"type":"number","default":120000,"description":"请求超时（毫秒）"},"stream":{"type":"boolean","default":false,"description":"是否用流式请求(streamText)调用上游。默认 false(非流式)。个别只接受流式请求的 OpenAI 兼容上游需置 true。⚠️ 仅在启用独立 LLM(llm.enabled=true)时生效；未启用时走 OpenClaw host runner，此开关被忽略。"}}},"offload":{"type":"object","description":"Context Offload 设置 — 多层上下文压缩系统（独立开关，默认关闭）。支持 local（本地 LLM 处理）和 client（复用 server.url 远端服务）两种模式","properties":{"enabled":{"type":"boolean","default":false,"description":"是否启用 Context Offload（默认关闭，不影响 Memory 功能）"},"mode":{"type":"string","enum":["local","backend","client","collect"],"description":"Offload 运行模式：local（本地 LLM 处理）、backend（走 backendUrl 远端 v1 服务）、client（复用 server.url 远端 offload v2 服务）、collect（仅数据采集，不压缩）。未设置时自动推导：有 backendUrl → backend，有 server.url → client，否则 → local"},"model":{"type":"string","description":"【local 模式】Offload 使用的 LLM 模型（格式: provider/model），未填写时使用 openclaw 默认模型"},"temperature":{"type":"number","default":0.2,"description":"【local 模式】LLM 温度参数"},"stream":{"type":"boolean","default":false,"description":"【仅 mode=local 生效】是否用流式请求(streamText)调用上游。默认 false(非流式)。个别只接受流式请求的 OpenAI 兼容上游需置 true。backend/client/collect 模式由远端 offload server 主导调用，此开关被忽略。"},"forceTriggerThreshold":{"type":"number","default":4,"description":"【local 模式】累积多少个 tool pair 后强制触发 L1"},"dataDir":{"type":"string","description":"【local 模式】自定义数据目录（绝对路径），默认 ~/.openclaw/context-offload"},"defaultContextWindow":{"type":"number","default":200000,"description":"默认上下文窗口大小"},"maxPairsPerBatch":{"type":"number","default":20,"description":"【local 模式】L1 每批最大 tool pair 数"},"l2NullThreshold":{"type":"number","default":4,"description":"【local 模式】offload.jsonl 中 node_id=null 数量达到此阈值时触发 L2"},"l2TimeoutSeconds":{"type":"number","default":300,"description":"【local 模式】距上次 L2 超过此秒数时触发 L2"},"mildOffloadRatio":{"type":"number","default":0.5,"description":"温和压缩触发比例（占 context window）"},"aggressiveCompressRatio":{"type":"number","default":0.85,"description":"激进压缩触发比例"},"mmdMaxTokenRatio":{"type":"number","default":0.2,"description":"【local 模式】MMD 注入 token 预算比例"},"compactionRatio":{"type":"number","default":0.5,"description":"【client 模式】上下文占比超过此阈值时触发压缩（0-1），复用 server.url 作为后端地址"},"ingestTimeoutMs":{"type":"number","default":5000,"description":"【client 模式】Ingest 请求超时（毫秒）"},"compactionTimeoutMs":{"type":"number","default":30000,"description":"【client 模式】Compaction 请求超时（毫秒）"},"backendUrl":{"type":"string","description":"【已废弃，请使用 mode=client】后端服务 URL，配置后 L1/L1.5/L2/L4 走后端"},"backendApiKey":{"type":"string","description":"【已废弃，请使用 mode=client】后端 API 认证 token"},"backendTimeoutMs":{"type":"number","default":10000,"description":"【已废弃，请使用 mode=client】后端调用超时（毫秒）"}}}}}},"isInternal":false,"tokens":5077,"sizeBytes":16726}],"systemPromptSnippet":"<yakaai_skills repo=\"TencentCloud/TencentDB-Agent-Memory\">\n<!-- File: MemoryCore/SKILL.md (Tokens: ~1963 | Category: anthropic-skill) -->\n---\nname: openclaw-memory-tencentdb-setup\ndescription: 用于在 OpenClaw 环境中安装、配置并验证 @tencentdb-agent-memory/memory-tencentdb 插件。当用户提到\"安装记忆插件\"\"配置 memory-tencentdb\"\"开启长期记忆/召回\"或出现相关报错时应触发。\nversion: 1.0.0\n---\n\n## 目的\n\n在不依赖外部托管记忆服务的前提下，为 OpenClaw 提供可持续的本地长期记忆能力（L0→L1→L2→L3），并完成从安装、配置到验收的一次性闭环。\n\n## 适用场景\n\n- 用户要求在 OpenClaw 中安装或启用 `memory-tencentdb`\n- 用户需要配置召回、提取、画像、清理等参数\n- 用户反馈\"插件已装但无记忆 / 无召回 / 无向量检索\"\n\n## 不适用场景\n\n- 用户只需要解释 memory 理念，不要求实际落地\n- 用户要接入非 OpenClaw 宿主（先确认目标框架）\n\n## 标准工作流\n\n### 1) 环境预检\n\n先确认基础版本满足要求：\n\n- OpenClaw: `>= 2026.3.13`\n- Node.js: `>= 22.16.0`\n\n执行：\n\n```bash\nopenclaw --version\nnode -v\n```\n\n若版本不满足，先升级再继续。\n\n### 2) 安装插件\n\n执行安装命令：\n\n```bash\nopenclaw plugins install @tencentdb-agent-memory/memory-tencentdb\n```\n\n如已安装则执行更新：\n\n```bash\nopenclaw plugins update memory-tencentdb\n```\n\n### 3) 写入最小配置\n\n编辑 `~/.openclaw/openclaw.json`，确保存在：\n\n```json\n{\n  \"memory-tencentdb\": {\n    \"enabled\": true\n  }\n}\n```\n\n说明：该插件支持零配置启动；不补充其它字段也能运行基础能力。\n\n### 4) 按需追加推荐配置（生产常用）\n\n根据用户需求补充如下分组：\n\n- `capture`: 对话捕获与保留策略\n- `extraction`: L1 提取与去重\n- `pipeline`: L1→L2→L3 调度\n- `recall`: 召回数量、阈值、策略\n- `persona`: 场景与画像触发参数\n- `embedding`: 向量检索配置（远端 OpenAI 兼容）\n\n推荐模板：\n\n```json\n{\n  \"memory-tencentdb\": {\n    \"capture\": {\n      \"enabled\": true,\n      \"excludeAgents\": [],\n      \"l0l1RetentionDays\": 90,\n      \"cleanTime\": \"03:00\"\n    },\n    \"extraction\": {\n      \"enabled\": true,\n      \"enableDedup\": true,\n      \"maxMemoriesPerSession\": 10,\n      \"model\": \"provider/model\"\n    },\n    \"pipeline\": {\n      \"everyNConversations\": 5,\n      \"enableWarmup\": true,\n      \"l1IdleTimeoutSeconds\": 600,\n      \"l2DelayAfterL1Seconds\": 10,\n      \"l2MinIntervalSeconds\": 900,\n      \"l2MaxIntervalSeconds\": 3600,\n      \"sessionActiveWindowHours\": 24\n    },\n    \"recall\": {\n      \"enabled\": true,\n      \"maxResults\": 5,\n      \"scoreThreshold\": 0.3,\n      \"strategy\": \"hybrid\"\n    },\n    \"persona\": {\n      \"triggerEveryN\": 50,\n      \"maxScenes\": 15,\n      \"backupCount\": 3,\n      \"sceneBackupCount\": 10,\n      \"model\": \"provider/model\"\n    },\n    \"embedding\": {\n      \"enabled\": true,\n      \"provider\": \"openai\",\n      \"baseUrl\": \"https://api.openai.com/v1\",\n      \"apiKey\": \"${EMBEDDING_API_KEY}\",\n      \"model\": \"text-embedding-3-small\",\n      \"dimensions\": 1536,\n      \"conflictRecallTopK\": 5\n    }\n  }\n}\n```\n\n### 5) 关键配置规则（避免隐性失败）\n\n- `embedding.provider = \"none\"` 时，向量能力会禁用，仅保留关键词路径。\n- 若配置远端 `provider`（如 `openai` / `deepseek`），必须同时提供：\n  - `apiKey`\n  - `baseUrl`\n  - `model`\n  - `dimensions`\n- 上述任一缺失时，插件会继续运行，但自动降级为非向量模式。\n- `l0l1RetentionDays`：\n  - `0` 表示不清理\n  - 非 `0` 时建议 `>=3`\n  - 若设为 `1~2`，需显式开启 `allowAggressiveCleanup`\n\n### 6) 重启并验证生效\n\n执行：\n\n```bash\nopenclaw gateway restart\n```\n\n检查项：\n\n- Gateway 日志中出现 `[memory-tdai]` 前缀\n- 数据目录已创建：`~/.openclaw/state/memory-tdai/`\n- 至少包含：`conversations/`、`records/`、`scene_blocks/`、`vectors.db`\n\n### 7) 功能冒烟测试\n\n执行一次最小对话回路并验证：\n\n1. 连续对话 2~3 轮，提供可记忆信息（偏好、约束、背景）。\n2. 发起新一轮对话，观察是否出现召回上下文注入。\n3. 在 Agent 中调用：\n   - `tdai_memory_search`\n   - `tdai_conversation_search`\n4. 确认能检索到刚刚产生的内容。\n\n## 故障排查速查\n\n- 插件无日志：检查 `openclaw.json` 中 `memory-tencentdb.enabled` 是否为 `true`，并确认已重启 Gateway。\n- 有记录无召回：检查 `recall.enabled`、`scoreThreshold` 是否过高。\n- 无向量结果：检查 `embedding` 四元组（`apiKey/baseUrl/model/dimensions`）是否齐全。\n- 清理过猛导致历史过少：检查 `l0l1RetentionDays` 与 `allowAggressiveCleanup`。\n- 配置已改但行为不变：确认修改的是 `~/.openclaw/openclaw.json`，并再次重启 Gateway。\n\n## 安全与合规约束\n\n- 将 `apiKey` 视为敏感信息；不在聊天、日志、截图中明文扩散。\n- 优先使用环境变量注入密钥；配置示例中仅保留占位符。\n- 仅修改 `memory-tencentdb` 对应配置段，避免覆盖用户其它插件配置。\n\n## 完成定义（Definition of Done）\n\n在结束任务前，必须同时满足：\n\n- 插件安装/更新命令执行成功\n- `openclaw.json` 已存在有效 `memory-tencentdb` 配置\n- Gateway 已重启\n- `[memory-tdai]` 日志可见\n- 数据目录与关键文件已生成\n- 至少 1 次检索工具调用成功返回结果\n\n## 交付话术模板\n\n可在完成后向用户输出：\n\n- 已完成 `memory-tencentdb` 安装与配置，并重启 Gateway。\n- 已验证日志与数据目录生效，记忆链路可用。\n- 如需下一步优化，可继续调优 `recall.scoreThreshold`、`pipeline.everyNConversations`、`persona.triggerEveryN` 与 `embedding` 模型参数。\n\n<!-- File: MemoryCore/openclaw-plugin/openclaw.plugin.json (Tokens: ~723 | Category: plugin-manifest) -->\n{\n  \"id\": \"memory-tencentdb-client\",\n  \"name\": \"Memory TencentDB (Client)\",\n  \"version\": \"1.0.0-beta.1\",\n  \"description\": \"长期记忆插件（客户端接入版 /v3）— 通过远端 Memory Gateway 提供四层记忆能力\",\n  \"author\": \"TDAI Team\",\n  \"activation\": {\n    \"onStartup\": true\n  },\n  \"contracts\": {\n    \"tools\": [\n      \"tdai_memory_search\",\n      \"tdai_conversation_search\",\n      \"tdai_read_file\"\n    ]\n  },\n  \"configSchema\": {\n    \"type\": \"object\",\n    \"properties\": {\n      \"server\": {\n        \"type\": \"object\",\n        \"description\": \"远端 memory server 连接与 v3 isolation 配置\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\",\n            \"default\": \"http://127.0.0.1:8420\",\n            \"description\": \"Memory server URL\"\n          },\n          \"apiKey\": {\n            \"type\": \"string\",\n            \"default\": \"local\",\n            \"description\": \"API Key（Bearer）；local 模式可用 local\"\n          },\n          \"instanceId\": {\n            \"type\": \"string\",\n            \"default\": \"default\",\n            \"description\": \"Memory instance id（HTTP header x-tdai-service-id）\"\n          },\n          \"teamId\": {\n            \"type\": \"string\",\n            \"default\": \"default\",\n            \"description\": \"v3 isolation team_id（local 默认与 DEFAULT_ISOLATION_ID 一致）\"\n          },\n          \"agentId\": {\n            \"type\": \"string\",\n            \"default\": \"default\",\n            \"description\": \"v3 isolation agent_id\"\n          },\n          \"userId\": {\n            \"type\": \"string\",\n            \"default\": \"default\",\n            \"description\": \"v3 isolation user_id\"\n          },\n          \"rejectUnauthorized\": {\n            \"type\": \"boolean\",\n            \"default\": true,\n            \"description\": \"是否校验 HTTPS 证书。默认 true；仅自签证书测试环境需要显式设为 false\"\n          }\n        }\n      },\n      \"recall\": {\n        \"type\": \"object\",\n        \"description\": \"记忆召回设置\",\n        \"properties\": {\n          \"maxResults\": {\n            \"type\": \"number\",\n            \"default\": 5,\n            \"description\": \"每轮最多注入多少条 L1 记忆\"\n          },\n          \"includePersona\": {\n            \"type\": \"boolean\",\n            \"default\": true,\n            \"description\": \"是否注入 L3 画像\"\n          },\n          \"includeSceneNav\": {\n            \"type\": \"boolean\",\n            \"default\": true,\n            \"description\": \"是否注入 L2 场景导航索引\"\n          }\n        }\n      },\n      \"capture\": {\n        \"type\": \"object\",\n        \"description\": \"对话捕获设置\",\n        \"properties\": {\n          \"enabled\": {\n            \"type\": \"boolean\",\n            \"default\": true,\n            \"description\": \"是否启用自动对话捕获 (L0)\"\n          }\n        }\n      }\n    }\n  }\n}\n\n<!-- File: MemoryCore/openclaw.plugin.json (Tokens: ~5077 | Category: plugin-manifest) -->\n{\n  \"id\": \"memory-tencentdb\",\n  \"name\": \"Memory (TencentDB)\",\n  \"description\": \"Four-layer memory system — auto-captures, structures, and profiles conversational knowledge\",\n  \"commandAliases\": [\"memory-tdai\"],\n  \"activation\": {\n    \"onStartup\": true\n  },\n  \"contracts\": {\n    \"tools\": [\"tdai_memory_search\", \"tdai_conversation_search\", \"tdai_read_file\"]\n  },\n  \"configSchema\": {\n    \"type\": \"object\",\n    \"additionalProperties\": true,\n    \"properties\": {\n      \"mode\": {\n        \"type\": \"string\",\n        \"enum\": [\"local\", \"function\", \"client\", \"gateway\", \"remote\"],\n        \"default\": \"local\",\n        \"description\": \"OpenClaw 接入模式：local/function（默认，本地进程内运行，使用 OpenClaw function/host LLM runner）或 client/gateway/remote（轻量客户端模式，连接外部 Memory Gateway）\"\n      },\n      \"storeBackend\": {\n        \"type\": \"string\",\n        \"enum\": [\"sqlite\", \"tcvdb\"],\n        \"default\": \"sqlite\",\n        \"description\": \"存储后端：sqlite（本地 SQLite + sqlite-vec）或 tcvdb（腾讯云向量数据库）。仅 local/function 模式生效\"\n      },\n      \"server\": {\n        \"type\": \"object\",\n        \"description\": \"client/gateway/remote 模式下的外部 Memory Gateway 连接配置\",\n        \"properties\": {\n          \"url\": { \"type\": \"string\", \"default\": \"http://127.0.0.1:8420\", \"description\": \"Memory Gateway URL\" },\n          \"apiKey\": { \"type\": \"string\", \"default\": \"local\", \"description\": \"API Key for Gateway authentication\" },\n          \"instanceId\": { \"type\": \"string\", \"default\": \"default\", \"description\": \"Memory instance id（HTTP header x-tdai-service-id）\" }\n        }\n      },\n      \"capture\": {\n        \"type\": \"object\",\n        \"description\": \"对话自动捕获设置 (L0)\",\n        \"properties\": {\n          \"enabled\": { \"type\": \"boolean\", \"default\": true, \"description\": \"是否启用自动对话捕获\" },\n          \"excludeAgents\": { \"type\": \"array\", \"items\": { \"type\": \"string\" }, \"default\": [], \"description\": \"排除的 Agent glob 模式列表（如 bench-judge-*），匹配的 agent 不会被捕获、召回或参与 pipeline 调度\" },\n          \"l0l1RetentionDays\": { \"type\": \"number\", \"default\": 0, \"description\": \"L0/L1 本地文件保留天数（单位天）。0=不清理；非0时默认必须>=3。若为1或2，需显式开启 allowAggressiveCleanup\" },\n          \"allowAggressiveCleanup\": { \"type\": \"boolean\", \"default\": false, \"description\": \"是否允许高风险清理配置（l0l1RetentionDays=1或2）\" },\n          \"cleanTime\": { \"type\": \"string\", \"default\": \"03:00\", \"description\": \"每日清理执行时间（HH:mm）\" }\n        }\n      },\n      \"extraction\": {\n        \"type\": \"object\",\n        \"description\": \"记忆提取设置 (L1)\",\n        \"properties\": {\n          \"enabled\": { \"type\": \"boolean\", \"default\": true, \"description\": \"是否启用后台提取\" },\n          \"enableDedup\": { \"type\": \"boolean\", \"default\": true, \"description\": \"L1 智能去重（基于向量相似度或关键词进行冲突检测）\" },\n          \"maxMemoriesPerSession\": { \"type\": \"number\", \"default\": 20, \"description\": \"单次 L1 提取每 session 最大记忆条数\" },\n          \"model\": { \"type\": \"string\", \"description\": \"提取使用模型 (格式: provider/model)，未填写时使用openclaw默认模型\" }\n        }\n      },\n      \"persona\": {\n        \"type\": \"object\",\n        \"description\": \"场景归纳与用户画像设置 (L2/L3)\",\n        \"properties\": {\n          \"triggerEveryN\": { \"type\": \"number\", \"default\": 50, \"description\": \"每 N 条新记忆触发画像生成\" },\n          \"maxScenes\": { \"type\": \"number\", \"default\": 15, \"description\": \"最大场景数\" },\n          \"backupCount\": { \"type\": \"number\", \"default\": 3, \"description\": \"画像备份保留数量\" },\n          \"sceneBackupCount\": { \"type\": \"number\", \"default\": 10, \"description\": \"场景块备份保留数量\" },\n          \"model\": { \"type\": \"string\", \"description\": \"画像生成模型 (格式: provider/model)，未填写时使用openclaw默认模型\" },\n          \"triggerMode\": { \"type\": \"string\", \"enum\": [\"current\", \"jev\"], \"default\": \"current\", \"description\": \"L3触发策略；jev在现有触发器未命中时判断是否立即同步\" },\n          \"jev\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"endpoint\": { \"type\": \"string\", \"description\": \"System One HTTPS endpoint\" },\n              \"apiKey\": { \"type\": \"string\", \"description\": \"JEV密钥；优先使用TYPESAFE_API_KEY环境变量\" },\n              \"model\": { \"type\": \"string\", \"description\": \"JEV模型或TokenHub服务ID\" },\n              \"timeoutMs\": { \"type\": \"number\", \"minimum\": 100, \"maximum\": 3000, \"default\": 3000 },\n              \"diagnostics\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"mode\": { \"type\": \"string\", \"enum\": [\"off\", \"metadata\", \"full\"], \"default\": \"off\" }\n                }\n              }\n            }\n          }\n        }\n      },\n      \"pipeline\": {\n        \"type\": \"object\",\n        \"description\": \"L1→L2→L3 管线调度设置\",\n        \"properties\": {\n          \"everyNConversations\": { \"type\": \"number\", \"default\": 5, \"description\": \"每 N 轮对话触发 L1 批处理\" },\n          \"enableWarmup\": { \"type\": \"boolean\", \"default\": true, \"description\": \"Warm-up 模式：新 session 从 1 轮触发开始，每次 L1 后翻倍（1→2→4→...→everyN），加速早期记忆提取\" },\n          \"l1IdleTimeoutSeconds\": { \"type\": \"number\", \"default\": 600, \"description\": \"L1 空闲超时（秒）：用户停止对话后多久触发 L1 批处理\" },\n          \"l2DelayAfterL1Seconds\": { \"type\": \"number\", \"default\": 10, \"description\": \"L1 完成后延迟多久触发 L2（秒）\" },\n          \"l2MinIntervalSeconds\": { \"type\": \"number\", \"default\": 900, \"description\": \"同一 session 两次 L2 抽取的最小间隔（秒）\" },\n          \"l2MaxIntervalSeconds\": { \"type\": \"number\", \"default\": 3600, \"description\": \"同一活跃 session 的 L2 最大轮询间隔（秒）\" },\n          \"sessionActiveWindowHours\": { \"type\": \"number\", \"default\": 24, \"description\": \"session 活跃窗口（小时），超过此时间不活跃的 session 停止 L2 轮询\" }\n        }\n      },\n      \"recall\": {\n        \"type\": \"object\",\n        \"description\": \"记忆召回设置\",\n        \"properties\": {\n          \"enabled\": { \"type\": \"boolean\", \"default\": true, \"description\": \"是否启用自动召回\" },\n          \"maxResults\": { \"type\": \"number\", \"default\": 5, \"description\": \"召回最大结果数\" },\n          \"maxCharsPerMemory\": { \"type\": \"number\", \"default\": 0, \"description\": \"单条 L1 记忆注入的最大字符数；填 0 表示不限制\" },\n          \"maxTotalRecallChars\": { \"type\": \"number\", \"default\": 0, \"description\": \"本轮 auto-recall 注入的 L1 记忆总字符预算；填 0 表示不限制\" },\n          \"scoreThreshold\": { \"type\": \"number\", \"default\": 0.3, \"description\": \"最低分数阈值\" },\n          \"strategy\": { \"type\": \"string\", \"enum\": [\"embedding\", \"keyword\", \"hybrid\"], \"default\": \"hybrid\", \"description\": \"搜索策略：keyword(关键词)、embedding(向量)、hybrid(混合RRF融合，推荐)\" },\n          \"timeoutMs\": { \"type\": \"number\", \"default\": 5000, \"description\": \"召回整体超时（毫秒），超时后跳过记忆注入并打印警告日志\" }\n        }\n      },\n      \"embedding\": {\n        \"type\": \"object\",\n        \"description\": \"向量搜索 (Embedding) 配置\",\n        \"properties\": {\n          \"enabled\": { \"type\": \"boolean\", \"default\": true, \"description\": \"是否启用向量搜索（若 provider=none，则实际会被禁用）\" },\n          \"provider\": { \"type\": \"string\", \"default\": \"none\", \"description\": \"Embedding 服务提供者：填写兼容 OpenAI API 的远端服务名称（如 openai、deepseek 等）；不填或填 none 则禁用向量搜索\" },\n          \"proxyUrl\": { \"type\": \"string\", \"description\": \"本地代理地址（仅 provider=qclaw 时必填）。配置后 embedding 请求将通过该代理转发，原始 baseUrl 作为 Remote-URL 头传递\" },\n          \"baseUrl\": { \"type\": \"string\", \"description\": \"API Base URL（必填）：填写对应 provider 的 API 地址\" },\n          \"apiKey\": { \"type\": \"string\", \"description\": \"API Key（必填）\" },\n          \"model\": { \"type\": \"string\", \"description\": \"模型名称（必填）\" },\n          \"dimensions\": { \"type\": \"number\", \"description\": \"向量维度（必填，需与所选模型匹配）\" },\n          \"sendDimensions\": { \"type\": \"boolean\", \"default\": true, \"description\": \"是否在请求体中携带 dimensions 字段。默认 true（兼容 OpenAI text-embedding-3-* 的 Matryoshka 截断）。当目标服务为 BGE-M3 等不支持自定义维度的固定维度模型时，请设为 false，否则会被服务端以 HTTP 400 拒绝（'does not support matryoshka representation'）。\" },\n          \"conflictRecallTopK\": { \"type\": \"number\", \"default\": 5, \"description\": \"冲突检测时召回 Top-K 数\" },\n          \"maxInputChars\": { \"type\": \"number\", \"default\": 5000, \"description\": \"Embedding 输入文本最大字符数，超出时截断并打印警告日志（默认 5000，适合大多数模型的 token 上限）\" },\n          \"timeoutMs\": { \"type\": \"number\", \"default\": 10000, \"description\": \"单次 embedding API 调用超时（毫秒），超时后该次请求中止且不重试\" },\n          \"recallTimeoutMs\": { \"type\": \"number\", \"description\": \"recall 路径 embedding 超时（毫秒），覆盖 timeoutMs。用户等待中，建议设短一些（如 3000）\" },\n          \"captureTimeoutMs\": { \"type\": \"number\", \"description\": \"capture 路径 embedding 超时（毫秒），覆盖 timeoutMs。后台运行，可设长一些（如 15000）\" }\n        }\n      },\n      \"tcvdb\": {\n        \"type\": \"object\",\n        \"description\": \"腾讯云向量数据库配置（仅 storeBackend=tcvdb 时生效）\",\n        \"properties\": {\n          \"url\": { \"type\": \"string\", \"description\": \"实例 URL（必填，如 http://10.0.1.1:8100）\" },\n          \"username\": { \"type\": \"string\", \"default\": \"root\", \"description\": \"账户名\" },\n          \"apiKey\": { \"type\": \"string\", \"description\": \"API Key（必填）\" },\n          \"database\": { \"type\": \"string\", \"description\": \"数据库名（未填写时默认根据实例 ID 自动生成）\" },\n          \"alias\": { \"type\": \"string\", \"description\": \"用户友好别名（可选，用于 database.json 中识别）\" },\n          \"embeddingModel\": { \"type\": \"string\", \"default\": \"bge-large-zh\", \"description\": \"服务端 embedding 模型\" },\n          \"timeout\": { \"type\": \"number\", \"default\": 10000, \"description\": \"请求超时（毫秒）\" },\n          \"caPemPath\": { \"type\": \"string\", \"description\": \"CA 证书 PEM 文件路径（HTTPS 连接时使用）\" }\n        }\n      },\n      \"bm25\": {\n        \"type\": \"object\",\n        \"description\": \"BM25 稀疏向量编码设置（主要用于 tcvdb 后端）\",\n        \"properties\": {\n          \"enabled\": { \"type\": \"boolean\", \"default\": true, \"description\": \"是否启用 BM25 稀疏向量编码\" },\n          \"language\": { \"type\": \"string\", \"enum\": [\"zh\", \"en\"], \"default\": \"zh\", \"description\": \"分词语言：zh（中文）或 en（英文）\" }\n        }\n      },\n      \"report\": {\n        \"type\": \"object\",\n        \"description\": \"指标上报设置\",\n        \"properties\": {\n          \"enabled\": { \"type\": \"boolean\", \"default\": false, \"description\": \"是否启用指标上报（通过 Gateway 日志输出结构化 METRIC JSON）\" },\n          \"type\": { \"type\": \"string\", \"default\": \"local\", \"description\": \"上报方式：local 表示通过 logger 输出结构化 JSON 日志\" }\n        }\n      },\n      \"llm\": {\n        \"type\": \"object\",\n        \"description\": \"独立 LLM 配置 — 开启后 L1/L2/L3 提取绕过 OpenClaw 的内置模型，改用指定的 OpenAI-compatible API 直接调用。默认关闭（使用 OpenClaw 宿主模型）。\",\n        \"properties\": {\n          \"enabled\": { \"type\": \"boolean\", \"default\": false, \"description\": \"是否启用独立 LLM 模式。关闭时使用 OpenClaw 宿主模型。\" },\n          \"baseUrl\": { \"type\": \"string\", \"default\": \"https://api.openai.com/v1\", \"description\": \"OpenAI-compatible API 地址\" },\n          \"apiKey\": { \"type\": \"string\", \"description\": \"API Key\" },\n          \"model\": { \"type\": \"string\", \"default\": \"gpt-4o\", \"description\": \"模型名称（如 gpt-4o, deepseek-v3, claude-sonnet-4-6）\" },\n          \"maxTokens\": { \"type\": \"number\", \"default\": 4096, \"description\": \"最大输出 token 数\" },\n          \"timeoutMs\": { \"type\": \"number\", \"default\": 120000, \"description\": \"请求超时（毫秒）\" },\n          \"stream\": { \"type\": \"boolean\", \"default\": false, \"description\": \"是否用流式请求(streamText)调用上游。默认 false(非流式)。个别只接受流式请求的 OpenAI 兼容上游需置 true。⚠️ 仅在启用独立 LLM(llm.enabled=true)时生效；未启用时走 OpenClaw host runner，此开关被忽略。\" }\n        }\n      },\n      \"offload\": {\n        \"type\": \"object\",\n        \"description\": \"Context Offload 设置 — 多层上下文压缩系统（独立开关，默认关闭）。支持 local（本地 LLM 处理）和 client（复用 server.url 远端服务）两种模式\",\n        \"properties\": {\n          \"enabled\": { \"type\": \"boolean\", \"default\": false, \"description\": \"是否启用 Context Offload（默认关闭，不影响 Memory 功能）\" },\n          \"mode\": { \"type\": \"string\", \"enum\": [\"local\", \"backend\", \"client\", \"collect\"], \"description\": \"Offload 运行模式：local（本地 LLM 处理）、backend（走 backendUrl 远端 v1 服务）、client（复用 server.url 远端 offload v2 服务）、collect（仅数据采集，不压缩）。未设置时自动推导：有 backendUrl → backend，有 server.url → client，否则 → local\" },\n          \"model\": { \"type\": \"string\", \"description\": \"【local 模式】Offload 使用的 LLM 模型（格式: provider/model），未填写时使用 openclaw 默认模型\" },\n          \"temperature\": { \"type\": \"number\", \"default\": 0.2, \"description\": \"【local 模式】LLM 温度参数\" },\n          \"stream\": { \"type\": \"boolean\", \"default\": false, \"description\": \"【仅 mode=local 生效】是否用流式请求(streamText)调用上游。默认 false(非流式)。个别只接受流式请求的 OpenAI 兼容上游需置 true。backend/client/collect 模式由远端 offload server 主导调用，此开关被忽略。\" },\n          \"forceTriggerThreshold\": { \"type\": \"number\", \"default\": 4, \"description\": \"【local 模式】累积多少个 tool pair 后强制触发 L1\" },\n          \"dataDir\": { \"type\": \"string\", \"description\": \"【local 模式】自定义数据目录（绝对路径），默认 ~/.openclaw/context-offload\" },\n          \"defaultContextWindow\": { \"type\": \"number\", \"default\": 200000, \"description\": \"默认上下文窗口大小\" },\n          \"maxPairsPerBatch\": { \"type\": \"number\", \"default\": 20, \"description\": \"【local 模式】L1 每批最大 tool pair 数\" },\n          \"l2NullThreshold\": { \"type\": \"number\", \"default\": 4, \"description\": \"【local 模式】offload.jsonl 中 node_id=null 数量达到此阈值时触发 L2\" },\n          \"l2TimeoutSeconds\": { \"type\": \"number\", \"default\": 300, \"description\": \"【local 模式】距上次 L2 超过此秒数时触发 L2\" },\n          \"mildOffloadRatio\": { \"type\": \"number\", \"default\": 0.5, \"description\": \"温和压缩触发比例（占 context window）\" },\n          \"aggressiveCompressRatio\": { \"type\": \"number\", \"default\": 0.85, \"description\": \"激进压缩触发比例\" },\n          \"mmdMaxTokenRatio\": { \"type\": \"number\", \"default\": 0.2, \"description\": \"【local 模式】MMD 注入 token 预算比例\" },\n          \"compactionRatio\": { \"type\": \"number\", \"default\": 0.5, \"description\": \"【client 模式】上下文占比超过此阈值时触发压缩（0-1），复用 server.url 作为后端地址\" },\n          \"ingestTimeoutMs\": { \"type\": \"number\", \"default\": 5000, \"description\": \"【client 模式】Ingest 请求超时（毫秒）\" },\n          \"compactionTimeoutMs\": { \"type\": \"number\", \"default\": 30000, \"description\": \"【client 模式】Compaction 请求超时（毫秒）\" },\n          \"backendUrl\": { \"type\": \"string\", \"description\": \"【已废弃，请使用 mode=client】后端服务 URL，配置后 L1/L1.5/L2/L4 走后端\" },\n          \"backendApiKey\": { \"type\": \"string\", \"description\": \"【已废弃，请使用 mode=client】后端 API 认证 token\" },\n          \"backendTimeoutMs\": { \"type\": \"number\", \"default\": 10000, \"description\": \"【已废弃，请使用 mode=client】后端调用超时（毫秒）\" }\n        }\n      }\n    }\n  }\n}\n</yakaai_skills>"}