Token导航 LogoToken导航TokenDH.com
研究检索external-serviceclawhub未标认证来源可访问clear审计提醒

openclaw-memory-upgradeOpenClaw 记忆 upgrade

Agent Skill

openclaw-memory-upgrade 用于查找、检索和筛选相关信息,适合在 OpenClaw 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

2,892

周安装

117

GitHub Stars

公开资料未说明

下载量

908
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:openclaw-memory-upgrade(OpenClaw 记忆 upgrade)
来源仓库:https://github.com/johnnywang2001/openclaw-memory-upgrade
安装命令:
openclaw skills install openclaw-memory-upgrade
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install openclaw-memory-upgrade

简介

openclaw-memory-upgrade 提供升级指南,实现跨会话持久化与可搜索上下文管理。

  • 适合在 OpenClaw 中实施六项关键升级以增强内存流量与稳定性。
  • 通过 clawhub 安装,使用 openclaw skills install 命令,按步骤执行配置变更。
  • 安装前应备份现有内存文件,防止升级过程中数据损坏或丢失。
  • 包含增强型内存调度与故障回滚机制,降低升级风险。

SKILL.md

name
openclaw-memory-upgrade
description
Complete guide to upgrading OpenClaw's memory system for persistent, searchable context across sessions. Implements 6 upgrades including enhanced memory flush, session indexing, QMD hybrid search, Mem0 plugin, and manual memory management patterns.

OpenClaw Memory Upgrade

Turn your OpenClaw agent from a goldfish into an elephant. This skill implements 6 memory upgrades that give your agent persistent, searchable memory across sessions — so it actually remembers who you are, what you're working on, and what happened yesterday.

The Problem

By default, OpenClaw agents wake up blank every session. Conversations are isolated. Context is lost at compaction. Your agent forgets decisions, preferences, and project status the moment the session ends.

What This Fixes

After applying these upgrades, your agent will:

  • Extract and save 8 categories of important information before context is lost
  • Search across all past sessions and memory files before answering
  • Use hybrid keyword + semantic search with diversity and recency ranking
  • Auto-capture and auto-recall memories via the Mem0 plugin
  • Maintain curated long-term memory separately from raw daily logs

Prerequisites

  • OpenClaw 2026.2.26 or later
  • Access to openclaw.json config file
  • npm (for Mem0 plugin installation)

Upgrade 1: Enhanced memoryFlush Prompt

What it does: When a conversation nears compaction (context window filling up), this automatically scans for 8 categories of important information and writes them to daily memory files before context gets trimmed.

Why it matters: Without this, compaction silently discards conversation details. With it, decisions, preferences, technical details, and more survive compaction.

Add to openclaw.json under agents.defaults.compaction:

{
  "compaction": {
    "mode": "safeguard",
    "reserveTokensFloor": 20000,
    "memoryFlush": {
      "enabled": true,
      "softThresholdTokens": 4000,
      "systemPrompt": "Session nearing compaction. Analyze the conversation and extract durable memories NOW before context is lost.",
      "prompt": "Scan the current conversation and write any of the following to memory/YYYY-MM-DD.md (use today's date):\
\
1. DECISIONS made (with reasoning and context)\
2. USER PREFERENCES or corrections expressed\
3. TECHNICAL DETAILS (commands, configs, API keys, endpoints, file paths)\
4. PROJECT STATUS changes or milestones\
5. PEOPLE mentioned (names, roles, contact info, relationships)\
6. WORKFLOWS or processes described\
7. ERRORS encountered and their solutions\
8. OPINIONS or feedback the user gave\
\
For each item, include timestamps and enough context that future-you can understand it without the conversation. If nothing meaningful happened, reply with NO_REPLY."
    }
  }
}

Config explained:

  • mode: "safeguard" — compaction mode that preserves important context
  • reserveTokensFloor: 20000 — always keep at least 20K tokens available for the agent to work with
  • softThresholdTokens: 4000 — trigger memory flush when only 4K tokens remain before compaction
  • systemPrompt — injected as a system message to signal urgency
  • prompt — the actual extraction instructions with 8 categories

Upgrade 2: Session Indexing

What it does: Makes past conversation sessions searchable. Without this, each session is a black box once it ends. With it, the agent can search across old conversations to find things discussed days or weeks ago.

Add to agents.defaults.memorySearch:

{
  "memorySearch": {
    "enabled": true,
    "experimental": {
      "sessionMemory": true
    },
    "sources": ["memory", "sessions"]
  }
}

Config explained:

  • sessionMemory: true — indexes past session transcripts for search
  • sources: ["memory", "sessions"] — searches both memory files AND past sessions

Upgrade 3: Manual Memory Management

What it does: Establishes a two-tier file-based memory system that the agent reads at the start of every session.

Structure:

