Memory overview
How memory works.
Builtin engine
Default SQLite backend.
Memory search
Search pipeline and tuning.
Active memory
Memory sub-agent for interactive sessions.
memory in openclaw.json. Search defaults use memory.search; per-agent search overrides use agents.entries.*.memory.search.
For the recommended personal-agent workflow, use
memory.search.rememberAcrossConversations. Advanced Active Memory targeting,
model, prompt, and latency controls live under plugins.entries.active-memory.See Active Memory for both activation paths,
transcript persistence, and safe rollout guidance.Remember across conversations
Configure it per agent when only a trusted personal agent should use
cross-conversation transcript recall:
memory.search inheritance with a
per-agent override. When unset, it defaults on only if global
session.dmScope is unset or "main" and no binding has a session.dmScope
override. Any configured DM isolation defaults it off. An explicit true or
false always wins. Enabling it implies session transcript indexing and adds
sessions to the agent’s resolved memory sources.
OpenClaw’s built-in memory provider supports this protected path. Alternate memory providers can keep using their own
recall hooks and advanced Active Memory tools, but this setting is skipped
unless the current provider supports protected private transcript recall.
openclaw doctor reports an unsupported provider or an explicit Active Memory
toolsAllow list that omits memory_search.
The retrieval boundary is narrower than general session search:
- only the same agent’s recognized private conversations are eligible
- the conversation being answered is excluded
- groups and channels are excluded as sources and destinations
- unknown conversation kinds fail closed
- sandboxed recall cannot use the special cross-conversation authorization
tools.sessions.visibility, session keys,
transcript storage, delivery routing, or the permissions of sessions_list,
sessions_history, and sessions_send. Active Memory performs a bounded
read-only retrieval pass; unavailable or timed-out retrieval does not block the
reply.
Provider selection
When
provider is not set, OpenClaw uses OpenAI embeddings. Set provider
explicitly to use Bedrock, DeepInfra, Gemini, GitHub Copilot, Mistral, Ollama,
Voyage, a local GGUF model, or an OpenAI-compatible /v1/embeddings endpoint.
Legacy configs that still say provider: "auto" resolve to openai.
When provider is unset, legacy provider: "auto" is present, or
provider: "none" intentionally selects FTS-only mode, memory recall can still
use lexical FTS ranking when embeddings are unavailable.
Explicit non-local providers fail closed. If you set memory.search.provider to
a concrete remote-backed provider such as Bedrock, DeepInfra, Gemini, GitHub
Copilot, LM Studio, Mistral, Ollama, OpenAI, Voyage, or an OpenAI-compatible
custom provider, and that provider is unavailable at runtime, memory_search
returns an unavailable result instead of silently using FTS-only recall. Fix the
provider/auth configuration, switch to a reachable provider, or set
provider: "none" if you want deliberate FTS-only recall.
Custom provider ids
memory.search.provider can point at a custom models.providers.<id> entry for memory-specific provider adapters such as ollama, or for OpenAI-compatible model APIs such as openai-responses / openai-completions. OpenClaw resolves that provider’s api owner for the embedding adapter while preserving the custom provider id for endpoint, auth, and model-prefix handling. This lets multi-GPU or multi-host setups dedicate memory embeddings to a specific local endpoint:
API key resolution
Remote embeddings require an API key. Bedrock uses the AWS SDK default credential chain instead (instance roles, SSO, access keys, or a Bedrock API key).
For custom OpenAI-compatible providers,
models.providers.<id>.apiKey can name
an API-key or bearer-token profile saved with openclaw models auth,
such as my-embeddings:default. Literal keys keep their configured value even
when other profiles are saved for the provider. Empty keys do not select a saved profile.
Codex OAuth covers chat/completions only and does not satisfy embedding requests.
Remote endpoint config
Useprovider: "openai-compatible" for a generic OpenAI-compatible
/v1/embeddings server that should not inherit global OpenAI chat credentials.
string
Custom API base URL. Provider credentials and headers are inherited only when this resolves to the provider’s configured destination.
string
API key owned by the remote destination. Set this when
remote.baseUrl points somewhere other than the provider’s configured destination.object
Extra HTTP headers owned by the remote destination. Provider defaults are merged only for the provider’s configured destination.
Provider-specific config
Gemini
Gemini
The legacy
gemini-embedding-2-preview identifier remains accepted during
migration to the stable model.OpenAI-compatible input types
OpenAI-compatible input types
OpenAI-compatible embedding endpoints can opt into provider-specific Changing these values affects embedding cache identity for provider batch indexing and should be followed by a memory reindex when the upstream model treats the labels differently.
input_type request fields. This is useful for asymmetric embedding models that require different labels for query and document embeddings.Bedrock
Bedrock
Bedrock embedding config
Bedrock uses the AWS SDK default credential chain plus an OpenClaw-checked bearer token, so no API keys are stored in config. If OpenClaw runs on EC2 with a Bedrock-enabled instance role, just set the provider and model:Supported models (with family detection and dimension defaults):
Throughput-suffixed variants (e.g.,
amazon.titan-embed-text-v1:2:8k) and region-prefixed inference profile IDs (e.g., us.amazon.titan-embed-text-v2:0) inherit the base model’s configuration.Region: resolved in this order: the memory.search.remote.baseUrl override, the models.providers.amazon-bedrock.baseUrl config, AWS_REGION, AWS_DEFAULT_REGION, then a default of us-east-1.Authentication: OpenClaw checks for AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY or AWS_BEARER_TOKEN_BEDROCK first, then falls through to the standard AWS SDK default credential provider chain:- Environment variables (
AWS_ACCESS_KEY_ID+AWS_SECRET_ACCESS_KEY), unlessAWS_PROFILEis also set - SSO (only when SSO fields are configured)
- Shared credentials and config files (
fromIni, includesAWS_PROFILE) - Credential process (
credential_processin the AWS config file) - Web identity token credentials
- ECS or EC2 instance metadata credentials
InvokeModel to the specific model:Local (managed llama.cpp server)
Local (managed llama.cpp server)
Install the official llama.cpp provider, then choose llama.cpp once in
interactive setup. OpenClaw installs a pinned, verified
llama-server and
writes its loopback localService configuration. Default model:
embeddinggemma-300m-qat-Q8_0.gguf (~0.3 GB, auto-downloaded).Use the standalone CLI to verify the same provider path the Gateway uses:openclaw memory status --deep reports
server build, model path, capability, and endpoint facts observed from the
managed server after it has handled an embedding request.Set provider: "local" explicitly for local GGUF embeddings. Full hf:
file references and integrity-bearing HTTPS GGUF URLs are supported for
explicit local configs, but they do not change the default provider.Indexing behavior
Memory engines own synchronization, batching, watch, and post-compaction indexing heuristics. OpenClaw keeps these behaviors enabled with maintained defaults rather than exposing per-install timing switches.File-watcher pressure
The “Memory file watching is tracking …” warning reports an advisory count of watched paths or directories, not a measured host limit or confirmed exhaustion. Remove unnecessarymemory.search.extraPaths entries or narrow their directory
roots. Global entries and agents.entries.<id>.memory.search.extraPaths entries
are combined: an empty per-agent list does not remove global roots. Changing only
an entry’s pattern filters indexed files, not the directory tree being watched.
Removing extra-path entries does not exclude files that still belong to the
default MEMORY.md, USER.md, or memory/ roots. If reducing extra paths is
insufficient, review file-watch and open-file limits on the Gateway host. There is no supported
memory.search.sync.watch setting.
After changes, restart the Gateway. To refresh the affected index, run
openclaw memory index --force --agent <id> on the Gateway host using its profile
and environment, including any OPENCLAW_STATE_DIR or OPENCLAW_CONFIG_PATH
overrides. Use the affected agent’s ID; the command printed in the warning includes
it and the active profile or container hint. See memory index.
Hybrid search config
All undermemory.search.query:
Without a per-call
maxResults, primary-only memory_search calls use this
configured limit, including corpus=memory and corpus=sessions. Wiki and
combined searches (corpus=wiki or corpus=all) keep their separate default
of 10 results. An explicit tool maxResults overrides the applicable default.
Hybrid retrieval remains enabled. The builtin engine always applies a fixed
30-day recency half-life to dated daily notes and a fixed importance
multiplier after hybrid relevance, then applies MMR diversity ordering with a
fixed lambda of 0.7. MEMORY.md, USER.md, and other evergreen memory files
do not decay. Nullable importance is neutral, so no migration or new tuning
key is required for existing indexes.
Strong trigger matches on promoted, trusted entries can inject up to three
compact memories on eligible interactive turns. Today, root MEMORY.md and
USER.md are the curated eligible tier. Daily notes and transcripts are never
auto-injected.
Full example
Additional memory paths
/ separators; direct
file entries are indexed exactly. The builtin engine skips symlinks.
Multimodal memory (Gemini)
Index images and audio alongside Markdown using Gemini Embedding 2:Only applies to files in
extraPaths. Default memory roots stay Markdown-only. Requires gemini-embedding-2 (the legacy preview identifier is also accepted). fallback must be "none"..jpg, .jpeg, .png (images); .mp3, .wav (audio).
Embedding cache
Prevents re-embedding unchanged text during reindex or transcript updates.
Batch indexing
Available for
gemini, openai, and voyage. OpenAI batch is typically fastest and cheapest for large backfills.
Batch enablement is the only remote batching setting. Concurrency, polling, and timeout behavior are provider-owned.
Session memory search
Index session transcripts and surface them viamemory_search:
Internal dreaming-narrative, cron, and heartbeat session transcripts are not
indexed, including retained compressed narrative archives whose live session
metadata is gone. They may quote fragments from user conversations but are not
searchable memory sources. Sessions purged with
openclaw memory forget are also durably excluded,
even though their source transcripts remain in the session store. A forced
reindex removes stale transcript records without readmitting either group.
Ordinary user-session transcripts, including retained, reset, and
deleted-session archives, remain eligible until explicitly targeted.
The session-memory hook saves conversation
excerpts to
<workspace>/memory/, which the memory source already indexes.
If transcript indexing is also enabled, the same conversation can appear from
both memory and sessions, resulting in overlapping search results and
additional embedding work. For hook-only recall, set sources: ["memory"] and
rememberAcrossConversations: false; sources alone is insufficient because
cross-conversation recall automatically adds sessions. For full-transcript
recall instead, run openclaw hooks disable session-memory. Enable both only
when you intentionally want both representations.tools.sessions.visibility. The default
all visibility permits cross-agent session access for unsandboxed callers,
including other users’ transcripts. memory_search remains scoped to the selected
agent’s indexed corpus; use sessions_search for
Gateway-wide transcript search. Cross-agent access is on by default and governed
by tools.agentToAgent; set enabled: false to block ordinary cross-agent access
or use allow to restrict agent pairs; requester-owned native subagent and ACP child sessions stay reachable under tree or all. Set agent for same-agent recall or
tree for current plus spawned scope (main still sees all
same-agent sessions), or self for strict current-session access. A per-peer
DM scope alone does not restrict session-tool recall. Sandbox clamps and
incognito exclusions still apply.
rememberAcrossConversations does not widen that setting. It supplies a
separate runtime-only authorization limited to same-agent private
transcripts during the bounded Active Memory pass.
An explicit memory_search request for the sessions corpus requires session
search to be enabled for that agent. If it is unavailable, OpenClaw explains
how to enable session indexing instead of silently searching memory files.
The examples below place these settings under top-level memory.search. You can also
apply equivalent settings in a per-agent memory.search override when only one
agent should index and search session transcripts.
To keep transcript recall same-agent only, narrow session visibility from the
default all:
SQLite vector acceleration (sqlite-vec)
When sqlite-vec is unavailable, OpenClaw falls back to in-process cosine similarity automatically.
Index storage
Built-in memory indexes live in each agent’s OpenClaw SQLite database atagents/<agentId>/agent/openclaw-agent.sqlite.
Citations
memory.citations controls citation visibility for built-in memory results:
Memory admission policy
Configure session exclusions for dreaming ingestion and session backfill underplugins.entries.memory-core.config.memoryPolicy.excludeSessions. These
settings do not disable transcript search, restrict workspace writes, or
erase existing memories. See
Memory provenance and deletion for coverage and
deletion workflows.
Every setting is optional. Omitted or empty arrays add no exclusions;
the normal provenance and session-kind gates still apply. Configured strings
are trimmed, with empty values dropped, then matched exactly and case-sensitively.
There are no glob patterns, substring matches, or message-content searches.
Hook sources are exact identifiers: IMAP uses
email, Gmail hooks use gmail,
and generic webhooks use webhook. To exclude both IMAP and Gmail ingestion,
set hookExternalContentSources: ["email", "gmail"].
Lists combine with OR. For example, configuring a hook source and
chatTypes: ["group"] excludes that hook source and every group session,
not just group sessions from that source. Matching uses retained live session
metadata through the configured session.store, including custom and shared
stores, scoped to the source agent. Missing metadata does not match a rule.
Older retained records may contain only a coarse webhook classification;
when the original exact source is gone, neither email nor webhook is
inferred for matching. Explicitly forget those sessions by full ID when needed.
Automatic dreaming separately skips retained archives; these lists do not
establish whether another memory path can read an archived transcript.
excludedReason as
hookExternalContentSource:<source>,
channel:<channel>, or chatType:<type>, in that precedence order.
Removing the rule makes the session eligible for a later sweep, subject to
the other ingestion gates.
Sessions selected by memory forget are checked
first and receive the reason forgotten. Their durable per-agent exclusion
also applies to session backfill and transcript indexing, and removing a
configured rule does not undo it. It excludes the selected IDs, not every
future session from the same source.
Adding a rule does not remove an existing corpus, short-term candidate, or
promoted memory. Preview existing attributable artifacts with
memory forget --dry-run, then review its
deletion boundaries
before applying it. Source session transcripts remain in the session store.
Dreaming
Dreaming is configured underplugins.entries.memory-core.config.dreaming, not under memory.search.
Dreaming runs as one scheduled sweep and uses internal light/deep/REM phases as an implementation detail.
For conceptual behavior and slash commands, see Dreaming.
User settings
Example
- Dreaming writes machine state to
memory/.dreams/. - Dreaming writes human-readable narrative output to
DREAMS.md(or existingdreams.md). - Deep consolidation stores the prior
MEMORY.mdin SQLite-backed plugin state and records rewrite counts and highlights inDREAMS.md. - Untrusted and system-derived candidates are structurally excluded before consolidation and durable promotion.
dreaming.modeluses the existing plugin subagent trust gate; setplugins.entries.memory-core.subagent.allowModelOverride: truebefore enabling it.- Dream Diary retries once with the session default model when the configured model is unavailable. Trust or allowlist failures are logged and are not silently retried.
- The light/deep/REM phase policy and thresholds are internal behavior, not user-facing config.