OpenClaw
The openclaw-statejar plugin takes OpenClaw's memory slot. It recalls the memory each turn needs, captures your messages with secrets removed, and answers OpenClaw's own memory tools from StateJar.
What it does
StateJar takes OpenClaw's memory slot (plugins.slots.memory).
-
autoRecall. Before each turn, the agent gets the memory the message needs. StateJar sends the whole state while it is small, and only the fields a question needs once it is large. Every recall names the handle it came from (
shm_…) and is written to your audit log. -
autoCapture. After each turn, your message is queued on your machine with secrets removed: API keys and tokens, private keys, passwords and card numbers. The agent's reply and tool output are never queued.
- Inside the Gateway, the queue is sent in batches: after three messages, or at session end, compaction, reset and Gateway stop.
- A one-shot
openclaw agentrun sends it at the end of its turn.
StateJar extracts typed facts from the messages, refuses a value that fails its type, and keeps a fact said once in a weak form until it is said again. It stores no transcript.
-
Tools.
memory_searchandmemory_get(the memory slot's own tools, answered from StateJar),statejar_rememberandstatejar_forget. -
Commands.
openclaw statejar init | status | search | add | list | forget | export | pause | resume.
The plugin is openclaw-statejar on npm, open source (MIT) in statejar-integrations.
Install
You need OpenClaw 2026.10.5 or later, with Node 24.16 or later.
openclaw plugins install openclaw-statejar
openclaw statejar init
init does three things, and never writes your key to OpenClaw's config:
- it selects StateJar for the memory slot;
- it turns on autoRecall and autoCapture;
- it grants the plugin's hooks conversation access, which OpenClaw requires of any plugin that reads a turn.
Set it up
Make a developer key on the API keys page and put it in the environment the Gateway runs in:
export STATEJAR_API_KEY="sj_live_…" # macOS, Linux
setx STATEJAR_API_KEY "sj_live_…" # Windows: a new terminal picks it up
The other options live in plugins.entries.statejar.config (openclaw config set …):
| Option | Default | What it does |
|---|---|---|
scope | openclaw | The scope in your account the plugin reads and writes. A new scope builds on your newest memory. |
autoRecall | true | Add the memory each turn needs, as one audited query per turn. |
autoCapture | true | Queue your messages and send them in batches. |
apiUrl | https://api.statejar.com/api/v1 | The REST API the plugin calls. |
If STATEJAR_API_KEY is empty, the plugin uses the key that statejar login (the statejar package on PyPI) keeps.
Check it works
openclaw plugins inspect statejar --runtime --jsonshows the plugin loaded,kind: memory, with its four tools.openclaw statejar statusshows the scope, what is queued, and the last batch's status (202 when accepted).- Tell your agent "I'm Kavya, I live in Bengaluru and my laptop budget is 80000 rupees."
- In a new session, ask "what is my laptop budget?". The answer uses the budget, and
openclaw statejar search what is my budgetprints the memory with its handle.
What it sends
- Leaves your machine: each recall sends the question (your message) to StateJar's query endpoint. Each batch sends your queued messages, with secrets already removed. The agent's replies and tool output are never sent.
- Stays on your machine: the queue lives in
statejar/clients/openclaw, mode 600, beside the credentials file ofstatejar login(~/.configon macOS and Linux,%APPDATA%on Windows). Itsstate.jsonholds only counts, times and the last status code. - What StateJar stores: typed facts, never your messages. Every disclosure is in your audit log, and deleting your account deletes all of it.
openclaw statejar pausestops recall and capture untilopenclaw statejar resume.
Troubleshooting
- Diagnostics say
before_prompt_buildis blocked: runopenclaw statejar init, which grants conversation access. - "plugin tool name conflict (memory-core)" in the log: OpenClaw keeps memory-core loaded beside the slot's plugin. StateJar's
memory_searchandmemory_getare the ones the agent uses;plugins inspectlists them understatejar. - Nothing is recalled:
STATEJAR_API_KEYis not set where the Gateway runs.openclaw statejar statusthen saysnot set. 429inopenclaw statejar status: your plan's per-minute or monthly limit (what each limit counts). The batch stays queued and is sent later.
This page as Markdown: /docs/openclaw.md