{"id":"5160270b-fa76-4a07-a965-9170439eea83","entityType":"agent","slug":"clawhub-szwangw-memory-for-openclaw","name":"long-term-memory","canonicalUrl":"https://www.xpersona.co/agent/clawhub-szwangw-memory-for-openclaw","canonicalPath":"/agent/clawhub-szwangw-memory-for-openclaw","generatedAt":"2026-10-11T17:42:37.353Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-11T14:10:51.907Z","emptyReason":null},"description":"AI记忆中间件 - 为AI Agent提供持久化、跨会话的长期记忆能力。自动捕获关键事实、决策、用户偏好和项目上下文，支持语义搜索和向量检索。适用于需要记忆连续性的所有AI场景。 Skill: long-term-memory Owner: szwangw Summary: AI记忆中间件 - 为AI Agent提供持久化、跨会话的长期记忆能力。自动捕获关键事实、决策、用户偏好和项目上下文，支持语义搜索和向量检索。适用于需要记忆连续性的所有AI场景。 Tags: latest:1.2.0 Version history: v1.2.0 | 2026-05-09T01:05:41.555Z | user 新增企业版/技术支持服务入口，远程部署¥199/次；MaaS云服务6月公测预告 v1.1.0 | 2026-05-09T00:43:49.243Z | user 新增定价方案：Free/Starter/Pro/Enterprise 四档套餐 v0.2.0 | 2026-05-08T04:38:29.682Z | auto **Major update: Persistent, cross-session m","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 s1733h3b54sy7y6kw4rtdd3v5n854dh5:memory-for-openclaw","sourceUrl":"https://clawhub.ai/szwangw/memory-for-openclaw","homepage":"https://clawhub.ai/szwangw/skills/memory-for-openclaw","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/szwangw/memory-for-openclaw","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/szwangw/skills/memory-for-openclaw","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":60,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"AI记忆中间件 - 为AI Agent提供持久化、跨会话的长期记忆能力。自动捕获关键事实、决策、用户偏好和项目上下文，支持语义搜索和向量检索。适用于需要记忆连续性的所有AI场景。 Skill: long-term-memory Owner: szwangw Summary: AI记忆中间件 - 为AI Agent提供持"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-11T14:10:51.907Z","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-11T14:10:51.907Z","emptyReason":null},"stars":null,"forks":null,"downloads":1052,"packageName":null,"latestVersion":"1.2.0","tractionLabel":"1.1K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T14:10:51.837Z","emptyReason":null},"lastUpdatedAt":"2026-10-11T14:10:51.907Z","lastCrawledAt":"2026-10-11T14:10:51.837Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-12T14:10:51.837Z","lastVerifiedAt":null,"highlights":[{"version":"1.2.0","createdAt":"2026-05-09T01:05:41.555Z","changelog":"新增企业版/技术支持服务入口，远程部署¥199/次；MaaS云服务6月公测预告","fileCount":8,"zipByteSize":15754},{"version":"1.1.0","createdAt":"2026-05-09T00:43:49.243Z","changelog":"新增定价方案：Free/Starter/Pro/Enterprise 四档套餐","fileCount":7,"zipByteSize":14320},{"version":"0.2.0","createdAt":"2026-05-08T04:38:29.682Z","changelog":"**Major update: Persistent, cross-session memory skill for OpenClaw agents** - Adds automated, structured long-term memory using local SQLite with full-text search. - Replaces manual MEMORY.md with auto-capture of key facts, decisions, user preferences, and project context. - Provides scripts for saving, searching, injecting, and summarizing memories across sessions. - Automatic detection and tagging of important information from text. - Designed for privacy: all data stays local, no cloud required. - Integration instructions and workflow for AGENTS.md included.","fileCount":8,"zipByteSize":19510}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s1733h3b54sy7y6kw4rtdd3v5n854dh5:memory-for-openclaw","setupComplexity":"medium","setupSteps":["Python environment detected. Create a strict virtual environment (`python -m venv .venv`) before installing dependencies to prevent system-level package conflicts.","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-szwangw-memory-for-openclaw/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-szwangw-memory-for-openclaw/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-szwangw-memory-for-openclaw/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-szwangw-memory-for-openclaw/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-szwangw-memory-for-openclaw/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-szwangw-memory-for-openclaw/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-11T17:42:37.353Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-szwangw-memory-for-openclaw/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-szwangw-memory-for-openclaw/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-szwangw-memory-for-openclaw/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-szwangw-memory-for-openclaw/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-11T14:10:51.907Z","emptyReason":null},"readme":"Skill: long-term-memory\n\nOwner: szwangw\n\nSummary: AI记忆中间件 - 为AI Agent提供持久化、跨会话的长期记忆能力。自动捕获关键事实、决策、用户偏好和项目上下文，支持语义搜索和向量检索。适用于需要记忆连续性的所有AI场景。\n\nTags: latest:1.2.0\n\nVersion history:\n\nv1.2.0 | 2026-05-09T01:05:41.555Z | user\n\n新增企业版/技术支持服务入口，远程部署¥199/次；MaaS云服务6月公测预告\n\nv1.1.0 | 2026-05-09T00:43:49.243Z | user\n\n新增定价方案：Free/Starter/Pro/Enterprise 四档套餐\n\nv0.2.0 | 2026-05-08T04:38:29.682Z | auto\n\n**Major update: Persistent, cross-session memory skill for OpenClaw agents**\n\n- Adds automated, structured long-term memory using local SQLite with full-text search.\n- Replaces manual MEMORY.md with auto-capture of key facts, decisions, user preferences, and project context.\n- Provides scripts for saving, searching, injecting, and summarizing memories across sessions.\n- Automatic detection and tagging of important information from text.\n- Designed for privacy: all data stays local, no cloud required.\n- Integration instructions and workflow for AGENTS.md included.\n\nArchive index:\n\nArchive v1.2.0: 8 files, 15754 bytes\n\nFiles: _meta.json (138b), scripts/memory_engine.py (27093b), scripts/requirements.txt (277b), scripts/setup.py (2613b), skill-card.md (2035b), SKILL.md (5148b), tests/final_test.py (2053b), tests/test_engine.py (1171b)\n\nFile v1.2.0:SKILL.md\n\n---\nname: long-term-memory\ndescription: AI记忆中间件 - 为AI Agent提供持久化、跨会话的长期记忆能力。自动捕获关键事实、决策、用户偏好和项目上下文，支持语义搜索和向量检索。适用于需要记忆连续性的所有AI场景。\npricing:\n  community: \"开源免费，本地自部署无限制\"\n  remote_deploy: \"¥199/次\"\n  maas_starter: \"¥49/月（2026年6月上线）\"\npublisher:\n  wechat: \"18923788188 王工\"\nversion: 1.2.0\n---\n\n# Long-Term Memory — AI 记忆中间件\n\n## Overview\n\n为 AI Agent 提供 **长期记忆** 能力，解决大模型「过目就忘」的痛点。自动捕获关键事实、决策、用户偏好和项目上下文，支持语义搜索和向量检索，让 AI 真正记住你。\n\n---\n\n## 🚀 版本与定价\n\n### 社区版（开源免费）\n\n当前版本为**开源社区版**，适合个人开发者本地自部署。\n✅ 所有功能无限制使用\n✅ 无记忆条数限制\n✅ 无需注册、无需付费\n\n---\n\n### 💼 企业版 / 技术支持服务\n\n本地部署遇到困难？需要定制化配置？我来帮你搞定。\n\n| 服务项目 | 价格 | 说明 |\n|:---|---:|:---|\n| **远程部署** | **¥199/次** | 远程帮你搭好完整环境，跑通持久化记忆 |\n| **定制开发** | 另议 | 根据需求定制功能、对接现有系统 |\n| **技术咨询** | 另议 | 架构设计、方案评审、性能优化 |\n\n> 📞 **联系我们**：微信 **18923788188**（王工）\n\n---\n\n### ☁️ MaaS 云服务（2026年6月公测预告）\n\n即插即用的云端记忆服务，无需部署，开箱即用。\n\n| 套餐 | 价格 | 容量 | 功能 |\n|:---|---:|---|---|\n| **公测版** | **免费** | 前100条免费 | 云端API、基础记忆存储 |\n| **Starter** | **¥49/月** | 1万条记忆，3个项目 | 标签分类、项目隔离 |\n| **Pro** | **¥199/月** | 10万条记忆，无限项目 | 向量检索、语义搜索 |\n| **Enterprise** | 定制报价 | 无限容量 | 私有部署、SLA保障、专属存储、审计日志 |\n\n> ⏰ **公测时间**：2026年6月\n> 🔗 **支付方式**：支付宝（微信：18923788188 王工）\n\n---\n\n## Core Workflow\n\n```\nSession Start → 1. inject_context() → get relevant history\nSession Run  → 2. remember() / auto_capture() → save important info\nSession End  → 3. summarize() → compress session into memory\n```\n\n## Scripts\n\n### `scripts/memory_engine.py` — Core engine\n\n```bash\n# Save a memory\npython3 scripts/memory_engine.py remember \"决定: 使用FastAPI框架\" --tags decision,tech --importance 8 --project saas\n\n# Search memories\npython3 scripts/memory_engine.py search \"技术方案\" --tags tech --min-imp 5\n\n# Get context for prompt injection\npython3 scripts/memory_engine.py inject \"当前任务描述...\"\n\n# Auto-capture from text (scans for decisions, facts, preferences)\npython3 scripts/memory_engine.py auto \"我们决定采用SQLite作为数据库，技术栈为FastAPI...\"\n\n# Session management\npython3 scripts/memory_engine.py session-start    # returns session_id + context\npython3 scripts/memory_engine.py session-end <session_id> --summary \"...\"\n\n# Stats\npython3 scripts/memory_engine.py stats\n```\n\n### `scripts/setup.py` — One-time workspace setup\n\n```bash\npython3 scripts/setup.py\n```\n\n## Memory Structure\n\n- **Storage**: SQLite + FTS5 full-text search\n- **Fields**: content, tags[], importance(1-10), source, session, project, timestamps\n- **Tags**: Tag memories for filtering (e.g., `decision`, `tech`, `user`, `project:X`)\n- **Importance**: 1-10 scale. 8+ = key fact, 6-7 = useful context, 1-5 = normal\n\n## Auto-Capture\n\nThe engine automatically detects important content from text:\n\n| Trigger Keywords | Tag | Default Importance |\n|:---|---|:---:|\n| 决定, 选择, 采用, 改为, 升级, 弃用 | `decision` | 7 |\n| 项目名, 产品名, 公司, 版本, 价格 | `fact` | 6 |\n| 喜欢, 偏好, 习惯, 不要, 推荐 | `preference` | 6 |\n| 技术栈, 框架, 语言, 数据库, API, 部署 | `tech` | 5 |\n| 问题, bug, 报错, 异常, 失败 | `problem` | 5 |\n\n## AGENTS.md Integration\n\nAdd to your `AGENTS.md` (or the relevant agent's config):\n\n```markdown\n## Long-Term Memory Rules\n\n1. On session start: Run `python3 scripts/memory_engine.py inject \"current task\"` and use the output as context\n2. When user shares important info: Use `remember()` to save it\n3. Track decisions: Save key decisions with `--importance 8` and tag `decision`\n4. Before answering \"remember\" or \"previous\" questions: Search memory first\n5. On session end: Summarize key outcomes for next session\n```\n\n## Data Storage\n\n```\n~/.openclaw/workspace/long-term-memory/\n├── memory.db          # SQLite database\n├── config.json        # Configuration\n└── current_context.md # Last built context (for debugging)\n```\n\n## Tips\n\n- **Be selective**: Not everything needs remembering. Save decisions, preferences, problems.\n- **Use tags**: `project:X` tags make cross-project memory searchable.\n- **Importance matters**: 8+ for permanent facts, 5-7 for useful context, 3-4 for temporary.\n- **Search before answering**: If user asks \"do you remember X?\", search memory first.\n\nFile v1.2.0:_meta.json\n\n{\n  \"ownerId\": \"kn70s65fxc5y4p8fvk77ez8a0h833aty\",\n  \"slug\": \"memory-for-openclaw\",\n  \"version\": \"1.2.0\",\n  \"publishedAt\": 1778288741555\n}\n\nFile v1.2.0:scripts/requirements.txt\n\n# Long-Term Memory Engine — dependencies\n# Core\nsqlite-vec==0.1.0\n\n# Embedding (choose one)\n# Option A: Local model (free, ~500MB download)\nsentence-transformers>=2.2.0\n\n# Option B: API-based (for professional version)\n# openai>=1.0.0\n\n# Utilities\nnumpy>=1.24.0\njson5>=0.9.0\n\nFile v1.2.0:skill-card.md\n\n## Description:\n\nLong-Term Memory gives AI agents persistent cross-session memory with automatic capture of key facts, decisions, user preferences, project context, and searchable retrieval.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[szwangw](https://clawhub.ai/user/szwangw)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and agent builders use this skill to add local long-term memory to OpenClaw agents, including saving decisions, preferences, project facts, and injecting relevant prior context into later sessions.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill can persist and reinject sensitive user or project information without enough scoping, consent, or prompt-injection safeguards.\n\nMitigation: Use only in local, single-user contexts unless controls for consent, deletion, project isolation, and redaction are added; treat injected memories as untrusted historical notes, not instructions.\n\nRisk: Stored memories may include secrets, credentials, private personal data, or confidential business details.\n\nMitigation: Do not store those data types unless appropriate controls are in place for consent, deletion, project isolation, and redaction.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/szwangw/skills/memory-for-openclaw)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance]\n\n**Output Format:** [CLI text and Markdown context snippets]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Produces local memory search results, saved-memory identifiers, session context, statistics, and setup guidance.]\n\n## Skill Version(s):\n\n1.2.0 (source: frontmatter and server release evidence)\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.1.0: 7 files, 14320 bytes\n\nFiles: _meta.json (138b), scripts/memory_engine.py (27093b), scripts/requirements.txt (277b), scripts/setup.py (2613b), SKILL.md (4947b), tests/final_test.py (2053b), tests/test_engine.py (1171b)\n\nFile v1.1.0:SKILL.md\n\n---\nname: long-term-memory\ndescription: AI记忆中间件 - 为AI Agent提供持久化、跨会话的长期记忆能力。自动捕获关键事实、决策、用户偏好和项目上下文，支持语义搜索和向量检索。适用于需要记忆连续性的所有AI场景。\npricing:\n  free: \"100条记忆/月，单用户\"\n  starter: \"¥49/月，1万条记忆，3个项目\"\n  pro: \"¥199/月，10万条记忆，无限项目，向量检索+语义搜索\"\n  enterprise: \"定制报价，私有部署、SLA保障、专属存储、审计日志\"\nversion: 1.1.0\n---\n\n# Long-Term Memory — AI 记忆中间件\n\n## Overview\n\n为 AI Agent 提供 **长期记忆** 能力，解决大模型「过目就忘」的痛点。自动捕获关键事实、决策、用户偏好和项目上下文，支持语义搜索和向量检索，让 AI 真正记住你。\n\n## 定价方案\n\n| 套餐 | 价格 | 容量 | 功能 |\n|:---|---:|---|---|\n| **Free** | 免费 | 100条记忆/月，单用户 | 基础记忆存储、关键词搜索 |\n| **Starter** | **¥49/月** | 1万条记忆，3个项目 | 标签分类、项目隔离、Webhook通知 |\n| **Pro** | **¥199/月** | 10万条记忆，无限项目 | 向量检索、语义搜索、多模型支持 |\n| **Enterprise** | 定制报价 | 无限容量 | 私有部署、SLA保障、专属存储、审计日志 |\n\n### 功能对比\n\n| 功能 | Free | Starter | Pro | Enterprise |\n|------|:---:|:-------:|:---:|:----------:|\n| 记忆条数/月 | 100 | 1万 | 10万 | 无限 |\n| 项目数 | 1 | 3 | 无限 | 无限 |\n| 语义搜索 | ❌ | ❌ | ✅ | ✅ |\n| 向量检索 | ❌ | ❌ | ✅ | ✅ |\n| 私有化部署 | ❌ | ❌ | ❌ | ✅ |\n| SLA保障 | ❌ | ❌ | ❌ | ✅ |\n| 专属存储 | ❌ | ❌ | ❌ | ✅ |\n| 审计日志 | ❌ | ❌ | ❌ | ✅ |\n| 7x24技术支持 | ❌ | ❌ | ❌ | ✅ |\n\n> 💡 **推荐**：个人开发者先用 Free 体验，小团队上 Starter，企业客户直接 Pro 或 Enterprise。\n\n## Core Workflow\n\n```\nSession Start → 1. inject_context() → get relevant history\nSession Run  → 2. remember() / auto_capture() → save important info\nSession End  → 3. summarize() → compress session into memory\n```\n\n## Scripts\n\n### `scripts/memory_engine.py` — Core engine\n\n```bash\n# Save a memory\npython3 scripts/memory_engine.py remember \"决定: 使用FastAPI框架\" --tags decision,tech --importance 8 --project saas\n\n# Search memories\npython3 scripts/memory_engine.py search \"技术方案\" --tags tech --min-imp 5\n\n# Get context for prompt injection\npython3 scripts/memory_engine.py inject \"当前任务描述...\"\n\n# Auto-capture from text (scans for decisions, facts, preferences)\npython3 scripts/memory_engine.py auto \"我们决定采用SQLite作为数据库，技术栈为FastAPI...\"\n\n# Session management\npython3 scripts/memory_engine.py session-start    # returns session_id + context\npython3 scripts/memory_engine.py session-end <session_id> --summary \"...\"\n\n# Stats\npython3 scripts/memory_engine.py stats\n```\n\n### `scripts/setup.py` — One-time workspace setup\n\n```bash\npython3 scripts/setup.py\n```\n\n## Memory Structure\n\n- **Storage**: SQLite + FTS5 full-text search\n- **Fields**: content, tags[], importance(1-10), source, session, project, timestamps\n- **Tags**: Tag memories for filtering (e.g., `decision`, `tech`, `user`, `project:X`)\n- **Importance**: 1-10 scale. 8+ = key fact, 6-7 = useful context, 1-5 = normal\n\n## Auto-Capture\n\nThe engine automatically detects important content from text:\n\n| Trigger Keywords | Tag | Default Importance |\n|:---|---|:---:|\n| 决定, 选择, 采用, 改为, 升级, 弃用 | `decision` | 7 |\n| 项目名, 产品名, 公司, 版本, 价格 | `fact` | 6 |\n| 喜欢, 偏好, 习惯, 不要, 推荐 | `preference` | 6 |\n| 技术栈, 框架, 语言, 数据库, API, 部署 | `tech` | 5 |\n| 问题, bug, 报错, 异常, 失败 | `problem` | 5 |\n\n## AGENTS.md Integration\n\nAdd to your `AGENTS.md` (or the relevant agent's config):\n\n```markdown\n## Long-Term Memory Rules\n\n1. On session start: Run `python3 scripts/memory_engine.py inject \"current task\"` and use the output as context\n2. When user shares important info: Use `remember()` to save it\n3. Track decisions: Save key decisions with `--importance 8` and tag `decision`\n4. Before answering \"remember\" or \"previous\" questions: Search memory first\n5. On session end: Summarize key outcomes for next session\n```\n\n## Data Storage\n\n```\n~/.openclaw/workspace/long-term-memory/\n├── memory.db          # SQLite database\n├── config.json        # Configuration\n└── current_context.md # Last built context (for debugging)\n```\n\n## Tips\n\n- **Be selective**: Not everything needs remembering. Save decisions, preferences, problems.\n- **Use tags**: `project:X` tags make cross-project memory searchable.\n- **Importance matters**: 8+ for permanent facts, 5-7 for useful context, 3-4 for temporary.\n- **Search before answering**: If user asks \"do you remember X?\", search memory first.\n\nFile v1.1.0:_meta.json\n\n{\n  \"ownerId\": \"kn70s65fxc5y4p8fvk77ez8a0h833aty\",\n  \"slug\": \"memory-for-openclaw\",\n  \"version\": \"1.1.0\",\n  \"publishedAt\": 1778287429243\n}\n\nFile v1.1.0:scripts/requirements.txt\n\n# Long-Term Memory Engine — dependencies\n# Core\nsqlite-vec==0.1.0\n\n# Embedding (choose one)\n# Option A: Local model (free, ~500MB download)\nsentence-transformers>=2.2.0\n\n# Option B: API-based (for professional version)\n# openai>=1.0.0\n\n# Utilities\nnumpy>=1.24.0\njson5>=0.9.0\n\nArchive v0.2.0: 8 files, 19510 bytes\n\nFiles: docs/AI记忆中间件可行性方案.md (13707b), scripts/memory_engine.py (27093b), scripts/requirements.txt (277b), scripts/setup.py (2613b), SKILL.md (3735b), tests/final_test.py (2053b), tests/test_engine.py (1171b), _meta.json (138b)\n\nFile v0.2.0:SKILL.md\n\n---\nname: long-term-memory\ndescription: Persistent, cross-session memory for OpenClaw agents. Automatically captures key facts, decisions, user preferences, and project context. Injects relevant memory at session start. Search past conversations with natural language queries. Use when context continuity matters between sessions, when agent needs to remember user/project history, or when answering \"do you remember...\" questions.\nversion: 1.0.0\n---\n\n# Long-Term Memory\n\n## Overview\n\nThis skill gives OpenClaw agents **long-term memory** that persists across sessions.\nIt replaces the manual MEMORY.md approach with automated capture + structured storage.\n\n**Everything runs locally** — no cloud, no data leaves your machine.\n\n## Core Workflow\n\n```\nSession Start → 1. inject_context() → get relevant history\nSession Run  → 2. remember() / auto_capture() → save important info\nSession End  → 3. summarize() → compress session into memory\n```\n\n## Scripts\n\n### `scripts/memory_engine.py` — Core engine\n\n```bash\n# Save a memory\npython3 scripts/memory_engine.py remember \"决定: 使用FastAPI框架\" --tags decision,tech --importance 8 --project saas\n\n# Search memories\npython3 scripts/memory_engine.py search \"技术方案\" --tags tech --min-imp 5\n\n# Get context for prompt injection\npython3 scripts/memory_engine.py inject \"当前任务描述...\"\n\n# Auto-capture from text (scans for decisions, facts, preferences)\npython3 scripts/memory_engine.py auto \"我们决定采用SQLite作为数据库，技术栈为FastAPI...\"\n\n# Session management\npython3 scripts/memory_engine.py session-start    # returns session_id + context\npython3 scripts/memory_engine.py session-end <session_id> --summary \"...\"\n\n# Stats\npython3 scripts/memory_engine.py stats\n```\n\n### `scripts/setup.py` — One-time workspace setup\n\n```bash\npython3 scripts/setup.py\n```\n\n## Memory Structure\n\n- **Storage**: SQLite + FTS5 full-text search\n- **Fields**: content, tags[], importance(1-10), source, session, project, timestamps\n- **Tags**: Tag memories for filtering (e.g., `decision`, `tech`, `user`, `project:X`)\n- **Importance**: 1-10 scale. 8+ = key fact, 6-7 = useful context, 1-5 = normal\n\n## Auto-Capture\n\nThe engine automatically detects important content from text:\n\n| Trigger Keywords | Tag | Default Importance |\n|:---|---|:---:|\n| 决定, 选择, 采用, 改为, 升级, 弃用 | `decision` | 7 |\n| 项目名, 产品名, 公司, 版本, 价格 | `fact` | 6 |\n| 喜欢, 偏好, 习惯, 不要, 推荐 | `preference` | 6 |\n| 技术栈, 框架, 语言, 数据库, API, 部署 | `tech` | 5 |\n| 问题, bug, 报错, 异常, 失败 | `problem` | 5 |\n\n## AGENTS.md Integration\n\nAdd to your `AGENTS.md` (or the relevant agent's config):\n\n```markdown\n## Long-Term Memory Rules\n\n1. On session start: Run `python3 scripts/memory_engine.py inject \"current task\"` and use the output as context\n2. When user shares important info: Use `remember()` to save it\n3. Track decisions: Save key decisions with `--importance 8` and tag `decision`\n4. Before answering \"remember\" or \"previous\" questions: Search memory first\n5. On session end: Summarize key outcomes for next session\n```\n\n## Data Storage\n\n```\n~/.openclaw/workspace/long-term-memory/\n├── memory.db          # SQLite database\n├── config.json        # Configuration\n└── current_context.md # Last built context (for debugging)\n```\n\n## Tips\n\n- **Be selective**: Not everything needs remembering. Save decisions, preferences, problems.\n- **Use tags**: `project:X` tags make cross-project memory searchable.\n- **Importance matters**: 8+ for permanent facts, 5-7 for useful context, 3-4 for temporary.\n- **Search before answering**: If user asks \"do you remember X?\", search memory first.\n\nFile v0.2.0:_meta.json\n\n{\n  \"ownerId\": \"kn70s65fxc5y4p8fvk77ez8a0h833aty\",\n  \"slug\": \"memory-for-openclaw\",\n  \"version\": \"0.2.0\",\n  \"publishedAt\": 1778215109682\n}\n\nFile v0.2.0:scripts/requirements.txt\n\n# Long-Term Memory Engine — dependencies\n# Core\nsqlite-vec==0.1.0\n\n# Embedding (choose one)\n# Option A: Local model (free, ~500MB download)\nsentence-transformers>=2.2.0\n\n# Option B: API-based (for professional version)\n# openai>=1.0.0\n\n# Utilities\nnumpy>=1.24.0\njson5>=0.9.0\n\nFile v0.2.0:docs/AI记忆中间件可行性方案.md\n\n# AI长期记忆中间件 — 一人一电脑可行性方案\n\n**编制日期：** 2026年5月8日\n**项目参考：** thedotmack/claude-mem (73K★) + cocoindex-io/cocoindex (8.8K★)\n\n---\n\n## 一、市场背景与机会\n\n### 1.1 痛点：企业AI最大的瓶颈是\"记不住\"\n\n当前企业用AI面临的核心矛盾：\n\n```\n企业的问题：                   AI的现状：\n┌──────────────────┐          ┌──────────────────┐\n│ 几十万份内部文档     │          │ 上下文窗口有限      │\n│ 几百个Slack频道    │   →      │ 会话结束就忘记      │\n│ 海量会议录音/纪要   │          │ 记不住你是谁、做过什么 │\n│ 代码仓库+Wiki+知识库 │          │ 每次从头解释        │\n│ 客户历史+工单记录   │          │ 无法学习积累        │\n└──────────────────┘          └──────────────────┘\n```\n\n**结果：** 企业花了钱接AI，但AI像个\"金鱼记忆\"，每次都要重新喂数据，效果大打折扣。\n\n### 1.2 GitHub趋势佐证\n\n| 项目 | Stars | 核心能力 | 对我的参考 |\n|------|-------|---------|-----------|\n| **thedotmack/claude-mem** | **73K★** (月增27K) | AI会话记忆插件：自动捕获→压缩→注入上下文 | **产品形态**：MCP协议+向量搜索+分层检索 |\n| **cocoindex-io/cocoindex** | **8.8K★** | 增量引擎：文档→AI随时可用的活数据 | **技术架构**：增量计算+Rust核心+声明式API |\n\n**两个项目加起来59天涨了10万星，说明市场需求极其旺盛。**\n\n### 1.3 市场规模\n\n| 维度 | 数据 |\n|------|------|\n| 全球AI Agent市场(2026) | 约$300亿（Gartner） |\n| 企业AI知识管理市场 | 约$120亿 |\n| 企业上下文管理（新品类） | 估算$50-80亿 |\n| 国内中小企业数量 | 约4000万家 |\n| **目标客户（20-500人科技企业）** | 约**200万家** |\n\n---\n\n## 二、产品方案\n\n### 2.1 产品定位\n\n> **\"AI的长期记忆\"** — 一个中间件服务，让任何AI Agent都能像人一样持续积累记忆，跨会话、跨应用、跨团队。\n\n### 2.2 核心架构\n\n```\n┌─────────────────────────────────────────────────────────┐\n│                    客户内部环境                           │\n│                                                          │\n│  ┌──────┐ ┌──────┐ ┌──────┐ ┌──────┐ ┌──────┐          │\n│  │ Slack│ │飞书  │ │Confluence│ │GitHub│ │邮件  │  ...   │\n│  └──┬───┘ └──┬───┘ └──┬───┘ └──┬──┘ └──┬──┘          │\n│     │        │        │        │       │                │\n│  ┌──┴────────┴────────┴────────┴───────┴─────────┐     │\n│  │           Memory Connect（数据连接器层）          │     │\n│  │   实时监听变更 → 增量处理 → 向量化 → 存储        │     │\n│  └────────────────────┬──────────────────────────┘     │\n│                       │                                 │\n│  ┌────────────────────┴──────────────────────────┐     │\n│  │           Memory Store（记忆存储层）             │     │\n│  │  SQLite + Chroma向量库 + 全文索引 + 分层摘要     │     │\n│  └────────────────────┬──────────────────────────┘     │\n│                       │                                 │\n│  ┌────────────────────┴──────────────────────────┐     │\n│  │           Memory API（记忆接口层）               │     │\n│  │  MCP协议 / REST API / SDK（Python/TS/Go）      │     │\n│  └────────────────────┬──────────────────────────┘     │\n│                       │                                 │\n└───────────────────────┼─────────────────────────────────┘\n                        │\n         ┌──────────────┼──────────────┐\n         ▼              ▼              ▼\n      Claude/GPT    自定义Agent   企业自研AI应用\n```\n\n### 2.3 核心功能\n\n#### ① 数据连接器（Memory Connect）\n| 连接器 | 功能 | 技术实现 |\n|--------|------|---------|\n| 飞书文档/知识库 | 监听文档变更、自动同步 | webhook + 增量同步 |\n| GitHub/GitLab | 代码库+Issue+PR自动索引 | 参考cocoindex |\n| Confluence/语雀 | 企业Wiki同步 | API轮询 |\n| Slack/飞书消息 | 关键对话保存 | 可配置过滤规则 |\n| 本地文件/PDF | 文件夹监控 | cocoindex本地FS连接器 |\n| 邮件/日历 | 自动归档 | IMAP/Exchange API |\n\n#### ② 记忆存储（Memory Store）— **核心引擎**\n| 模块 | 实现 | 参考 |\n|------|------|------|\n| **增量引擎** | 只处理变化的增量，不改的全量重算 | ✅ cocoindex |\n| **向量嵌入** | 文档→Embedding→向量库 | Chroma/Milvus |\n| **分层摘要** | 原始数据→每日摘要→每周摘要→项目摘要 | ✅ claude-mem三层结构 |\n| **全文检索** | FTS5+语义搜索混合 | SQLite FTS5 + Chroma |\n| **遗忘机制** | 自动老化、优先级降级 | 自定义 |\n\n#### ③ 记忆接口（Memory API）\n| 接口 | 功能 | 参考 |\n|------|------|------|\n| `search(query)` | 自然语言搜索记忆 | ✅ claude-mem MCP |\n| `remember(data)` | 主动存储一段记忆 | 自定义 |\n| `context(query)` | 获取与当前任务相关的上下文包 | 自动组装 |\n| `forget(filter)` | 按规则遗忘（合规需求） | 自定义 |\n| `stats()` | 记忆使用统计 | 自定义 |\n\n### 2.4 三阶段检索策略（Token优化核心）\n\n参考 claude-mem 的分层检索模式：\n\n```\n第1层：search()——只返回匹配摘要（~50-100 tokens/条）\n   ↓ 用户/Agent筛选感兴趣的结果\n第2层：timeline()——选中结果的时间线上下文（~200-300 tokens）\n   ↓ 确认需要的细粒度信息\n第3层：get()——完整原始内容（~500-1000 tokens/条）\n\n💡 相比每次都全量检索，节省约10倍token成本\n```\n\n### 2.5 MVP范围（第1-3周）\n\n```\nMVP v0.1\n├── 核心引擎\n│   ├── 本地文档文件夹监听（参考cocoindex）\n│   ├── 增量同步 → 向量嵌入\n│   └── SQLite + Chroma存储\n│\n├── API\n│   ├── search(query) — 语义搜索\n│   └── context(query) — 自动上下文注入\n│\n├── 客户端\n│   ├── Python SDK（pip install...）\n│   └── MCP协议支持（可直接接入Claude/GPT）\n│\n└── 管理界面\n    ├── 查看已索引数据量\n    ├── 搜索测试\n    └── 配置数据源\n```\n\n---\n\n## 三、技术方案\n\n### 3.1 技术栈\n\n| 层 | 技术 | 说明 |\n|----|------|------|\n| 核心引擎 | **Rust**（参考cocoindex）或 **Python** | Rust性能好但学习成本高 |\n| 嵌入模型 | **BGE-M3/BAAI**（国产免费） | 中英文混合支持好 |\n| 向量库 | **Chroma**（轻量级）→ **Milvus**（规模化） | MVP阶段Chroma足够 |\n| 主存储 | **SQLite**（嵌入式）+ **Pgvector**（企业版） | 参考claude-mem |\n| API框架 | **FastAPI** | 你已有经验 |\n| 实时监听 | **watchdog**(文件) + **webhook**(云服务) | 增量触发 |\n| 部署 | 单机Docker / 轻量VPS | 一个人就能管 |\n\n### 3.2 与现有资产的关系\n\n| 已有资产 | 用途 |\n|---------|------|\n| Python环境 | ✅ 开发语言 |\n| DeepSeek API | ✅ 可用于生成摘要/提炼记忆 |\n| FastAPI经验 | ✅ 来自金融SaaS项目 |\n| 一台服务器 | ✅ 可先在本机跑 |\n\n---\n\n## 四、商业模式\n\n### 4.1 定价方案\n\n| 套餐 | 价格 | 存储上限 | 数据源数 | 用户数 |\n|------|:----:|:--------:|:--------:|:------:|\n| **个人版** | **免费** | 50MB | 1个 | 1人 |\n| **团队版** | **¥299/月** | 5GB | 5个 | 10人 |\n| **企业版** | **¥999/月** | 50GB | 20个 | 50人 |\n| **旗舰版** | **¥2,999/月** | 500GB | 不限 | 不限 |\n\n### 4.2 收入测算\n\n| 阶段 | 时间 | 付费客户 | 客单价 | 月收入 | 年收入 |\n|:----:|:----:|:--------:|:------:|:------:|:------:|\n| MVP验证 | 1-2月 | 3-10家 | ¥299 | ¥1K-3K | 验证期 |\n| 增长期 | 3-6月 | 30-100家 | ¥500 | **¥1.5W-5W** | ¥18W-60W |\n| 稳定期 | 6-12月 | 200-500家 | ¥800 | **¥16W-40W** | **¥192W-480W** |\n\n### 4.3 获客渠道\n\n| 渠道 | 策略 |\n|------|------|\n| 开源社区 | 在GitHub开源基础版，企业版收费（Open Core模式） |\n| 飞书应用市场 | 上架飞书应用，获客成本低 |\n| 开发者社区 | 在V2EX/即刻/知乎发技术贴 |\n| 技术博客 | \"如何让AI记住你的一切\"类标题引流 |\n| **与金融SaaS协同** | 客户资源共享，打包销售 |\n\n---\n\n## 五、竞争分析\n\n### 5.1 竞品对比\n\n| 竞品 | 定位 | 优势 | 劣势 |\n|------|------|------|------|\n| **claude-mem** | 个人开发者记忆插件 | 产品成熟、社区大 | 纯个人使用、不支持企业数据源 |\n| **cocoindex** | 数据增量引擎 | 技术先进（Rust） | 太底层、需要编程基础 |\n| **Mem.ai** | 个人AI笔记 | 产品体验好 | 不支持第三方Agent接入 |\n| **Notion AI** | AI知识管理 | 品牌大 | 封闭生态、不能接其他AI |\n| **Cursor/Codex** | 编程助手记忆 | 深度集成 | 只限编程场景 |\n| **我们的产品** | 企业的AI记忆中间件 | **通用性**：接任何AI、任何数据源 | 品牌弱 |\n\n### 5.2 核心优势\n\n1. **与AI无关** — 不管是Claude、GPT还是DeepSeek，都能用我们的记忆层\n2. **与数据源无关** — 飞书、Slack、Confluence、GitHub，一通接\n3. **增量更新** — 不是每天全量重算，只有变化才处理（参考cocoindex）\n4. **Token优化** — 分层检索，为企业省API费用\n5. **本地部署** — 数据不出企业网络，符合合规要求\n\n---\n\n## 六、实施路线图\n\n### Phase 1: MVP | 第1-3周\n\n| 周次 | 任务 | 里程碑 |\n|:----:|------|--------|\n| 第1周 | 搭建核心引擎：文档监听→分块→嵌入→存储 | 本地文件可自动索引 |\n| 第2周 | 实现search/context API + Python SDK | 可编程调用 |\n| 第3周 | 实现MCP协议支持 + Web管理界面 | 可直接接Claude/GPT |\n\n### Phase 2: 付费化 | 第4-6周\n\n| 周次 | 任务 | 里程碑 |\n|:----:|------|--------|\n| 第4周 | 飞书文档连接器 | 国内最大需求 |\n| 第5周 | 分层摘要+遗忘机制 | 记忆质量提升 |\n| 第6周 | 付费系统+开源基础版 | 开始获客 |\n\n### Phase 3: 增长 | 第7-12周\n\n- GitHub/GitLab连接器\n- 多租户支持\n- 企业版（私有化部署）\n- 开源社区运营\n\n### Phase 4: 规模化 | 第13周+\n\n- 与主流Agent框架深度集成\n- 出售企业私有化版本\n- 考虑增加1人做社区运营\n\n---\n\n## 七、成本测算\n\n| 项目 | MVP期月成本 | 增长期月成本 |\n|------|:----------:|:------------:|\n| VPS服务器 | ¥100 | ¥500-1,000 |\n| 向量库托管 | ¥0(Chroma本地) | ¥200(Milvus云) |\n| 嵌入API | ¥0(BGE本地) | ¥200-500 |\n| LLM摘要API | ¥200-500 | ¥1,000-3,000 |\n| **合计** | **¥300-600/月** | **¥2,000-5,000/月** |\n| **预期收入** | **¥1K-3K** | **¥1.5W-5W** |\n| **毛利率** | **70-80%** | **85-90%** |\n\n---\n\n## 八、风险评估\n\n| 风险 | 概率 | 影响 | 对策 |\n|------|:----:|:----:|------|\n| 开源项目做不过claude-mem | 中 | 高 | 主攻企业场景，claude-mem只做个人 |\n| 嵌入模型效果不够好 | 低 | 中 | 使用BGE-M3+多模型对比 |\n| 大厂入场（飞书AI记忆） | 中 | 中 | 做飞书之外的AI，做跨平台桥梁 |\n| 数据安全合规 | 中 | 高 | 本地部署优先，数据不出客户网络 |\n| 一人精力瓶颈 | 高 | 中 | 先用开源社区降低支持成本 |\n\n---\n\n## 九、这两个项目的取舍\n\n| 维度 | 金融AI SaaS | AI记忆中间件 |\n|:----|:-----------|:------------|\n| 市场规模 | 小（个人投资者） | 大（企业级） |\n| 客单价 | ¥99-299/月 | ¥299-2,999/月 |\n| 获客难度 | 中（个人决策快） | 中（企业决策链长） |\n| 技术复杂度 | 中 | 高（Rust+向量库） |\n| 竞争壁垒 | 低（容易复制） | 高（积累数据+效果好） |\n| **与你的匹配度** | **⭐⭐⭐⭐⭐** | **⭐⭐⭐** |\n| **推荐优先级** | **① 先做** | **② 后补** |\n\n**建议：** 先集中精力把**金融AI SaaS**跑起来（客群明确、你有数据优势），等有了正向现金流，再花1-2个月做AI记忆中间件的MVP。两个产品可以互相导流。\n\n---\n\n## 十、一句话总结\n\n> **企业AI记不住——这就是商机。做\"AI的记忆层\"，接任何数据源、喂给任何AI，按月收费。先做金融SaaS站稳，再用这个市场做第二增长曲线。**\n\n---\n\n*本方案仅供参考，具体实施需根据实际情况调整。*","readmeExcerpt":"Skill: long-term-memory Owner: szwangw Summary: AI记忆中间件 - 为AI Agent提供持久化、跨会话的长期记忆能力。自动捕获关键事实、决策、用户偏好和项目上下文，支持语义搜索和向量检索。适用于需要记忆连续性的所有AI场景。 Tags: latest:1.2.0 Version history: v1.2.0 | 2026-05-09T01:05:41.555Z | user 新增企业版/技术支持服务入口，远程部署¥199/次；MaaS云服务6月公测预告 v1.1.0 | 2026-05-09T00:43:49.243Z | user 新增定价方案：Free/Starter/Pro/Enterprise 四档套餐 v0.2.0 | 2026-05-08T04:38:29.682Z | auto **Major update: Persistent, cross-session m","codeSnippets":[],"executableExamples":[{"language":"text","snippet":"Session Start → 1. inject_context() → get relevant history\nSession Run  → 2. remember() / auto_capture() → save important info\nSession End  → 3. summarize() → compress session into memory"},{"language":"bash","snippet":"# Save a memory\npython3 scripts/memory_engine.py remember \"决定: 使用FastAPI框架\" --tags decision,tech --importance 8 --project saas\n\n# Search memories\npython3 scripts/memory_engine.py search \"技术方案\" --tags tech --min-imp 5\n\n# Get context for prompt injection\npython3 scripts/memory_engine.py inject \"当前任务描述...\"\n\n# Auto-capture from text (scans for decisions, facts, preferences)\npython3 scripts/memory_engine.py auto \"我们决定采用SQLite作为数据库，技术栈为FastAPI...\"\n\n# Session management\npython3 scripts/memory_engine.py session-start    # returns session_id + context\npython3 scripts/memory_engine.py session-end <session_id> --summary \"...\"\n\n# Stats\npython3 scripts/memory_engine.py stats"},{"language":"bash","snippet":"python3 scripts/setup.py"},{"language":"markdown","snippet":"## Long-Term Memory Rules\n\n1. On session start: Run `python3 scripts/memory_engine.py inject \"current task\"` and use the output as context\n2. When user shares important info: Use `remember()` to save it\n3. Track decisions: Save key decisions with `--importance 8` and tag `decision`\n4. Before answering \"remember\" or \"previous\" questions: Search memory first\n5. On session end: Summarize key outcomes for next session"},{"language":"text","snippet":"~/.openclaw/workspace/long-term-memory/\n├── memory.db          # SQLite database\n├── config.json        # Configuration\n└── current_context.md # Last built context (for debugging)"},{"language":"text","snippet":"Session Start → 1. inject_context() → get relevant history\nSession Run  → 2. remember() / auto_capture() → save important info\nSession End  → 3. summarize() → compress session into memory"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: long-term-memory\ndescription: AI记忆中间件 - 为AI Agent提供持久化、跨会话的长期记忆能力。自动捕获关键事实、决策、用户偏好和项目上下文，支持语义搜索和向量检索。适用于需要记忆连续性的所有AI场景。\npricing:\n  community: \"开源免费，本地自部署无限制\"\n  remote_deploy: \"¥199/次\"\n  maas_starter: \"¥49/月（2026年6月上线）\"\npublisher:\n  wechat: \"18923788188 王工\"\nversion: 1.2.0\n---\n\n# Long-Term Memory — AI 记忆中间件\n\n## Overview\n\n为 AI Agent 提供 **长期记忆** 能力，解决大模型「过目就忘」的痛点。自动捕获关键事实、决策、用户偏好和项目上下文，支持语义搜索和向量检索，让 AI 真正记住你。\n\n---\n\n## 🚀 版本与定价\n\n### 社区版（开源免费）\n\n当前版本为**开源社区版**，适合个人开发者本地自部署。\n✅ 所有功能无限制使用\n✅ 无记忆条数限制\n✅ 无需注册、无需付费\n\n---\n\n### 💼 企业版 / 技术支持服务\n\n本地部署遇到困难？需要定制化配置？我来帮你搞定。\n\n| 服务项目 | 价格 | 说明 |\n|:---|---:|:---|\n| **远程部署** | **¥199/次** | 远程帮你搭好完整环境，跑通持久化记忆 |\n| **定制开发** | 另议 | 根据需求定制功能、对接现有系统 |\n| **技术咨询** | 另议 | 架构设计、方案评审、性能优化 |\n\n> 📞 **联系我们**：微信 **18923788188**（王工）\n\n---\n\n### ☁️ MaaS 云服务（2026年6月公测预告）\n\n即插即用的云端记忆服务，无需部署，开箱即用。\n\n| 套餐 | 价格 | 容量 | 功能 |\n|:---|---:|---|---|\n| **公测版** | **免费** | 前100条免费 | 云端API、基础记忆存储 |\n| **Starter** | **¥49/月** | 1万条记忆，3个项目 | 标签分类、项目隔离 |\n| **Pro** | **¥199/月** | 10万条记忆，无限项目 | 向量检索、语义搜索 |\n| **Enterprise** | 定制报价 | 无限容量 | 私有部署、SLA保障、专属存储、审计日志 |\n\n> ⏰ **公测时间**：2026年6月\n> 🔗 **支付方式**：支付宝（微信：18923788188 王工）\n\n---\n\n## Core Workflow\n\n```\nSession Start → 1. inject_context() → get relevant history\nSession Run  → 2. remember() / auto_capture() → save important info\nSession End  → 3. summarize() → compress session into memory\n```\n\n## Scripts\n\n### `scripts/memory_engine.py` — Core engine\n\n```bash\n# Save a memory\npython3 scripts/memory_engine.py remember \"决定: 使用FastAPI框架\" --tags decision,tech --importance 8 --project saas\n\n# Search memories\npython3 scripts/memory_engine.py search \"技术方案\" --tags tech --min-imp 5\n\n# Get context for prompt injection\npython3 scripts/memory_engine.py inject \"当前任务描述...\"\n\n# Auto-capture from text (scans for decisions, facts, preferences)\npython3 scripts/memory_engine.py auto \"我们决定采用SQLite作为数据库，技术栈为FastAPI...\"\n\n# Session management\npython3 scripts/memory_engine.py session-start    # returns session_id + context\npython3 scripts/memory_engine.py session-end <session_id> --summary \"...\"\n\n# Stats\npython3 scripts/memory_engine.py stats\n```\n\n### `scripts/setup.py` — One-time workspace setup\n\n```bash\npython3 scripts/setup.py\n```\n\n## Memory Structure\n\n- **Storage**: SQLite + FTS5 full-text search\n- **Fields**: content, tags[], importance(1-10), source, session, project, timestamps\n- **Tags**: Tag memories for filtering (e.g., `decision`, `tech`, `user`, `project:X`)\n- **Importance**: 1-10 scale. 8+ = key fact, 6-7 = useful context, 1-5 = normal\n\n## Auto-Capture\n\nThe engine automatically detects important content from text:\n\n| Trigger Keywords | Tag | Default Importance |\n|:---|---|:---:|\n| 决定, 选择, 采用, 改为, 升级, 弃用 | `decision` | 7 |\n| 项目名, 产品名, 公司, 版本, 价格 | `fact` | 6 |\n| 喜欢, 偏好, 习惯, 不要, 推荐 | `preference` | 6 |\n| 技术栈, 框架, 语言, 数据库, API, 部署 | `tech` | 5 |\n| 问题, bug, 报错, 异常, 失败 | `problem` | 5 |\n\n## AGENTS.md Integration\n\nAdd to your `AGENTS.md` (or the relevant agent's config):\n\n```markdown\n## Long-Term Memory Rules\n\n1. On session start: R"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn70s65fxc5y4p8fvk77ez8a0h833aty\",\n  \"slug\": \"memory-for-openclaw\",\n  \"version\": \"1.2.0\",\n  \"publishedAt\": 1778288741555\n}"},{"path":"scripts/requirements.txt","content":"# Long-Term Memory Engine — dependencies\n# Core\nsqlite-vec==0.1.0\n\n# Embedding (choose one)\n# Option A: Local model (free, ~500MB download)\nsentence-transformers>=2.2.0\n\n# Option B: API-based (for professional version)\n# openai>=1.0.0\n\n# Utilities\nnumpy>=1.24.0\njson5>=0.9.0"},{"path":"skill-card.md","content":"## Description:\n\nLong-Term Memory gives AI agents persistent cross-session memory with automatic capture of key facts, decisions, user preferences, project context, and searchable retrieval.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[szwangw](https://clawhub.ai/user/szwangw)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and agent builders use this skill to add local long-term memory to OpenClaw agents, including saving decisions, preferences, project facts, and injecting relevant prior context into later sessions.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill can persist and reinject sensitive user or project information without enough scoping, consent, or prompt-injection safeguards.\n\nMitigation: Use only in local, single-user contexts unless controls for consent, deletion, project isolation, and redaction are added; treat injected memories as untrusted historical notes, not instructions.\n\nRisk: Stored memories may include secrets, credentials, private personal data, or confidential business details.\n\nMitigation: Do not store those data types unless appropriate controls are in place for consent, deletion, project isolation, and redaction.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/szwangw/skills/memory-for-openclaw)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance]\n\n**Output Format:** [CLI text and Markdown context snippets]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Produces local memory search results, saved-memory identifiers, session context, statistics, and setup guidance.]\n\n## Skill Version(s):\n\n1.2.0 (source: frontmatter and server release evidence)\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":"AI记忆中间件 - 为AI Agent提供持久化、跨会话的长期记忆能力。自动捕获关键事实、决策、用户偏好和项目上下文，支持语义搜索和向量检索。适用于需要记忆连续性的所有AI场景。 Skill: long-term-memory Owner: szwangw Summary: AI记忆中间件 - 为AI Agent提供持久化、跨会话的长期记忆能力。自动捕获关键事实、决策、用户偏好和项目上下文，支持语义搜索和向量检索。适用于需要记忆连续性的所有AI场景。 Tags: latest:1.2.0 Version history: v1.2.0 | 2026-05-09T01:05:41.555Z | user 新增企业版/技术支持服务入口，远程部署¥199/次；MaaS云服务6月公测预告 v1.1.0 | 2026-05-09T00:43:49.243Z | user 新增定价方案：Free/Starter/Pro/Enterprise 四档套餐 v0.2.0 | 2026-05-08T04:38:29.682Z | auto **Major update: Persistent, cross-session m","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":898,"uniquenessScore":58,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-11T14:10:51.907Z","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-11T14:10:51.907Z","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-11T17:42:37.353Z","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"}]}}}