MemOS OpenClaw 插件MemOS OpenClaw Plugin

MemOS

OpenClaw 提供完全本地化的持久记忆、智能任务总结、技能自动进化和多智能体协同。npm 一键安装,支持分级模型配置。 Fully local persistent memory, smart task summarization, auto skill evolution, and multi-agent collaboration for OpenClaw. One-command install, tiered model support.

完全本地化:数据存于本机 SQLite,零云依赖。Viewer 仅 127.0.0.1,密码保护。 Fully local: Data in local SQLite, zero cloud dependency. Viewer 127.0.0.1 only, password-protected.
💾

全量写入Full-Write

每次对话自动捕获,语义分片后持久化。Auto-captures every conversation, chunks semantically.

任务总结与技能进化Tasks & Skills

碎片对话归纳为结构化任务,再提炼为可复用技能并持续升级。Conversations organized into tasks, then distilled into skills that auto-upgrade.

🔍

混合检索Hybrid Search

FTS5 + 向量,RRF,MMR,时间衰减。FTS5 + vector, RRF, MMR, recency decay.

🧠

全量可视化Visualization

记忆/任务/技能/分析/日志/导入/设置 7 个管理页。7 pages: memories, tasks, skills, analytics, logs, import, settings.

💰

分级模型Tiered Models

Embedding/摘要/技能可独立配置不同模型。Each pipeline configurable with different models.

🤝

多智能体协同Multi-Agent

记忆隔离 + 公共记忆 + 技能共享,多 Agent 协同进化。Memory isolation + public memory + skill sharing for collective evolution.

🦐

原生记忆导入Native Memory Import

一键迁移 OpenClaw 内置记忆,智能去重、断点续传、实时进度。One-click migration from OpenClaw built-in memories with smart dedup, resume, and real-time progress.

系统架构Architecture

四条流水线:记忆写入 → 任务总结与技能进化(异步)→ 智能检索 → 协同共享。每个 Agent 拥有独立记忆空间,通过公共记忆和技能共享实现协同进化。Four pipelines: write → task & skill evolution (async) → retrieval → collaboration. Each agent has isolated memory; public memory and skill sharing enable collective evolution.

OpenClawagent_end
Capture
Ingestchunk→summary→embed→dedup
SQLite+FTS5
Task Processor异步 · 话题检测 → 摘要async · topic → summary
Skill Evolver异步 · 评估 → 生成/升级async · eval → create/up
before_agent_startauto-recall
RecallFTS+Vector
LLM filter
Inject context
Agentmemory_search
RRF→MMR→Decay
LLM filter
excerpts+chunkId/task_id
task_summary / skill_get / memory_timeline

数据流Data Flow

写入Write

  1. agent_end → Capture → Chunk → LLM Summary → Embed → Dedup → Store
  2. 异步:任务检测 → 任务摘要 → 技能评估 → 技能生成/升级Async: task detect → summary → skill eval → create/upgrade

检索Read

  1. 每轮自动:before_agent_start 用用户消息检索 → LLM 过滤相关 → 注入 system 上下文;无结果时提示 agent 自生成 query 调 memory_searchPer turn: before_agent_start searches with user message → LLM filters relevant → inject system context; if no hits, hint agent to call memory_search with self-generated query.
  2. memory_search → FTS5+Vector → RRF → MMR → Decay → LLM filter → excerpts + chunkId/task_id(无 summary)
  3. task_summary / skill_get(skillId|taskId) / memory_timeline(chunkId) / skill_install

快速开始Quick Start

openclaw plugins install @memtensor/memos-local-openclaw-plugin
openclaw gateway startbash

升级Upgrade

