← Back to .tech
OPEN SOURCE / OPENCLAW

OpenWave

Autonomic long-term memory for OpenClaw agents. Pulls the right memories into every turn before the model sees the prompt. Runs the sleep system — slow-wave/REM consolidation, awake replay, LLM fact extraction — in-process. The engine is sharpwave-core, bundled at build time. Free, MIT, open source.

openclaw plugins install clawhub:openwave --accept-capabilities
Autonomic Wake In-Process Sleep Zero Amnesia Multi-Agent No Child Process

Wake up already knowing. Memory is there before the first turn. Sleep runs on its own schedule.

Why a plugin instead of an MCP server?

SharpWave works great as a standalone MCP server for Claude Code, Cursor, Claude Desktop, and any other MCP client. But OpenClaw agents are different — they run continuously, they wake up autonomously, they sleep and consolidate. An MCP child process is structurally a tool the agent has to remember to call. OpenClaw agents don't call tools to remember — they wake up already knowing.

OpenWave is the same engine, but it lives inside the agent process. Memory is there before the first prompt. Sleep runs without scheduling it. Wake-up injections don't have to cross a process boundary, and the database sits in your agent's own data dir — not behind a socket you have to keep alive.

Full persistence. Same engine. Different surface.

What it adds over the MCP server

Autonomic wake-up

Before every turn, every heartbeat, and every compaction, OpenWave pulls the memories relevant to what the agent is about to do and injects them into context. Identity and goals ride in as a never-compacted system header. Query-relevant recall, always-on operational rules, and a last-24h activity digest ride in as prepended context. No tool call. The agent never has to remember to look.

In-process sleep

Consolidation runs inside the agent's process on timers — slow-wave and REM pass, awake replay, LLM fact extraction. No scheduling overhead. No separate service to keep alive. Patterns promote into semantic nodes; noise gets pruned.

Full persistence

The database is on disk in your agent's own data dir (~/.sharpwave/<agentId>/brain.db). No external service to crash, no MCP round-trip to time out. Memory is always there.

Same engine, two surfaces

The retrieval, consolidation, FSRS decay, graph edges — all of it is the exact same sharpwave-core code that ships in the standalone npx -y sharpwave MCP server. Bundled at build time, so each surface always ships the engine it was built against.

Multi-agent by design

One OpenWave process serves any number of agents. Each agent's brain lives in its own SQLite file — isolated, never cross-contaminated — listed in config.agents. Add an agent, add its id to the list. That's it.

OpenClaw native

Drop-in plugin. Loads with OpenClaw's standard plugin system on startup ("activation": { "onStartup": true }). Hooks before_prompt_build, agent_turn_prepare, llm_output, agent_end — the lifecycle surface OpenClaw exposes for memory.

Install

OpenWave installs like any OpenClaw plugin. Three options — pick the one that fits how you source your stack.

From ClawHub (recommended)

openclaw plugins install clawhub:openwave --accept-capabilities

From npm

openclaw plugins install npm:openwave --force --accept-capabilities
cd ~/.openclaw/npm/projects/openwave && npm rebuild better-sqlite3

The npm rebuild step is required. OpenClaw's plugin installer runs npm install --ignore-scripts, so better-sqlite3's native binary isn't fetched or built during install. Skip the rebuild and every db.init fails with "Could not locate the bindings file". Re-run it after any openclaw plugins update openwave.

From source (development)

git clone https://github.com/Enlightened-Republic/openwave
cd openwave && npm install && npm run build

Then point plugins.load.paths at the checkout directory (not dist/index.js — OpenClaw reads openclaw.plugin.json next to it):

{
  "plugins": {
    "load": { "paths": ["/abs/path/to/openwave"] }
  }
}

Configure openclaw.json

All three install methods converge on the same config block. If you have a plugins.allow allowlist, OpenWave has to be in it.

{
  "plugins": {
    // If plugins.allow is set, openwave MUST be in it (exclusive allowlist).
    "allow": ["...your other plugin ids...", "openwave"],
    "entries": {
      "openwave": {
        "enabled": true,
        "hooks": { "allowConversationAccess": true },
        "config": { "agents": ["main"] }
      }
    }
  }
}

