OpenClaw

@db0-ai/openclaw is a ContextEngine plugin for the OpenClaw multi-agent framework. It replaces OpenClaw's built-in memory with db0's full context lifecycle.

Install

npx @db0-ai/openclaw init

This registers db0 as an OpenClaw plugin and writes default settings to openclaw.json.

What it does

The plugin implements OpenClaw's ContextEngine interface:

Method Description
assemble() Pack relevant memories into the context window each turn
ingest() Process new content into scoped memories
compact() Extract durable facts before conversation compaction
bootstrap() Load initial context on session start
prepareSubagentSpawn() Prepare shared memory for a child agent
onSubagentEnded() Clean up after a child agent finishes

Embedding providers

The plugin auto-detects your embedding provider from environment variables:

Provider Env var Notes
Gemini GEMINI_API_KEY Default when available
OpenAI OPENAI_API_KEY text-embedding-3-small
Ollama OLLAMA_HOST Local, no API key needed
Hash (none) Fallback — deterministic hash, no semantic search

Configuration

Settings live in openclaw.json:

{
  "plugins": {
    "@db0-ai/openclaw": {
      "storage": "./openclaw.db",
      "profile": "agent-context",
      "embedding": "auto"
    }
  }
}

CLI commands

npx @db0-ai/openclaw status      # memory stats
npx @db0-ai/openclaw set <k> <v> # set config value
npx @db0-ai/openclaw get <k>     # get config value
npx @db0-ai/openclaw restore     # restore from backup
npx @db0-ai/openclaw upgrade     # upgrade schema
npx @db0-ai/openclaw uninstall   # remove plugin

Legacy migration

If you have an existing MEMORY.md, the plugin imports it automatically on first run. Entries are converted to db0 memories with the curated-memory profile.