openclaw plugins update memos-local-openclaw-plugin
openclaw gateway stop && openclaw gateway startbash
升级自动完成依赖安装、旧版清理和原生模块编译,无需手动操作。如果 update 命令不可用,先删除旧目录再重新安装:rm -rf ~/.openclaw/extensions/memos-local-openclaw-plugin && openclaw plugins install @memtensor/memos-local-openclaw-plugin(记忆数据不受影响)。Upgrade automatically handles dependencies, legacy cleanup, and native module compilation. If update is unavailable, delete the old directory first: rm -rf ~/.openclaw/extensions/memos-local-openclaw-plugin && openclaw plugins install @memtensor/memos-local-openclaw-plugin (memory data is stored separately and won't be affected).

配置Configuration

两种方式:编辑 openclaw.json 或通过 Viewer 网页面板在线修改。支持分级模型。Two methods: edit openclaw.json or via Viewer web panel. Tiered models supported.

{
  "plugins": {
    "slots": { "memory": "memos-local" },
    "entries": { "memos-local": {
      "config": {
        "embedding": {                           // lightweight
          "provider": "openai_compatible",
          "model": "bge-m3",
          "endpoint": "https://your-api-endpoint/v1",
          "apiKey": "sk-••••••"
        },
        "summarizer": {                          // mid-tier
            "provider": "openai_compatible",
          "model": "gpt-4o-mini",
          "endpoint": "https://your-api-endpoint/v1",
          "apiKey": "sk-••••••"
        },
        "skillEvolution": {
          "summarizer": {                        // high-quality
            "provider": "openai_compatible",
            "model": "claude-4.6-opus",
            "endpoint": "https://your-api-endpoint/v1",
            "apiKey": "sk-••••••"
          }
        },
        "recall": {                               // optional
          "vectorSearchMaxChunks": 0   // 0=search all; set 200000–300000 only if slow on huge DB
        },
        "viewerPort": 18799
      }
    }}
  }
}json
安装后每次对话自动存入记忆。访问 http://127.0.0.1:18799 使用 Viewer。Every conversation auto-stored. Visit http://127.0.0.1:18799 for Viewer.

🦐 记忆迁移 — 再续前缘🦐 Memory Migration — Reconnect

将 OpenClaw 原生内置的记忆数据(SQLite 存储的对话历史)无缝迁移到 MemOS 的智能记忆系统。你和 AI 共同积累的每一段对话,都值得被记住。Seamlessly migrate OpenClaw's native built-in memory data (SQLite conversation history) to MemOS's intelligent memory system. Every conversation you've built with AI deserves to be remembered.

核心特性:一键导入 · 智能去重 · 断点续传 · 任务与技能生成 · 实时进度 · 🦐 标识导入来源Key Features: One-click import · Smart dedup · Resume anytime · Task & skill gen · Real-time progress · 🦐 source tagging

操作步骤Usage

方式一:通过 Viewer 网页面板(推荐)Method 1: Via Viewer Web Panel (Recommended)

  1. 访问 http://127.0.0.1:18799,切换到 Import 页面。Visit http://127.0.0.1:18799, switch to the Import page.
  2. 点击 扫描 OpenClaw 原生记忆,系统自动扫描 ~/.openclaw/ 下的 SQLite 数据库和 JSONL 日志。Click Scan OpenClaw Native Memories — the system auto-scans SQLite databases and JSONL logs under ~/.openclaw/.
  3. 查看扫描结果(文件数、会话数、消息数),确认后点击 开始导入Review scan results (files, sessions, messages), then click Start Import.
  4. 实时查看导入进度条、统计数据(已导入/跳过/合并/错误)和日志。Monitor real-time progress bar, stats (stored/skipped/merged/errors), and logs.

方式二:通过 Agent 对话Method 2: Via Agent Chat

在与 OpenClaw 的对话中,直接让 AI 操作:In your conversation with OpenClaw, tell the AI:

// Example prompts
"请帮我导入 OpenClaw 的原生记忆"
"Import my OpenClaw native memories"text

方式三:通过 HTTP APIMethod 3: Via HTTP API

# 1. 扫描
curl http://127.0.0.1:18799/api/migrate/scan

# 2. 开始导入(SSE 流式进度)
curl http://127.0.0.1:18799/api/migrate/start

# 3. 停止导入
curl -X POST http://127.0.0.1:18799/api/migrate/stopbash

后处理:任务与技能生成Post-Processing: Task & Skill Generation

导入完成后,可选择对导入的记忆进行后处理:After import, optionally post-process imported memories:

后处理为串行执行,逐条处理导入的会话。已处理过的会话自动跳过。支持选择只生成任务、只生成技能或两者同时执行。Post-processing runs serially, processing imported sessions one by one. Already processed sessions are auto-skipped. Choose task-only, skill-only, or both.

断点续传Resume & Stop

导入和后处理均支持随时暂停:Both import and post-processing support pause/resume:

🦐 来源标识:所有通过迁移导入的记忆都带有 🦐 标识,在 Viewer 的记忆列表中可一眼区分原生导入和对话生成的记忆。🦐 Source Tag: All migrated memories are tagged with 🦐, making them visually distinguishable from conversation-generated memories in the Viewer.

模块Modules

Capture

过滤 system/self-tool,剥离 OpenClaw 元数据。保留 user/assistant/tool。Filter system/self-tool, strip metadata. Keep user/assistant/tool.

Ingest

异步队列:语义分片 → LLM 摘要 → 向量化 → 智能去重(Top-5 相似 + LLM 判 DUPLICATE/UPDATE/NEW,UPDATE 合并摘要并追加内容)→ 存储;演化块记录 merge_history。Async queue: chunk → summary → embed → smart dedup (Top-5 similar + LLM DUPLICATE/UPDATE/NEW; UPDATE merges summary and appends content) → store; evolved chunks track merge_history.

任务总结Task Summarization

异步检测任务边界(LLM 话题 + 2h 超时)→ 结构化摘要(目标/步骤/结果)。Async boundary detection (LLM topic + 2h timeout) → structured summary (goal/steps/result).

技能进化Skill Evolution

规则过滤 → LLM 评估 → SKILL.md 生成(步骤/警告/脚本)/ 升级 → 质量评分 → 安装。Rule filter → LLM evaluate → SKILL.md (steps/warnings/scripts) / upgrade → score → install.

Recall

FTS5+Vector → RRF(k=60) → MMR(λ=0.7) → Decay(14d) → Normalize → Filter(≥0.45) → Top-K。自动关联 Task/Skill。FTS5+Vector → RRF(k=60) → MMR(λ=0.7) → Decay(14d) → Normalize → Filter(≥0.45) → Top-K. Auto-links Task/Skill.

Viewer

7 页:记忆 CRUD/搜索/演化标识、任务(对话气泡)、技能(版本/下载)、分析、日志(工具调用输入输出)、OpenClaw 原生记忆导入、在线配置。密码保护。7 pages: memory CRUD/search/evolution badges, tasks (chat bubbles), skills (versions/download), analytics, logs (tool call I/O), OpenClaw native memory import, online config. Password-protected.

检索算法Retrieval

RRF

\[ \text{RRF}(d) = \sum_i \frac{1}{k + \text{rank}_i(d) + 1} \]

MMR

\[ \text{MMR}(d) = \lambda \cdot \text{rel}(d) - (1-\lambda) \cdot \max \text{sim}(d, d_s) \]

时间衰减Recency

\[ \text{final} = \text{score} \times \bigl(0.3 + 0.7 \times 0.5^{t/14}\bigr) \]

API

query (required), maxResults (20), minScore (0.45), role. Returns excerpts(原文片段)+ chunkId / task_id,无 summary;经 LLM 相关性过滤。excerpts + chunkId/task_id, no summary; LLM relevance filter.

memory_get

获取记忆块完整原文。Get full original text of a memory chunk. chunkId, maxChars (optional).

memory_timeline

以 chunkId 为锚点的上下文邻居。Context neighbors by chunkId. chunkId, window (2).

task_summary

任务结构化摘要。Structured task summary. taskId or query.

skill_get / skill_install

skill_get 支持 skillId 或 taskId(按任务解析技能);skill_install 安装到工作区。skill_get accepts skillId or taskId; skill_install installs to workspace.

memory_write_public

写入公共记忆(owner="public"),所有 Agent 均可检索。Write public memory (owner="public"), discoverable by all agents. content (required), summary (optional).

搜索技能:FTS5 关键词 + 向量语义双通道,RRF 融合后经 LLM 判断相关性。Search skills via FTS5 + vector, RRF fusion, then LLM relevance judgment. query (required), scope ("mix" | "self" | "public", default "mix").

skill_publish / skill_unpublish

skill_publish 将技能设为公开,其他 Agent 可通过 skill_search 发现并安装。skill_unpublish 设为私有。skill_publish makes a skill public and discoverable via skill_search. skill_unpublish sets it private. skillId (required).

memory_viewer

返回 Viewer URL。Returns Viewer URL.

Viewer HTTP

GET /; POST /api/auth/*; GET /api/memories, /api/tasks, /api/skills, /api/stats, /api/logs, /api/log-tools, /api/config; POST/PUT/DELETE /api/memory/:id; PUT /api/skill/:id/visibility.

多智能体协同Multi-Agent Collaboration

MemOS 原生支持多 Agent 场景。每个 Agent 的记忆和任务通过 owner 字段隔离(格式 agent:{agentId}),检索时自动过滤为当前 Agent + public。MemOS natively supports multi-agent scenarios. Each agent's memories and tasks are isolated via an owner field (agent:{agentId}); retrieval automatically filters to current agent + public.

数据库Database

~/.openclaw/memos-local/memos.db, WAL. Tables: chunks (owner), chunks_fts, embeddings, tasks (owner), skills (owner, visibility), skill_versions, task_skills, skill_embeddings, skills_fts.

安全Security

Viewer 仅 127.0.0.1;密码 SHA-256;HttpOnly+SameSite Cookie;会话 24h;数据仅本地。127.0.0.1 only; SHA-256 password; HttpOnly+SameSite; 24h session; data stays local.

默认值Defaults

maxResults 6, maxResultsMax 20, minScore 0.45, rrfK 60, mmrLambda 0.7, recencyHalfLife 14d, vectorSearchMaxChunks 0 (search all), dedup 0.93, viewerPort 18799, taskIdle 2h, skillMinChunks 6.

MemOSMemOS MemOS — OpenClaw Plugin · Docs

首页Home · 安装排查指南Troubleshooting · npm · GitHub · MIT