Create a 3-tier memory directory structure for OpenClaw agents and configure semantic
search using Google Gemini Embeddings 2.
⚠️ After setup, the agent's memory_search tool sends memory file content to
Google's Gemini embedding API for vectorization. This is how semantic search works —
files must be embedded to be searchable. The setup script itself makes no external calls.
Google Gemini API key — free at https://aistudio.google.com/apikey
bash scripts/setup_memory_v2.sh /path/to/agent/workspace
Creates: memory/, memory/hot/, memory/warm/, stub .md files, heartbeat-state.json.
Add under agents.defaults:
"memorySearch": { "provider": "gemini" },
"compaction": { "mode": "safeguard" },
"contextPruning": { "mode": "cache-ttl", "ttl": "1h" },
"heartbeat": { "every": "1h" }
Set API key: export GEMINI_API_KEY=your-key
Enable plugin: "lossless-claw": { "enabled": true }
openclaw gateway restart
memory/hot/HOT_MEMORY.md) — Active session state, pending actionsmemory/warm/WARM_MEMORY.md) — Stable preferences, referencesMEMORY.md) — Long-term milestones and distilled lessonsLossless Claw (@martian-engineering/lossless-claw) — compacts old context into
expandable summaries to prevent amnesia. Install separately:
openclaw plugins install @martian-engineering/lossless-claw
共 1 个版本