← 返回
AI智能 Key 中文

Mem0 Config

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 (platf...
为 OpenClaw 智能体安装、配置、诊断及操作 openclaw-mem0 长期记忆插件。用于用户需设置 mem0 记忆(平台...)时。
nyrosveil
AI智能 clawhub v1.0.0 1 版本 100000 Key: 需要
★ 0
Stars
📥 700
下载
💾 22
安装
1
版本
#latest

概述

openclaw-mem0

Long-term memory plugin for OpenClaw agents, powered by Mem0. Extracts and injects memories automatically around each agent turn.

Installation

1. Install the plugin

openclaw plugins install @mem0/openclaw-mem0

This installs the plugin into ~/.openclaw/extensions/openclaw-mem0/ and adds it to openclaw.json.

2. Choose a mode and install dependencies

Platform mode — no local dependencies. Get an API key from app.mem0.ai and skip to Configuration.

Open-source mode — requires two local services:

# Ollama (embedder + LLM)
brew install ollama
ollama serve                        # or: brew services start ollama
ollama pull bge-m3:latest           # embedder (1024-dim)
ollama pull llama3.2                # LLM for memory extraction

# Qdrant (vector store)
docker run -d -p 6333:6333 qdrant/qdrant
# or: brew install qdrant && qdrant

Verify both are running:

curl -s http://localhost:11434/          # → "Ollama is running"
curl -s http://localhost:6333/health     # → {"status":"ok"}

3. Add to openclaw.json

Add under plugins.entries (see Configuration below).

4. Restart the gateway

openclaw gateway stop && openclaw gateway

Confirm the plugin loaded:

grep "openclaw-mem0: initialized" ~/.openclaw/logs/gateway.log | tail -1

Expected output: openclaw-mem0: initialized (mode: open-source, user: ..., autoRecall: true, autoCapture: true)


Modes

ModeConfigRequires
---------
platformapiKey from app.mem0.aiInternet, Mem0 API key
open-sourceoss block (self-hosted)Ollama + Qdrant (or other providers)

Configuration

Minimal Config

Platform:

"openclaw-mem0": {
  "enabled": true,
  "config": { "mode": "platform", "apiKey": "${MEM0_API_KEY}", "userId": "your-id" }
}

Open-source:

"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"
    }
  }
}

> Always set historyDbPath to an absolute path. When openclaw runs as a LaunchAgent, process.cwd() is /, so the default relative "memory.db" resolves to /memory.db (unwritable on macOS), causing a SQLITE_CANTOPEN crash loop. See troubleshooting.md.

Key Config Options

KeyDefaultNotes
---------
autoRecalltrueInject memories before each agent turn
autoCapturetrueStore memories after each agent turn
topK5Max memories injected per turn
searchThreshold0.5Min similarity score (0–1)
userId"default"Scope memories per user

CLI

openclaw mem0 stats                          # Total memories, mode, user
openclaw mem0 search "user's name"           # Semantic search
openclaw mem0 search "topic" --scope long-term   # long-term | session | all

Agent Tools

The plugin registers 5 tools for agents to call:

ToolDescription
------
memory_searchSemantic search (scope: session/long-term/all)
memory_listList all memories for a user
memory_storeExplicitly save a fact (longTerm: true by default)
memory_getFetch memory by ID
memory_forgetDelete by ID or query

Verifying It Works

# Check gateway log for injection events
grep "openclaw-mem0: inject" ~/.openclaw/logs/gateway.log | tail -5

# Confirm history DB created at configured path
ls -la /path/to/history.db

# No SQLITE errors since last gateway start
grep "SQLITE_CANTOPEN" ~/.openclaw/logs/gateway.err.log | tail -3

Troubleshooting

See references/troubleshooting.md for:

  • SQLITE_CANTOPEN crash loop (most common issue)
  • Qdrant / Ollama not reachable
  • Memories not being stored or recalled
  • Telegram allowFrom config warning

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-29 22:50 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

ontology

oswalpalash
类型化知识图谱,用于结构化智能体记忆与可组合技能。支持创建/查询实体(人员、项目、任务、事件、文档)及关联...
★ 710 📥 243,597
ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,352 📥 317,829
communication-collaboration

A2a Manager

nyrosveil
管理智能体创建、Discord频道与角色、智能体间任务协作、子智能体生成、A2A_MAP更新及Notion任务工作流。
★ 0 📥 783