返回顶部
o

openclaw-mem0openclaw-mem0配置

Install, configure, diagnose, and operate the openclaw-mem0 long-term memory plugin for OpenClaw agents. Use when the user wants to set up mem0 memory (platform or open-source/self-hosted mode), configure OSS components (embedder, vector store, LLM, historyDbPath), debug memory issues (SQLITE_CANTOPEN crash loops, memories not being stored or recalled, Qdrant/Ollama connectivity), use the `openclaw mem0` CLI (search, stats), or understand how auto-recall and auto-capture work in agent sessions.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
394
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

openclaw-mem0

openclaw-mem0

为OpenClaw智能体提供长期记忆的插件,基于Mem0构建。在每个智能体回合前后自动提取和注入记忆。

安装

1. 安装插件

bash
openclaw plugins install @mem0/openclaw-mem0

此命令会将插件安装到 ~/.openclaw/extensions/openclaw-mem0/ 目录,并将其添加到 openclaw.json 配置文件中。

2. 选择模式并安装依赖

平台模式 — 无需本地依赖。从 app.mem0.ai 获取API密钥,然后直接跳转到配置部分。

开源模式 — 需要两个本地服务:

bash

Ollama(嵌入器 + 大语言模型)


brew install ollama
ollama serve # 或:brew services start ollama
ollama pull bge-m3:latest # 嵌入器(1024维)
ollama pull llama3.2 # 用于记忆提取的大语言模型

Qdrant(向量存储)

docker run -d -p 6333:6333 qdrant/qdrant

或:brew install qdrant && qdrant

验证两个服务是否正常运行:
bash
curl -s http://localhost:11434/ # → Ollama is running
curl -s http://localhost:6333/health # → {status:ok}

3. 添加到 openclaw.json

在 plugins.entries 下添加(详见下面的配置部分)。

4. 重启网关

bash
openclaw gateway stop && openclaw gateway

确认插件已加载:
bash
grep openclaw-mem0: initialized ~/.openclaw/logs/gateway.log | tail -1

预期输出:openclaw-mem0: initialized (mode: open-source, user: ..., autoRecall: true, autoCapture: true)



模式


模式配置要求
platform来自 app.mem0.ai 的 apiKey互联网连接,Mem0 API密钥
open-source
oss 配置块(自托管) | Ollama + Qdrant(或其他提供商) |

配置

最小配置

平台模式:
json5
openclaw-mem0: {
enabled: true,
config: { mode: platform, apiKey: ${MEM0APIKEY}, userId: your-id }
}

开源模式:
json5
openclaw-mem0: {
enabled: true,
config: {
mode: open-source,
userId: your-id,
oss: {
embedder: { provider: ollama, config: { model: bge-m3:latest, baseURL: http://localhost:11434 } },
vectorStore: { provider: qdrant, config: { host: localhost, port: 6333, collection: memories, dimension: 1024 } },
llm: { provider: ollama, config: { model: llama3.2, baseURL: http://localhost:11434 } },
historyDbPath: /absolute/path/to/.openclaw/memory/history.db
}
}
}

始终将 historyDbPath 设置为绝对路径。 当openclaw作为LaunchAgent运行时,process.cwd() 为 /,因此默认的相对路径 memory.db 会解析为 /memory.db(在macOS上不可写),导致SQLITECANTOPEN崩溃循环。详见 troubleshooting.md

关键配置选项

默认值说明
autoRecalltrue在每个智能体回合前注入记忆
autoCapture
true | 在每个智能体回合后存储记忆 | | topK | 5 | 每回合最大注入记忆数 | | searchThreshold | 0.5 | 最低相似度分数(0–1) | | userId | default | 按用户范围管理记忆 |

命令行界面

bash
openclaw mem0 stats # 总记忆数、模式、用户
openclaw mem0 search 用户名称 # 语义搜索
openclaw mem0 search 主题 --scope long-term # long-term | session | all

智能体工具

该插件注册了5个供智能体调用的工具:

工具描述
memorysearch语义搜索(范围:session/long-term/all)
memorylist
列出用户的所有记忆 |
| memory_store | 显式保存事实(默认 longTerm: true) |
| memory_get | 按ID获取记忆 |
| memory_forget | 按ID或查询删除 |

验证是否正常工作

bash

检查网关日志中的注入事件


grep openclaw-mem0: inject ~/.openclaw/logs/gateway.log | tail -5

确认历史数据库已在配置路径创建

ls -la /path/to/history.db

自上次网关启动以来无SQLITE错误

grep SQLITE_CANTOPEN ~/.openclaw/logs/gateway.err.log | tail -3

故障排除

详见 references/troubleshooting.md,了解以下问题的处理方法:

  • - SQLITE_CANTOPEN崩溃循环(最常见问题)
  • Qdrant / Ollama无法访问
  • 记忆未存储或未召回
  • Telegram allowFrom 配置警告

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 mem0-config-1776291775 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 mem0-config-1776291775 技能

通过命令行安装

skillhub install mem0-config-1776291775

下载

⬇ 下载 openclaw-mem0 v1.0.0(免费)

文件大小: 4.68 KB | 发布时间: 2026-4-16 18:00

v1.0.0 最新 2026-4-16 18:00
Initial release. Full install guide (platform + OSS mode), Qdrant/Ollama setup, historyDbPath fix for macOS LaunchAgent SQLITE_CANTOPEN crash loop, CLI usage, agent tools, and troubleshooting reference.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large