Skip to main content
Plugin options are settings you give Memory Crystal so it knows how to connect and behave.

What this means in practice

Important plugin-facing settings include things like:
  • API key / backend URL
  • default recall mode
  • default recall limit
  • optional global channel scoping
  • optional per-agent scope policies
  • local summary behavior

Most important options

One API key, mixed agent scopes

The shipped model now supports one API key for both private and shared agents. Use:
  • mode: "peer" for agents like coach or coach-beta
    • captures/recalls resolve to scope:{peerId}
    • use this for strict per-client isolation
  • mode: "shared" for internal/content agents like dm-replies, support-bot, social-media, etc.
    • captures/recalls resolve to scope:main
    • use this for open/shared knowledge across chats
Example:
Behavior:
  • explicit agentScopePolicies override channelScope
  • if no policy matches, Memory Crystal falls back to the legacy/global channelScope
  • this preserves backward compatibility for existing installs

OpenClaw direct-session peer derivation

Some self-hosted OpenClaw deployments provide the peer id only in the session key, for example:
For those deployments, peer policies can opt into this exact OpenClaw direct session-key shape:
This is disabled by default. It only applies to matching mode: "peer" policies, requires the session agent id to match the policy agentId, accepts only agent:<agentId>:<channel>:<account>:direct:<numericPeerId>, and still rejects reserved peers such as main, default, and unknown. Memory search/message tool results are exact-channel filtered before they are surfaced.

Installer behavior

The installer/enabler is now conservative:
  • if you already set contextEngineMode, localStoreEnabled, or dbPath, it preserves those choices
  • if local SQLite (better-sqlite3) is available and you have not explicitly configured those fields, it automatically enables:
    • localStoreEnabled: true
    • contextEngineMode: "full"
  • if SQLite is unavailable, it leaves installs safely in reduced mode

How it actually works

The main plugin config shape is defined in:
  • plugin/openclaw.plugin.json
The runtime behavior around those options is implemented in:
  • plugin/index.js
Operational scripts also matter:
  • scripts/crystal-enable.sh
  • scripts/crystal-doctor.sh

Commands / examples

Safe validation:

Common mistakes

  • reading the legacy hook manifest and assuming it is the only config surface
  • documenting defaults without checking the actual plugin schema
  • forgetting the operational scripts that wire the plugin into OpenClaw

Source of truth

Primary files behind this page:
  • plugin/openclaw.plugin.json
  • plugin/index.js
  • scripts/crystal-enable.sh
  • scripts/crystal-doctor.sh