← 返回
未分类 Key 中文

Dual memory

Run memory-core AND external memory providers (like SuperMemory) together in one slot — with full dreaming support. OpenClaw only allows one memory plugin, s...
在同一槽位中同时运行记忆核心和外部记忆提供者(如 SuperMemory),并提供完整梦境支持。OpenClaw 仅允许一个记忆插件,...
dobrinalexandru
未分类 clawhub v1.0.11 1 版本 100000 Key: 需要
★ 0
Stars
📥 473
下载
💾 0
安装
1
版本
#latest

概述

Dual Memory Plugin

Keep memory-core + dreaming AND add external memory providers like SuperMemory — all in one memory slot. No more choosing between local and cloud.

The Problem

OpenClaw only allows one plugin per kind: "memory". You have to choose between:

  • memory-core — local MEMORY.md, QMD vector search, dreaming (Light/REM/Deep consolidation)
  • External providers like SuperMemory — cloud persistence across sessions, devices, and agents

This plugin eliminates the choice. You get memory-core + dreaming + any external provider in a single slot. The proxy pattern means you never lose native dreaming when adding cloud memory.

How It Works

The plugin legitimately holds the memory slot and delegates to both backends via a proxy pattern:

dual-memory (holds memory slot)
├── Proxy API → memory-core (local)
│   ├── QMD vector search
│   ├── MEMORY.md management
│   └── Dreaming consolidation
└── Proxy API → supermemory (cloud)
    ├── Cloud vector search
    ├── Cross-session persistence
    └── Profile/entity context
  • Searches query both backends, results are merged and deduplicated
  • Writes go to memory-core (local MEMORY.md). SuperMemory captures conversation content automatically via auto-capture hook.
  • Dreaming runs through memory-core's native consolidation cycle
  • Recall injects context from both local (QMD) and cloud (SuperMemory) sources

Install

Via ClawdHub

npx clawhub@latest install dual-memory

Manual

# Clone to extensions
cp -r dual-memory ~/.openclaw/extensions/
cd ~/.openclaw/extensions/dual-memory
npm install

Dependency

This plugin requires openclaw-supermemory as a sibling extension:

~/.openclaw/extensions/
├── dual-memory/   ← this plugin
└── openclaw-supermemory/        ← required sibling

Install supermemory from ClawdHub: npx clawhub@latest install supermemory

Configuration

Add to your OpenClaw config. Disable the individual plugins — the composite replaces them:

plugins:
  entries:
    # Disable individual plugins (composite handles both)
    memory-core:
      enabled: false
    openclaw-supermemory:
      enabled: false
    # Enable composite
    dual-memory:
      enabled: true
      config:
        supermemory:
          apiKey: "${SUPERMEMORY_OPENCLAW_API_KEY}"
          containerTag: "my_agent"
          autoRecall: true
          autoCapture: true
          maxRecallResults: 5
          captureMode: "everything"
        memoryCore:
          dreaming:
            enabled: true
            frequency: "30 2 * * *"

SuperMemory Options

KeyTypeDefaultDescription
---------------------------------
apiKeystringenv varSuperMemory API key (supports ${ENV_VAR})
containerTagstringhostnameIsolates memories per agent/machine
autoRecallbooleantrueAuto-inject relevant memories
autoCapturebooleantrueAuto-store important info
maxRecallResultsnumber5Max memories per conversation (1-20)
captureModestringeverythingCapture mode
profileFrequencynumberProfile refresh interval (1-500)
debugbooleanfalseVerbose logging
enableCustomContainerTagsbooleanfalseAllow multiple containers
customContainersarrayCustom container definitions

Memory Core Options

KeyTypeDefaultDescription
---------------------------------
dreaming.enabledbooleantrueEnable dreaming cycles
dreaming.frequencystringcron exprDreaming schedule

What You Get