workspace/
  MEMORY.md          ← Curated long-term memory (the agent's brain)
  memory/
    YYYY-MM-DD.md    ← Daily logs (raw notes from each day)

How it works:

  • MEMORY.md — distilled, organized knowledge. Sections for user profile, projects, decisions, preferences, contacts, workflows. Updated periodically.
  • memory/YYYY-MM-DD.md — raw daily logs. Auto-written by memoryFlush, also written manually by the agent during conversations. One file per day.

Agent instructions (add to AGENTS.md):

## Every Session
1. Read MEMORY.md — this is your long-term brain
2. Read memory/YYYY-MM-DD.md for today + yesterday
3. If something important happens, write it to today's daily file
4. Periodically review daily files and distill key learnings into MEMORY.md
5. Never rely on "mental notes" — if it matters, write it to a file

Key principle: Text > Brain. The agent's memory files ARE its continuity. Without them, it wakes up blank.


Upgrade 4: QMD Backend (Hybrid Search)

What it does: Replaces basic memory search with QMD — a hybrid system combining keyword matching (BM25) and semantic understanding (vector embeddings), with diversity ranking and recency bias.

Add to openclaw.json at the top level:

{
  "memory": {
    "backend": "qmd",
    "citations": "auto",
    "qmd": {
      "includeDefaultMemory": true,
      "update": {
        "interval": "5m",
        "debounceMs": 15000
      },
      "limits": {
        "maxResults": 8,
        "timeoutMs": 5000
      },
      "sessions": {
        "enabled": true,
        "retentionDays": 90
      }
    }
  }
}

Also add the query configuration under agents.defaults.memorySearch:

{
  "memorySearch": {
    "query": {
      "hybrid": {
        "enabled": true,
        "vectorWeight": 0.7,
        "textWeight": 0.3,
        "candidateMultiplier": 4,
        "mmr": {
          "enabled": true,
          "lambda": 0.7
        },
        "temporalDecay": {
          "enabled": true,
          "halfLifeDays": 30
        }
      }
    },
    "cache": {
      "enabled": true,
      "maxEntries": 50000
    }
  }
}

Config explained:

  • hybrid search — combines keyword (BM25, weight 0.3) with semantic/vector (weight 0.7) for best of both worlds
  • MMR (Maximal Marginal Relevance) — ensures search results are diverse, not 8 near-identical matches. Lambda 0.7 balances relevance vs diversity.
  • temporalDecay — recent memories rank higher than old ones. 30-day half-life means a memory from today scores 2x higher than one from a month ago.
  • retentionDays: 90 — keeps 90 days of session history searchable
  • update interval: 5m — re-indexes memory files every 5 minutes with 15-second debounce
  • cache: 50000 entries — caches search results for speed

Upgrade 5: Mem0 Plugin (Auto-Capture & Auto-Recall)

What it does: Adds a separate memory layer that automatically captures important information from conversations and automatically recalls relevant memories before the agent responds.

Install:

openclaw plugin install @mem0/openclaw-mem0

Add to openclaw.json under plugins:

{
  "plugins": {
    "slots": {
      "memory": "openclaw-mem0"
    },
    "entries": {
      "openclaw-mem0": {
        "enabled": true,
        "config": {
          "mode": "open-source",
          "autoCapture": true,
          "autoRecall": true,
          "enableGraph": true,
          "topK": 10,
          "searchThreshold": 0.5
        }
      }
    }
  }
}

Config explained:

  • mode: "open-source" — runs locally, no external API calls
  • autoCapture: true — automatically saves important facts from conversations without being told
  • autoRecall: true — automatically searches memory before responding to questions
  • enableGraph: true — builds a knowledge graph of relationships between memories
  • topK: 10 — returns up to 10 relevant memories per search
  • searchThreshold: 0.5 — only returns memories above 50% relevance score

Note: Requires the Ollama npm module. If you see errors about missing ollama module, run:

cd ~/.openclaw/extensions/openclaw-mem0 && npm install ollama

Upgrade 6: Cognee (Optional — Requires Docker)

What it does: Graph-based memory system for advanced knowledge representation.

Status: Optional. Requires Docker to be running. Also flagged by OpenClaw security audit for environment variable harvesting patterns in its code. Recommended to skip unless you have Docker running AND have audited the plugin source code.

If you want to install it anyway:

openclaw plugin install @cognee/cognee-openclaw

Recommendation: Skip this one. Upgrades 1-5 provide comprehensive memory coverage. Cognee adds complexity without proportional benefit for most setups.


How It All Fits Together

Conversation happens
    │
    ├── Mem0 auto-captures important facts (real-time)
    │
    ├── Agent writes to memory/YYYY-MM-DD.md (manual)
    │
    ├── memoryFlush triggers before compaction (automatic, 8 categories)
    │
    └── QMD indexes everything (every 5 min)
            │
            ├── BM25 keyword search
            ├── Vector semantic search
            ├── MMR diversity ranking
            ├── Temporal decay (recent > old)
            └── Session history (90 days)

Next session starts
    │
    ├── Agent reads MEMORY.md + today's daily note
    ├── Mem0 auto-recalls relevant memories
    └── QMD searches across all files + sessions

Verification

After applying all upgrades, restart the gateway:

openclaw gateway restart

Then verify:

openclaw status --deep

You should see:

  • Memory: enabled (plugin openclaw-mem0)
  • Memory backend: qmd
  • Session indexing: active

Test by telling your agent something specific, ending the session, starting a new one, and asking about it. If the memory system is working, it should find it.

Estimated Token Overhead

The memory system adds minimal overhead:

  • memoryFlush: ~2,000-5,000 tokens per compaction event (only when needed)
  • Mem0 auto-recall: ~500-1,000 tokens per query (injected relevant memories)
  • QMD search: runs server-side, no token cost
  • File reading (MEMORY.md + daily notes): depends on file size, typically 2,000-8,000 tokens at session start

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

87.98%
按下载量换算799

安全审计

VirusTotal

可疑

ClawScan

可疑

Static analysis

通过

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills