@locusgraph/openclaw-plugin
v0.1.2
Published
LocusGraph memory plugin for OpenClaw — graph-backed memory with semantic search and insights
Maintainers
Readme
@locusgraph/openclaw-plugin
LocusGraph memory plugin for OpenClaw — replaces the built-in memory system with LocusGraph's semantic knowledge graph.
Install
openclaw plugins install @locusgraph/openclaw-pluginConfigure
Set the memory slot and plugin config in your OpenClaw config:
{
"plugins": {
"slots": {
"memory": "memory-locusgraph"
},
"entries": {
"memory-locusgraph": {
"enabled": true,
"config": {
"agentSecret": "${LOCUSGRAPH_AGENT_SECRET}",
"graphId": "my-graph",
"autoRecall": true,
"autoCapture": true,
"recallLimit": 5
}
}
}
}
}Restart the gateway:
openclaw gateway restartAgent Tools
The plugin exposes 4 tools to the agent:
| Tool | Description |
|------|-------------|
| locusgraph_store_event | Store a memory (fact, action, decision, observation, feedback) |
| locusgraph_retrieve_memories | Semantic search over stored memories |
| locusgraph_list_contexts | Browse context types and names for filtering |
| locusgraph_generate_insights | Reason over memories to produce insights |
Lifecycle Hooks
- Auto-Recall (
autoRecall: true) — injects relevant memories into agent context before each turn - Auto-Capture (
autoCapture: true) — stores important agent responses as observations after each turn
CLI
openclaw locusgraph search "what do I know about auth?"
openclaw locusgraph store "The API uses JWT tokens for authentication"
openclaw locusgraph contexts
openclaw locusgraph insights "What patterns exist in our error handling?"Config Reference
| Field | Type | Required | Default | Description |
|-------|------|----------|---------|-------------|
| serverUrl | string | no | https://api.locusgraph.com | LocusGraph API endpoint |
| agentSecret | string | yes | — | Agent authentication secret |
| graphId | string | yes | — | Graph ID for all memory operations |
| autoRecall | boolean | no | false | Inject relevant memories before each turn |
| autoCapture | boolean | no | false | Store key facts from conversations |
| recallLimit | number | no | 5 | Max memories to inject during auto-recall |
Environment Variables
The plugin also respects:
LOCUSGRAPH_SERVER_URL— API base URL (overridden by configserverUrl)LOCUSGRAPH_AGENT_SECRET— Agent secret (use${LOCUSGRAPH_AGENT_SECRET}in config)
Deploy with Vercel Sandbox
Run OpenClaw + LocusGraph in an isolated Vercel Sandbox MicroVM.
Prerequisites
- Vercel account with Sandbox access
- Sandbox CLI installed (
npm i -g sandbox && sandbox login) - An LLM API key (Anthropic, OpenAI, or Vercel AI Gateway)
- A LocusGraph agent secret
1. Create the sandbox
sandbox create \
--timeout 30m \
--publish-port 18789 \
--connectSave the sandbox ID:
export SANDBOX_ID=sbx_xxxxxxxx2. Install OpenClaw + LocusGraph plugin
Inside the sandbox shell:
npm install -g openclaw
openclaw onboard
openclaw plugins install @locusgraph/openclaw-plugin3. Configure the plugin
# Set LocusGraph as the memory backend
openclaw config set plugins.slots.memory memory-locusgraph
# Configure credentials
export LOCUSGRAPH_AGENT_SECRET="your-secret-here"
openclaw config set plugins.entries.memory-locusgraph.enabled true
openclaw config set plugins.entries.memory-locusgraph.config.agentSecret "$LOCUSGRAPH_AGENT_SECRET"
openclaw config set plugins.entries.memory-locusgraph.config.graphId "default"
openclaw config set plugins.entries.memory-locusgraph.config.autoRecall true
openclaw config set plugins.entries.memory-locusgraph.config.autoCapture true4. Start the gateway
nohup openclaw gateway run > /tmp/gateway.log 2>&1 &The dashboard is available at the public URL printed during sandbox creation (https://sb-*-18789.vercel.run). Append the auth token from onboarding output.
5. Lock down egress (recommended)
From your local terminal, restrict outbound traffic to only the services OpenClaw needs:
sandbox config network-policy $SANDBOX_ID \
--network-policy restricted \
--allowed-domain api.locusgraph.com \
--allowed-domain api.anthropic.com \
--allowed-domain web.whatsapp.com \
--allowed-domain mmg.whatsapp.netAdjust --allowed-domain based on your LLM provider:
| Provider | Domain |
|----------|--------|
| Vercel AI Gateway | ai-gateway.vercel.sh |
| Anthropic | api.anthropic.com |
| OpenAI | api.openai.com |
| LocusGraph | api.locusgraph.com |
6. Snapshot for faster restarts
# Create a snapshot (stops the sandbox)
sandbox snapshot $SANDBOX_ID --stop
# Next time, boot from snapshot with egress locked down
sandbox create \
--snapshot snap_xxxxxxxx \
--timeout 1h \
--publish-port 18789 \
--network-policy restricted \
--allowed-domain api.locusgraph.com \
--allowed-domain api.anthropic.comReconnecting
sandbox connect $SANDBOX_IDDevelopment
cd openclaw
pnpm install
pnpm run build
# Link for local dev
openclaw plugins install -l .License
MIT