Local (memory-core)

  • QMD search — fast local vector search over MEMORY.md and workspace files
  • MEMORY.md management — automatic memory file updates
  • Dreaming — Light (recent recall), REM (consolidation), Deep (pruning) phases
  • Flush plans — controlled memory writes

Cloud (SuperMemory)

  • Cross-session persistence — memories survive restarts, compaction, model switches
  • Cross-device sync — same memories on Mac Mini, Mac Studio, mobile
  • Entity context — user profiles and preferences injected automatically
  • Custom containers — isolate memories per agent or project

Composite Benefits

  • Merged search — queries both backends, deduplicates results by relevance score
  • Dual recall — local QMD results + cloud SuperMemory context injected together. Writes go to memory-core (local MEMORY.md); SuperMemory captures conversation content automatically via its auto-capture hook.
  • Dreaming — runs natively through memory-core's consolidation cycle (Light/REM/Deep phases)
  • Single slot — clean config, no hacks

Architecture

Proxy Pattern

The plugin creates proxy OpenClawPluginApi objects for each sub-plugin. These proxies intercept:

  • registerMemoryRuntime — captures the runtime from each backend
  • registerMemoryPromptSection — captures prompt injection from each
  • registerMemoryFlushPlan — captures flush plans (memory-core only)

After both sub-plugins register, the composite builds unified versions and registers them on the real API.

Files

FilePurpose
---------------
index.tsEntry point — loads backends, registers composite
composite-runtime.tsMerged memory runtime
composite-prompt.tsMerged prompt section
composite-search-manager.tsSearch merging and deduplication
proxy-api.tsProxy API factory
config.tsConfig parsing
openclaw.plugin.jsonPlugin manifest

Requirements

  • OpenClaw >= 2026.1.29
  • Node.js 20+
  • openclaw-supermemory extension (sibling directory)
  • SuperMemory API key (supermemory.com)

Security Notes

  • No hardcoded tokens or keys — API keys are read from config or environment variables only
  • Network calls via SuperMemory client — the plugin instantiates a SupermemoryClient for cloud search. This makes HTTPS calls to SuperMemory's API (api.supermemory.com) to search and store memories. The client comes from the openclaw-supermemory sibling extension. No other network calls are made.
  • Required env var: SUPERMEMORY_OPENCLAW_API_KEY — needed for cloud memory. Get one at supermemory.com. No other env vars are read.
  • No file system writes — memory writes are delegated to memory-core's native flush plan
  • No exec/spawn — no shell commands or child processes
  • Relative sibling imports — this plugin imports from ../openclaw-supermemory/ because OpenClaw's extension loader requires plugins to be co-located. This is the standard pattern for composite plugins that wrap other extensions

Troubleshooting

"both backends failed to load" — Check that openclaw-supermemory exists as a sibling extension and npm install was run in both directories.

"memory-core not available" — The plugin tries to resolve memory-core from OpenClaw's built-in extensions. Make sure your OpenClaw version is >= 2026.1.29.

No cloud memories appearing — Verify SUPERMEMORY_OPENCLAW_API_KEY is set in your environment or .env file.

Dreaming not running — Check that memoryCore.dreaming.enabled is true and you have a cron job configured for the dreaming schedule.

License

MIT

版本历史

共 1 个版本

  • v1.0.11 当前
    2026-05-03 06:58 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Karpathy LLM Memory Wiki

dobrinalexandru
面向 OpenClaw 代理的编译式知识库——投入源文件,生成结构化交叉引用的页面;知识不断累积,而非碎片化。
★ 1 📥 788
developer-tools

Aubrai Longevity Research

dobrinalexandru
使用Aubrai's研究引擎回答关于长寿、衰老、寿命延长和抗衰老研究的问题,附带引用来源。
★ 5 📥 4,020

Agent Brain

dobrinalexandru
本地优先的持久记忆,支持 SQLite 存储的 AI 代理,具备编排的检索/提取循环、混合检索、矛盾检测和纠错学习。
★ 0 📥 764