Google Vertex AI Memory Bank
Install and configure the OpenClaw Vertex AI Memory Bank plugin for persistent, cross-agent memory. Use when the user wants long-term memory, cross-session r...
Like a lobster shell, security has layers — review code before you run it.
License
SKILL.md
Vertex AI Memory Bank Plugin
Give your OpenClaw agent persistent, cross-agent memory powered by Google's Vertex AI Memory Bank.
What This Does
After setup, your agent will:
- Auto-recall: Before each turn, relevant memories are retrieved and injected into context
- Auto-capture: After each turn, facts are extracted and stored automatically
- File sync: Workspace files (MEMORY.md, USER.md, SOUL.md) sync to Memory Bank with hash tracking
- Cross-agent: Tell one agent something, all agents remember it
Prerequisites
Before running the setup script, ensure:
- Google Cloud SDK installed and authenticated (
gcloud auth application-default login) - A GCP project with billing enabled
- Vertex AI API enabled on the project
- Node.js 18+ and npm installed
If the user doesn't have these, help them set up each one.
Installation
Run the setup script:
bash scripts/setup.sh
This script will:
- Check for required tools (gcloud, npm, node)
- Prompt for GCP project ID and region
- Create a Vertex AI Agent Engine reasoning engine (Memory Bank instance)
- Install the npm plugin package
- Add the plugin configuration to openclaw.json
- Restart the gateway to load the plugin
Manual Installation
If the script doesn't work for your environment, follow these steps:
Step 1: Create a Memory Bank Instance
# Set your project
gcloud config set project YOUR_PROJECT_ID
# Create a reasoning engine for Memory Bank
curl -X POST \
"https://REGION-aiplatform.googleapis.com/v1beta1/projects/YOUR_PROJECT_ID/locations/REGION/reasoningEngines" \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
-d '{"display_name": "openclaw-memory-bank"}'
Note the reasoning engine ID from the response.
Step 2: Install the Plugin
cd /path/to/openclaw-vertex-memorybank
npm install
npm run build
Step 3: Configure openclaw.json
Add to your openclaw.json under plugins:
{
"plugins": {
"openclaw-vertex-memorybank": {
"enabled": true,
"path": "/path/to/openclaw-vertex-memorybank",
"config": {
"projectId": "YOUR_PROJECT_ID",
"location": "us-central1",
"reasoningEngineId": "YOUR_REASONING_ENGINE_ID"
}
}
}
}
Step 4: Restart
openclaw gateway restart
Configuration Options
| Option | Default | Description |
|---|---|---|
projectId | required | GCP project ID or number |
location | required | GCP region (e.g. us-central1) |
reasoningEngineId | required | Agent Engine reasoning engine ID |
autoRecall | true | Retrieve memories before each turn |
autoCapture | true | Store memories after each turn |
autoSyncFiles | true | Sync workspace .md files to Memory Bank |
autoSyncTopics | true | Auto-configure memory topics at startup |
topK | 10 | Max memories to retrieve per query |
perspective | "third" | Memory perspective (first or third person) |
backgroundGenerate | true | Fire-and-forget memory generation |
ttlSeconds | none | Auto-expire memories after N seconds |
Verifying It Works
After installation, check the gateway log:
tail -f ~/.openclaw/logs/gateway.log | grep memory
You should see:
[memory-vertex] synced N topicson startup[memory-vertex] recall: N memorieson each turn[memory-vertex] capture fired (bg)after each turn
CLI Commands
The plugin adds these commands:
memorybank-search <query>- Search your memoriesmemorybank-remember <fact>- Store a specific factmemorybank-forget <memory_id>- Delete a memorymemorybank-sync- Force sync workspace filesmemorybank-status- Check plugin statusmemorybank-list- List all stored memories
Troubleshooting
- "401 Unauthorized": Run
gcloud auth application-default login - "Memory Bank not found": Check reasoningEngineId matches your instance
- No memories recalled: Check
topKandmaxDistancesettings. Trymemorybank-searchto verify memories exist - High token usage: Reduce
topKor setintrospection: "off"to remove similarity scores
Source
Full source code and documentation: https://github.com/Shubhamsaboo/openclaw-vertexai-memorybank
Files
2 totalComments
Loading comments…
