What it provides
- Keyword search via FTS5 full-text indexing (BM25 scoring).
- Vector search via embeddings from any supported provider.
- Hybrid search that combines both for best results.
- Deterministic ranking by relevance, recency, and write-time importance.
- Trusted trigger recall for bounded pre-reply context without a recall model.
- CJK support via trigram tokenization for Chinese, Japanese, and Korean.
- sqlite-vec acceleration for in-database vector queries (optional).
Getting started
By default, the builtin engine uses OpenAI embeddings. IfOPENAI_API_KEY or
models.providers.openai.apiKey is already configured, vector search works
with no extra memory config.
To set a provider explicitly:
local.modelPath at a GGUF file:
Supported embedding providers
Set
memory.search.provider to switch away from OpenAI.
How indexing works
OpenClaw indexesMEMORY.md, an existing root USER.md, and memory/*.md into
chunks (400 tokens with 80-token overlap by default) and stores them in a
per-agent SQLite database. OpenClaw does not create USER.md automatically.
Each chunk can carry nullable importance and trigger metadata. Null values are
neutral, so older indexes remain usable. Search combines hybrid relevance,
recency decay, and importance; trigger recall only injects curated or
promoted-trusted entries.
Each indexed chunk also has SQLite-owned provenance: origin class (owner,
agent, untrusted, or system), session kind, observation time, and an
optional supersession key. This metadata is stored separately from Markdown
so recalled prose cannot rewrite its own trust classification.
- Index location: the owning agent database at
~/.openclaw/agents/<agentId>/agent/openclaw-agent.sqlite - Storage maintenance: SQLite WAL sidecars are bounded with periodic and shutdown checkpoints.
- File watching: changes to memory files trigger a debounced reindex (1.5s default).
- Auto-reindex: the index rebuilds automatically when the embedding provider, model, chunking config, configured sources, or scope change.
- Reindex on demand:
openclaw memory index --force
You can also index Markdown files outside the workspace with
memory.search.extraPaths. See the
configuration reference.When to use
The builtin engine is the right choice for most users:- Works out of the box with no extra dependencies.
- Handles keyword and vector search well.
- Supports all embedding providers.
- Hybrid search combines the best of both retrieval approaches.
Troubleshooting
Memory search disabled? Checkopenclaw memory status. If no provider is
detected, set one explicitly or add an API key.
Local provider not detected? Confirm the local path exists and run:
local provider id.
Set memory.search.provider: "local" when you want local embeddings.
Stale results? Run openclaw memory index --force to rebuild. The watcher
may miss changes in rare edge cases.
sqlite-vec not loading? OpenClaw falls back to in-process cosine
similarity automatically. openclaw memory status --deep reports the local
vector store separately from the embedding provider, so Vector store: unavailable points at sqlite-vec loading while Embeddings: unavailable
points at provider/auth or model readiness. Check logs for the specific load
error.