{"id":"d1fd6c28-9b8a-4b36-9387-795c4dc283c4","entityType":"agent","slug":"clawhub-cloudcode-hans-local-tencentdb-agent-memory-flash","name":"local-tencentdb-agent-memory-flash","canonicalUrl":"https://www.xpersona.co/agent/clawhub-cloudcode-hans-local-tencentdb-agent-memory-flash","canonicalPath":"/agent/clawhub-cloudcode-hans-local-tencentdb-agent-memory-flash","generatedAt":"2026-10-11T14:12:57.453Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-11T09:44:52.809Z","emptyReason":null},"description":"本地部署零依赖的 TencentDB-Agent-Memory 插件，基于 SQLite 实现对话记忆的存储和召回，支持自动清理与上下文保护。 Skill: local-tencentdb-agent-memory-flash Owner: cloudcode-hans Summary: 本地部署零依赖的 TencentDB-Agent-Memory 插件，基于 SQLite 实现对话记忆的存储和召回，支持自动清理与上下文保护。 Tags: latest:1.0.1 Version history: v1.0.1 | 2026-05-22T03:05:22.687Z | user - 新增“安装检测”步骤，建议用户先检查是否已安装插件，避免重复安装。 - 优化使用指南结构，将安装与配置流程分离，提升易读性和适用性。 - 修改安装指引：已安装用户跳过安装步骤，直接引导至配置。 - 补充操作步骤说明，强调便捷检测和配置为核心流程。 - 其他内容与原有文档保持一致。 v1.0.0 | 2026-05-21T09:53:19.827Z | user Initial releas","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1.1K downloads reported by the source. Last updated 10/11/2026.","installCommand":"clawhub skill install s176p0fdnm9khs6p3rx9vvyds583j95x:local-tencentdb-agent-memory-flash","sourceUrl":"https://clawhub.ai/cloudcode-hans/local-tencentdb-agent-memory-flash","homepage":"https://clawhub.ai/cloudcode-hans/skills/local-tencentdb-agent-memory-flash","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/cloudcode-hans/local-tencentdb-agent-memory-flash","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/cloudcode-hans/skills/local-tencentdb-agent-memory-flash","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":61,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"本地部署零依赖的 TencentDB-Agent-Memory 插件，基于 SQLite 实现对话记忆的存储和召回，支持自动清理与上下文保护。 Skill: local-tencentdb-agent-memory-flash Owner: cloudcode-hans Summary: 本地部署零依赖的 Tencen"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-11T09:44:52.809Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T09:44:52.809Z","emptyReason":null},"stars":null,"forks":null,"downloads":1096,"packageName":null,"latestVersion":"1.0.1","tractionLabel":"1.1K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T09:44:52.752Z","emptyReason":null},"lastUpdatedAt":"2026-10-11T09:44:52.809Z","lastCrawledAt":"2026-10-11T09:44:52.752Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-12T09:44:52.752Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.1","createdAt":"2026-05-22T03:05:22.687Z","changelog":"- 新增“安装检测”步骤，建议用户先检查是否已安装插件，避免重复安装。 - 优化使用指南结构，将安装与配置流程分离，提升易读性和适用性。 - 修改安装指引：已安装用户跳过安装步骤，直接引导至配置。 - 补充操作步骤说明，强调便捷检测和配置为核心流程。 - 其他内容与原有文档保持一致。","fileCount":3,"zipByteSize":4772},{"version":"1.0.0","createdAt":"2026-05-21T09:53:19.827Z","changelog":"Initial release of local-tencentdb-agent-memory-flash. - Provides local memory plugin for OpenClaw using SQLite + sqlite-vec with zero external dependencies. - Simple installation and activation instructions with automatic configuration generation. - Includes advanced local configuration options for memory extraction, recall strategy, and embedding method. - Adds support for tool-call memory patch for improved logging of tool results. - Offers context protection settings to preserve important recent decisions in long conversations. - Troubleshooting guidance and suggestions for advanced customization (SOUL.md and USER.md).","fileCount":2,"zipByteSize":3191}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s176p0fdnm9khs6p3rx9vvyds583j95x:local-tencentdb-agent-memory-flash","setupComplexity":"low","setupSteps":["Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-cloudcode-hans-local-tencentdb-agent-memory-flash/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-cloudcode-hans-local-tencentdb-agent-memory-flash/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-cloudcode-hans-local-tencentdb-agent-memory-flash/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-cloudcode-hans-local-tencentdb-agent-memory-flash/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-cloudcode-hans-local-tencentdb-agent-memory-flash/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-cloudcode-hans-local-tencentdb-agent-memory-flash/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-11T14:12:57.452Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-cloudcode-hans-local-tencentdb-agent-memory-flash/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-cloudcode-hans-local-tencentdb-agent-memory-flash/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-cloudcode-hans-local-tencentdb-agent-memory-flash/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-cloudcode-hans-local-tencentdb-agent-memory-flash/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-11T09:44:52.809Z","emptyReason":null},"readme":"Skill: local-tencentdb-agent-memory-flash\n\nOwner: cloudcode-hans\n\nSummary: 本地部署零依赖的 TencentDB-Agent-Memory 插件，基于 SQLite 实现对话记忆的存储和召回，支持自动清理与上下文保护。\n\nTags: latest:1.0.1\n\nVersion history:\n\nv1.0.1 | 2026-05-22T03:05:22.687Z | user\n\n- 新增“安装检测”步骤，建议用户先检查是否已安装插件，避免重复安装。\n- 优化使用指南结构，将安装与配置流程分离，提升易读性和适用性。\n- 修改安装指引：已安装用户跳过安装步骤，直接引导至配置。\n- 补充操作步骤说明，强调便捷检测和配置为核心流程。\n- 其他内容与原有文档保持一致。\n\nv1.0.0 | 2026-05-21T09:53:19.827Z | user\n\nInitial release of local-tencentdb-agent-memory-flash.\n\n- Provides local memory plugin for OpenClaw using SQLite + sqlite-vec with zero external dependencies.\n- Simple installation and activation instructions with automatic configuration generation.\n- Includes advanced local configuration options for memory extraction, recall strategy, and embedding method.\n- Adds support for tool-call memory patch for improved logging of tool results.\n- Offers context protection settings to preserve important recent decisions in long conversations.\n- Troubleshooting guidance and suggestions for advanced customization (SOUL.md and USER.md).\n\nArchive index:\n\nArchive v1.0.1: 3 files, 4772 bytes\n\nFiles: _meta.json (153b), skill-card.md (2410b), skill.md (6237b)\n\nFile v1.0.1:skill.md\n\n# TencentDB-Agent-Memory 本地部署指南\n\n> **设计原则**：检测先行，避免重复安装。已安装则跳过安装步骤，直接进入配置阶段。\n\n---\n\n## 一、插件概述\n\n`tencentdb-agent-memory` 是腾讯云数据库团队开源的记忆插件，为 OpenClaw 提供对话记忆能力。采用本地 SQLite + sqlite-vec 后端，**零外部依赖、零配置**即可运行。\n\n---\n\n## 二、安装检测（必做）\n\n在执行任何安装操作之前，先检测插件是否已安装：\n\n```bash\nnpm list -g tencentdb-agent-memory 2>&1\n```\n\n**或者更快速地检查扩展目录：**\n```bash\nopenclaw plugins list 2>&1 | findstr memory-tencentdb\n```\n\n### 判断结果\n\n| 检测结果 | 含义 | 下一步 |\n|----------|------|--------|\n| `tencentdb-agent-memory@x.x.x` 有版本号 | ✅ 已安装 | → 直接进入 **第四节：配置阶段** |\n| `not found` 或空 | ❌ 未安装 | → 进入 **第三节：安装步骤** |\n\n---\n\n## 三、安装步骤（未安装时执行）\n\n### Step 1：安装插件\n\n```bash\nopenclaw plugins install @tencentdb-agent-memory/memory-tencentdb\n```\n\n预期输出：\n```\n下载并提取完成\n安装到 ~/.openclaw/extensions/memory-tencentdb\n依赖包已安装\n插件已注册 (memory-tdai)\n配置文件已更新（备份到 openclaw.json.bak）\n```\n\n### Step 2：重启 Gateway 生效\n\n```bash\nopenclaw gateway restart\n```\n\n等待 10~30 秒，确认 Gateway 状态恢复「运行中/健康」。\n\n> ⚠️ **已安装用户跳过以上两步，直接进入配置阶段。**\n\n---\n\n## 四、本地配置（零依赖模式）\n\n安装完成后，配置文件 `~/.openclaw/openclaw.json` 会自动生成基础配置：\n\n```json5\n{\n  \"memory-tencentdb\": {\n    \"enabled\": true\n  }\n}\n```\n\n### 推荐完整配置（优化召回质量）\n\n```json5\n{\n  \"memory-tencentdb\": {\n    \"enabled\": true,\n    \n    // 记忆提取配置\n    \"extraction\": {\n      \"enabled\": true,\n      \"enableDedup\": true,              // 防重复记忆\n      \"maxMemoriesPerSession\": 30,      // 单次对话最多存 30 条\n      \"model\": \"\"                        // 留空复用 OpenClaw 默认模型\n    },\n    \n    // 管线节奏\n    \"pipeline\": {\n      \"everyNConversations\": 3,         // 每 3 轮对话触发提炼\n      \"enableWarmup\": true,             // 新对话从第 1 轮开始\n      \"l1IdleTimeoutSeconds\": 60,       // 停嘴 60 秒后触发提炼\n      \"l2DelayAfterL1Seconds\": 120      // L1 完后 2 分钟归纳场景块\n    },\n    \n    // 召回配置（影响\"能不能想起\"）\n    \"recall\": {\n      \"enabled\": true,\n      \"strategy\": \"hybrid\",             // keyword + embedding 融合\n      \"maxResults\": 8,                  // 每次注入最多 8 条记忆\n      \"scoreThreshold\": 0.25,           // 阈值略调低，避免\"啥都想不起来\"\n      \"timeoutMs\": 5000\n    },\n    \n    // Embedding：本地用 BM25，资源充裕可配远端\n    \"embedding\": {\n      \"enabled\": true,\n      \"provider\": \"none\"                // 默认用 SQLite 内置 BM25\n      // 如需远端 Embedding，替换为：\n      // \"provider\": \"openai\",\n      // \"baseUrl\": \"https://your-embedding-endpoint/v1\",\n      // \"apiKey\": \"sk-xxx\",\n      // \"model\": \"text-embedding-3-small\",\n      // \"dimensions\": 1536\n    },\n    \n    // 自动清理旧日志\n    \"clean\": {\n      \"enabled\": true,\n      \"keepDays\": 30,                   // L0 原始日志保留 30 天\n      \"cleanTime\": \"03:00\"\n    }\n  }\n}\n```\n\n修改后重启生效：\n```bash\nopenclaw gateway restart\n```\n\n---\n\n## 五、关键补丁（工具调用支持）\n\n执行 patch 脚本确保工具调用结果能被正确记录：\n\n```bash\ncd ~/.openclaw/extensions/memory-tencentdb\nbash scripts/openclaw-after-tool-call-messages.patch.sh\nopenclaw gateway restart\n```\n\n> 如果脚本不存在（版本差异）可跳过，基础对话内容仍会正常记录。\n\n---\n\n## 六、上下文保护配置\n\n在 `openclaw.json` 中添加以下配置，防止长对话中近期决策被压缩覆盖：\n\n```json5\n{\n  \"agents\": {\n    \"defaults\": {\n      \"memoryFlush\": {\n        \"enabled\": true,\n        \"reserveTokensFloor\": 40000,\n        \"softThresholdTokens\": 4000\n      },\n      \"contextPruning\": {\n        \"mode\": \"cache-ttl\"\n      }\n    }\n  }\n}\n```\n\n---\n\n## 七、验证安装\n\n### 检查插件状态\n\n```bash\n# 查看插件列表\nopenclaw plugins list\n# 应显示 memory-tencentdb ✓ enabled\n\n# 查看 Gateway 状态\nopenclaw gateway status\n# 应显示 Gateway 健康\n```\n\n### 功能验证\n\n1. **训练阶段**：\n   ```\n   你：我叫阿杰，最讨厌回复里带emoji，我写代码只用FastAPI\n   （等待确认\"已记下\"）\n   ```\n\n2. **测试阶段**（新对话或重启后）：\n   ```\n   你：我叫什么？我用啥框架？我讨厌什么？\n   ```\n   \n   若能准确回答 → 记忆管线正常工作。\n\n---\n\n## 八、问题排查\n\n| 症状 | 解法 |\n|------|------|\n| npm 安装超时 | `npm config set registry https://registry.npmmirror.com` |\n| 权限报错 EACCES | 加 sudo 或使用 nvm 管理的 Node |\n| Gateway 重启后起不来 | `openclaw logs gateway` 或查看 `~/.openclaw/logs/` |\n| 记忆召回失败 | 检查配置中 `recall.enabled` 是否为 true |\n\n---\n\n## 九、进阶优化（可选）\n\n### Soul File 配置（让 Agent 更懂你）\n\n在 `~/.openclaw/workspace/` 下创建以下文件：\n\n**SOUL.md**（身份和原则）：\n```markdown\n## 身份\n你叫小龙虾，是我的个人 AI 助手。\n气质：干脆利落、不废话、有执行力。\n\n## 原则\n1. 不知道就说不知道，不编造\n2. 删除/发送/花钱类操作必须先确认\n3. 先给结果，再给过程\n4. 用户告知偏好时，回复确认\"已记下\"\n5. 用中文思考，回复口语化\n```\n\n**USER.md**（用户偏好）：\n```markdown\n## 基本信息\n- 名字：[你的名字]\n- 职业：[你的职业]\n- 常用技术栈：[技术栈]\n\n## 偏好\n- 回复风格：分点 > 段落，要可执行\n- 代码风格：[偏好的风格]\n```\n\n---\n\n**总结**：\n1. **先执行检测命令**判断是否已安装；\n2. **未安装**才执行 `openclaw plugins install`；\n3. 之后统一进入配置阶段。插件默认使用 SQLite 后端即可工作，通过调整 `recall` 和 `pipeline` 配置可优化记忆召回质量。\n\nFile v1.0.1:_meta.json\n\n{\n  \"ownerId\": \"kn76zmreha127n33hcnaknnmd5834x16\",\n  \"slug\": \"local-tencentdb-agent-memory-flash\",\n  \"version\": \"1.0.1\",\n  \"publishedAt\": 1779419122687\n}\n\nFile v1.0.1:skill-card.md\n\n## Description:\n\nGuides agents and users through local installation, configuration, validation, and troubleshooting of the TencentDB-Agent-Memory plugin for OpenClaw.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[cloudcode-hans](https://clawhub.ai/user/cloudcode-hans)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and OpenClaw users use this skill to decide whether the memory plugin is already installed, install it when needed, configure local SQLite-backed memory and recall behavior, and verify that persistent memory works.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill directs users to install an unpinned third-party OpenClaw plugin.\n\nMitigation: Install only after confirming trust in the publisher, prefer a pinned and verified package version, and review the package before deployment.\n\nRisk: The skill asks users to run a patch script that modifies OpenClaw behavior.\n\nMitigation: Inspect the patch script before running it, avoid elevated privileges, and confirm how to disable the plugin if behavior is unexpected.\n\nRisk: The memory plugin stores conversation content, preferences, and tool-call results persistently.\n\nMitigation: Confirm storage expectations before use and document how to delete stored memories and logs.\n\nRisk: Optional remote embedding configuration can send memory content to an external provider.\n\nMitigation: Use remote embeddings only when the provider and endpoint are approved for the data being stored.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/cloudcode-hans/skills/local-tencentdb-agent-memory-flash)\n- [Publisher profile](https://clawhub.ai/user/cloudcode-hans)\n\n## Skill Output:\n\n**Output Type(s):** [guidance, markdown, shell commands, configuration]\n\n**Output Format:** [Markdown with bash and JSON configuration snippets]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Includes installation checks, OpenClaw plugin commands, configuration examples, validation prompts, and troubleshooting guidance.]\n\n## Skill Version(s):\n\n1.0.1 (source: server release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nArchive v1.0.0: 2 files, 3191 bytes\n\nFiles: skill.md (5410b), _meta.json (153b)\n\nFile v1.0.0:skill.md\n\n# TencentDB-Agent-Memory 本地部署指南\n\n## 一、插件概述\n\n`tencentdb-agent-memory` 是腾讯云数据库团队开源的记忆插件，为 OpenClaw 提供对话记忆能力。采用本地 SQLite + sqlite-vec 后端，**零外部依赖、零配置**即可运行。\n\n---\n\n## 二、安装步骤\n\n### Step 1：安装插件\n\n```bash\nopenclaw plugins install @tencentdb-agent-memory/memory-tencentdb\n```\n\n预期输出：\n```\n下载并提取完成\n安装到 ~/.openclaw/extensions/memory-tencentdb\n依赖包已安装\n插件已注册 (memory-tdai)\n配置文件已更新（备份到 openclaw.json.bak）\n```\n\n### Step 2：重启 Gateway 生效\n\n```bash\nopenclaw gateway restart\n```\n\n等待 10~30 秒，确认 Gateway 状态恢复「运行中/健康」。\n\n---\n\n## 三、本地配置（零依赖模式）\n\n安装完成后，配置文件 `~/.openclaw/openclaw.json` 会自动生成基础配置：\n\n```json5\n{\n  \"memory-tencentdb\": {\n    \"enabled\": true\n  }\n}\n```\n\n### 推荐完整配置（优化召回质量）\n\n```json5\n{\n  \"memory-tencentdb\": {\n    \"enabled\": true,\n    \n    // 记忆提取配置\n    \"extraction\": {\n      \"enabled\": true,\n      \"enableDedup\": true,              // 防重复记忆\n      \"maxMemoriesPerSession\": 30,      // 单次对话最多存 30 条\n      \"model\": \"\"                        // 留空复用 OpenClaw 默认模型\n    },\n    \n    // 管线节奏\n    \"pipeline\": {\n      \"everyNConversations\": 3,         // 每 3 轮对话触发提炼\n      \"enableWarmup\": true,             // 新对话从第 1 轮开始\n      \"l1IdleTimeoutSeconds\": 60,       // 停嘴 60 秒后触发提炼\n      \"l2DelayAfterL1Seconds\": 120      // L1 完后 2 分钟归纳场景块\n    },\n    \n    // 召回配置（影响\"能不能想起\"）\n    \"recall\": {\n      \"enabled\": true,\n      \"strategy\": \"hybrid\",             // keyword + embedding 融合\n      \"maxResults\": 8,                  // 每次注入最多 8 条记忆\n      \"scoreThreshold\": 0.25,           // 阈值略调低，避免\"啥都想不起来\"\n      \"timeoutMs\": 5000\n    },\n    \n    // Embedding：本地用 BM25，资源充裕可配远端\n    \"embedding\": {\n      \"enabled\": true,\n      \"provider\": \"none\"                // 默认用 SQLite 内置 BM25\n      // 如需远端 Embedding，替换为：\n      // \"provider\": \"openai\",\n      // \"baseUrl\": \"https://your-embedding-endpoint/v1\",\n      // \"apiKey\": \"sk-xxx\",\n      // \"model\": \"text-embedding-3-small\",\n      // \"dimensions\": 1536\n    },\n    \n    // 自动清理旧日志\n    \"clean\": {\n      \"enabled\": true,\n      \"keepDays\": 30,                   // L0 原始日志保留 30 天\n      \"cleanTime\": \"03:00\"\n    }\n  }\n}\n```\n\n修改后重启生效：\n```bash\nopenclaw gateway restart\n```\n\n---\n\n## 四、关键补丁（工具调用支持）\n\n执行 patch 脚本确保工具调用结果能被正确记录：\n\n```bash\ncd ~/.openclaw/extensions/memory-tencentdb\nbash scripts/openclaw-after-tool-call-messages.patch.sh\nopenclaw gateway restart\n```\n\n> 如果脚本不存在（版本差异）可跳过，基础对话内容仍会正常记录。\n\n---\n\n## 五、上下文保护配置\n\n在 `openclaw.json` 中添加以下配置，防止长对话中近期决策被压缩覆盖：\n\n```json5\n{\n  \"agents\": {\n    \"defaults\": {\n      \"memoryFlush\": {\n        \"enabled\": true,\n        \"reserveTokensFloor\": 40000,\n        \"softThresholdTokens\": 4000\n      },\n      \"contextPruning\": {\n        \"mode\": \"cache-ttl\"\n      }\n    }\n  }\n}\n```\n\n---\n\n## 六、验证安装\n\n### 检查插件状态\n\n```bash\n# 查看插件列表\nopenclaw plugins list\n# 应显示 memory-tencentdb ✓ enabled\n\n# 查看 Gateway 状态\nopenclaw gateway status\n# 应显示 Gateway 健康\n```\n\n### 功能验证\n\n1. **训练阶段**：\n   ```\n   你：我叫阿杰，最讨厌回复里带emoji，我写代码只用FastAPI\n   （等待确认\"已记下\"）\n   ```\n\n2. **测试阶段**（新对话或重启后）：\n   ```\n   你：我叫什么？我用啥框架？我讨厌什么？\n   ```\n   \n   若能准确回答 → 记忆管线正常工作。\n\n---\n\n## 七、问题排查\n\n| 症状 | 解法 |\n|------|------|\n| npm 安装超时 | `npm config set registry https://registry.npmmirror.com` |\n| 权限报错 EACCES | 加 sudo 或使用 nvm 管理的 Node |\n| Gateway 重启后起不来 | `openclaw logs gateway` 或查看 `~/.openclaw/logs/` |\n| 记忆召回失败 | 检查配置中 `recall.enabled` 是否为 true |\n\n---\n\n## 八、进阶优化（可选）\n\n### Soul File 配置（让 Agent 更懂你）\n\n在 `~/.openclaw/workspace/` 下创建以下文件：\n\n**SOUL.md**（身份和原则）：\n```markdown\n## 身份\n你叫小龙虾，是我的个人 AI 助手。\n气质：干脆利落、不废话、有执行力。\n\n## 原则\n1. 不知道就说不知道，不编造\n2. 删除/发送/花钱类操作必须先确认\n3. 先给结果，再给过程\n4. 用户告知偏好时，回复确认\"已记下\"\n5. 用中文思考，回复口语化\n```\n\n**USER.md**（用户偏好）：\n```markdown\n## 基本信息\n- 名字：[你的名字]\n- 职业：[你的职业]\n- 常用技术栈：[技术栈]\n\n## 偏好\n- 回复风格：分点 > 段落，要可执行\n- 代码风格：[偏好的风格]\n```\n\n---\n\n**总结**：本地部署只需执行安装命令，插件默认使用 SQLite 后端即可工作。通过调整 `recall` 和 `pipeline` 配置可优化记忆召回质量，配合 Soul File 配置能让 Agent 更贴合个人需求。\n\nFile v1.0.0:_meta.json\n\n{\n  \"ownerId\": \"kn76zmreha127n33hcnaknnmd5834x16\",\n  \"slug\": \"local-tencentdb-agent-memory-flash\",\n  \"version\": \"1.0.0\",\n  \"publishedAt\": 1779357199827\n}","readmeExcerpt":"Skill: local-tencentdb-agent-memory-flash Owner: cloudcode-hans Summary: 本地部署零依赖的 TencentDB-Agent-Memory 插件，基于 SQLite 实现对话记忆的存储和召回，支持自动清理与上下文保护。 Tags: latest:1.0.1 Version history: v1.0.1 | 2026-05-22T03:05:22.687Z | user - 新增“安装检测”步骤，建议用户先检查是否已安装插件，避免重复安装。 - 优化使用指南结构，将安装与配置流程分离，提升易读性和适用性。 - 修改安装指引：已安装用户跳过安装步骤，直接引导至配置。 - 补充操作步骤说明，强调便捷检测和配置为核心流程。 - 其他内容与原有文档保持一致。 v1.0.0 | 2026-05-21T09:53:19.827Z | user Initial releas","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"npm list -g tencentdb-agent-memory 2>&1"},{"language":"bash","snippet":"openclaw plugins list 2>&1 | findstr memory-tencentdb"},{"language":"bash","snippet":"openclaw plugins install @tencentdb-agent-memory/memory-tencentdb"},{"language":"text","snippet":"下载并提取完成\n安装到 ~/.openclaw/extensions/memory-tencentdb\n依赖包已安装\n插件已注册 (memory-tdai)\n配置文件已更新（备份到 openclaw.json.bak）"},{"language":"bash","snippet":"openclaw gateway restart"},{"language":"json5","snippet":"{\n  \"memory-tencentdb\": {\n    \"enabled\": true\n  }\n}"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"skill.md","content":"# TencentDB-Agent-Memory 本地部署指南\n\n> **设计原则**：检测先行，避免重复安装。已安装则跳过安装步骤，直接进入配置阶段。\n\n---\n\n## 一、插件概述\n\n`tencentdb-agent-memory` 是腾讯云数据库团队开源的记忆插件，为 OpenClaw 提供对话记忆能力。采用本地 SQLite + sqlite-vec 后端，**零外部依赖、零配置**即可运行。\n\n---\n\n## 二、安装检测（必做）\n\n在执行任何安装操作之前，先检测插件是否已安装：\n\n```bash\nnpm list -g tencentdb-agent-memory 2>&1\n```\n\n**或者更快速地检查扩展目录：**\n```bash\nopenclaw plugins list 2>&1 | findstr memory-tencentdb\n```\n\n### 判断结果\n\n| 检测结果 | 含义 | 下一步 |\n|----------|------|--------|\n| `tencentdb-agent-memory@x.x.x` 有版本号 | ✅ 已安装 | → 直接进入 **第四节：配置阶段** |\n| `not found` 或空 | ❌ 未安装 | → 进入 **第三节：安装步骤** |\n\n---\n\n## 三、安装步骤（未安装时执行）\n\n### Step 1：安装插件\n\n```bash\nopenclaw plugins install @tencentdb-agent-memory/memory-tencentdb\n```\n\n预期输出：\n```\n下载并提取完成\n安装到 ~/.openclaw/extensions/memory-tencentdb\n依赖包已安装\n插件已注册 (memory-tdai)\n配置文件已更新（备份到 openclaw.json.bak）\n```\n\n### Step 2：重启 Gateway 生效\n\n```bash\nopenclaw gateway restart\n```\n\n等待 10~30 秒，确认 Gateway 状态恢复「运行中/健康」。\n\n> ⚠️ **已安装用户跳过以上两步，直接进入配置阶段。**\n\n---\n\n## 四、本地配置（零依赖模式）\n\n安装完成后，配置文件 `~/.openclaw/openclaw.json` 会自动生成基础配置：\n\n```json5\n{\n  \"memory-tencentdb\": {\n    \"enabled\": true\n  }\n}\n```\n\n### 推荐完整配置（优化召回质量）\n\n```json5\n{\n  \"memory-tencentdb\": {\n    \"enabled\": true,\n    \n    // 记忆提取配置\n    \"extraction\": {\n      \"enabled\": true,\n      \"enableDedup\": true,              // 防重复记忆\n      \"maxMemoriesPerSession\": 30,      // 单次对话最多存 30 条\n      \"model\": \"\"                        // 留空复用 OpenClaw 默认模型\n    },\n    \n    // 管线节奏\n    \"pipeline\": {\n      \"everyNConversations\": 3,         // 每 3 轮对话触发提炼\n      \"enableWarmup\": true,             // 新对话从第 1 轮开始\n      \"l1IdleTimeoutSeconds\": 60,       // 停嘴 60 秒后触发提炼\n      \"l2DelayAfterL1Seconds\": 120      // L1 完后 2 分钟归纳场景块\n    },\n    \n    // 召回配置（影响\"能不能想起\"）\n    \"recall\": {\n      \"enabled\": true,\n      \"strategy\": \"hybrid\",             // keyword + embedding 融合\n      \"maxResults\": 8,                  // 每次注入最多 8 条记忆\n      \"scoreThreshold\": 0.25,           // 阈值略调低，避免\"啥都想不起来\"\n      \"timeoutMs\": 5000\n    },\n    \n    // Embedding：本地用 BM25，资源充裕可配远端\n    \"embedding\": {\n      \"enabled\": true,\n      \"provider\": \"none\"                // 默认用 SQLite 内置 BM25\n      // 如需远端 Embedding，替换为：\n      // \"provider\": \"openai\",\n      // \"baseUrl\": \"https://your-embedding-endpoint/v1\",\n      // \"apiKey\": \"sk-xxx\",\n      // \"model\": \"text-embedding-3-small\",\n      // \"dimensions\": 1536\n    },\n    \n    // 自动清理旧日志\n    \"clean\": {\n      \"enabled\": true,\n      \"keepDays\": 30,                   // L0 原始日志保留 30 天\n      \"cleanTime\": \"03:00\"\n    }\n  }\n}\n```\n\n修改后重启生效：\n```bash\nopenclaw gateway restart\n```\n\n---\n\n## 五、关键补丁（工具调用支持）\n\n执行 patch 脚本确保工具调用结果能被正确记录：\n\n```bash\ncd ~/.openclaw/extensions/memory-tencentdb\nbash scripts/openclaw-after-tool-call-messages.patch.sh\nopenclaw gateway restart\n```\n\n> 如果脚本不存在（版本差异）可跳过，基础对话内容仍会正常记录。\n\n---\n\n## 六、上下文保护配置\n\n在 `openclaw.json` 中添加以下配置，防止长对话中近期决策被压缩覆盖：\n\n```json5\n{\n  \"agents\": {\n    \"defaults\": {\n      \"memoryFlush\": {\n        \"enabled\": true,\n        \"reserveTokensFloor\": 40000,\n        \"softThresholdTokens\": 4000\n      },\n      \"contextPruning\""},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn76zmreha127n33hcnaknnmd5834x16\",\n  \"slug\": \"local-tencentdb-agent-memory-flash\",\n  \"version\": \"1.0.1\",\n  \"publishedAt\": 1779419122687\n}"},{"path":"skill-card.md","content":"## Description:\n\nGuides agents and users through local installation, configuration, validation, and troubleshooting of the TencentDB-Agent-Memory plugin for OpenClaw.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[cloudcode-hans](https://clawhub.ai/user/cloudcode-hans)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and OpenClaw users use this skill to decide whether the memory plugin is already installed, install it when needed, configure local SQLite-backed memory and recall behavior, and verify that persistent memory works.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill directs users to install an unpinned third-party OpenClaw plugin.\n\nMitigation: Install only after confirming trust in the publisher, prefer a pinned and verified package version, and review the package before deployment.\n\nRisk: The skill asks users to run a patch script that modifies OpenClaw behavior.\n\nMitigation: Inspect the patch script before running it, avoid elevated privileges, and confirm how to disable the plugin if behavior is unexpected.\n\nRisk: The memory plugin stores conversation content, preferences, and tool-call results persistently.\n\nMitigation: Confirm storage expectations before use and document how to delete stored memories and logs.\n\nRisk: Optional remote embedding configuration can send memory content to an external provider.\n\nMitigation: Use remote embeddings only when the provider and endpoint are approved for the data being stored.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/cloudcode-hans/skills/local-tencentdb-agent-memory-flash)\n- [Publisher profile](https://clawhub.ai/user/cloudcode-hans)\n\n## Skill Output:\n\n**Output Type(s):** [guidance, markdown, shell commands, configuration]\n\n**Output Format:** [Markdown with bash and JSON configuration snippets]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Includes installation checks, OpenClaw plugin commands, configuration examples, validation prompts, and troubleshooting guidance.]\n\n## Skill Version(s):\n\n1.0.1 (source: server release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment."}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"本地部署零依赖的 TencentDB-Agent-Memory 插件，基于 SQLite 实现对话记忆的存储和召回，支持自动清理与上下文保护。 Skill: local-tencentdb-agent-memory-flash Owner: cloudcode-hans Summary: 本地部署零依赖的 TencentDB-Agent-Memory 插件，基于 SQLite 实现对话记忆的存储和召回，支持自动清理与上下文保护。 Tags: latest:1.0.1 Version history: v1.0.1 | 2026-05-22T03:05:22.687Z | user - 新增“安装检测”步骤，建议用户先检查是否已安装插件，避免重复安装。 - 优化使用指南结构，将安装与配置流程分离，提升易读性和适用性。 - 修改安装指引：已安装用户跳过安装步骤，直接引导至配置。 - 补充操作步骤说明，强调便捷检测和配置为核心流程。 - 其他内容与原有文档保持一致。 v1.0.0 | 2026-05-21T09:53:19.827Z | user Initial releas","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":801,"uniquenessScore":56,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-11T09:44:52.809Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-11T09:44:52.809Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-11T14:12:57.453Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}