Why each field

Restart & confirm

Restart the gateway with a full restart, not a soft reload: openclaw gateway restart.

Confirm from the log — you should see both lines:

[openwave] {"op":"register","outcome":"ok","agents":<N>,"tools":16,...}
[openwave] {"op":"gateway_start","outcome":"ready",...}

Compatibility: pluginApi >= 2026.5.0, minGatewayVersion 2026.5.0. Older gateways don't expose the hook and session-workflow surface OpenWave needs.

What the agent sees at wake-up

OpenWave hooks OpenClaw's turn lifecycle. On every session start, every turn, every heartbeat, and every compaction it pulls the memories relevant to what the agent is about to do out of that agent's brain and injects them into context automatically. The agent wakes up already knowing.

First-open runs the additive-only schema migration to v17 (adds nodes.inject_count / nodes.inject_hits, backfills 0 — no data loss).

What runs while the agent sleeps

Sleep is in-process, on timers, no scheduling required.

Tools — all 16

OpenWave registers all 16 brain_* tools. Definitions and executors come from sharpwave-core's unified tool module — so OpenWave and the standalone SharpWave MCP server can't expose a drifted schema. (The MCP server publishes a narrower 11-tool subset.)

Most memory work needs no tool call — OpenWave injects and logs automatically. The tools are for deliberate deep recall (brain_query), deliberate writes (brain_write), and introspection.

ToolWhat it does
brain_queryHybrid FTS + vector + spreading activation. The core recall call.
brain_writeStore a memory node. Auto-queues for embedding and PRISM/NEXUS auto-linking.
brain_linkCreate a typed edge between two existing nodes.
brain_supersedeReplace a stale node with updated content. Keeps graph temporal integrity.
brain_statsNode/edge/episode counts, neuromodulator state, consolidation status, embedding coverage.
brain_historySearch raw conversation turns (episodes) by keyword.
brain_expandFull detail for a node: content, FSRS metrics, encoding context, source episodes.
brain_reviewApply an FSRS-6 spaced-repetition review. Updates stability, retrievability, SIGMA.
brain_forgetPhysically delete a node. Refuses if the node has active edges (pass force=true).
brain_edgesGet all active incoming and outgoing edges for a node.
brain_resetWipe the brain back to empty. Agent-callable. Guarded: confirm must match the agent id; a timestamped .db backup is taken first. Never DROP — just DELETE FROM learned-state tables and re-seed an empty self-model.
brain_update_self_modelUpdate the agent's self-model nodes — identity, goals, operational rules — that ride in as the never-compacted system header.
brain_reflectRun a reflection pass over recent episodes; promote durable patterns into semantic nodes.
brain_generate_skillGenerate a draft reusable skill from patterns that have repeated enough times. Output goes to workspaceSkillsDir.
brain_workspaceRead / write files in the agent's workspace skills dir (the output target for skill evolution).
brain_docsSearch the configured brainDocsDir corpus for procedural context.

What it gives your OpenClaw agent

How it fits in the architecture

Three packages, two repos. The engine is the same; the surfaces are different.

OpenWave and the sharpwave MCP server read and write the same files with the same engine code. An agent can be moved between them with no data migration. First open runs the additive-only schema migration to v17.

Brain dbs live at ~/.sharpwave/<agentId>/brain.db (plus SQLite -wal / -shm sidecars). Redirect with SHARPWAVE_DATA_DIR (parent dir) or SHARPWAVE_DB_PATH (exact file).

SharpWave vs OpenWave

Same engine. Two surfaces.

SharpWave is the standalone MCP server — point any MCP client at it and go. Works with Claude Code, Cursor, Claude Desktop, any MCP client. 11 brain_* tools, the headline subset.

OpenWave is the OpenClaw plugin version — same engine, but with in-process autonomic wake-up that injects memory into every turn, and the sleep system runs inside your agent's process. Full persistence, no child process, all 16 brain_* tools.

Learn more about SharpWave → ← Back to .tech