Smart memory search with automatic vector fallback. Uses semantic embeddings when available, falls back to built-in search otherwise. Zero configuration - works immediately after ClawHub install. No setup required - just install and memory_search works immediately, gets better after optional sync.
Smart memory search that automatically selects the best method:
Zero configuration required. Works immediately after install.
npx clawhub install vector-memory
Done! memory_search now works with automatic method selection.
node vector-memory/smart_memory.js --sync
After sync, searches use neural embeddings for semantic understanding.
// Same call, automatic best method
memory_search("James principles values")
// If vector ready: finds "autonomy, competence, creation" (semantic match)
// If not ready: uses keyword search (fallback)
Auto-selects best method
Parameters:
query (string): Search querymax_results (number): Max results (default: 5)Returns: Matches with path, lines, score, snippet
Get full content from file.
Index memory files for vector search. Run after edits.
Check which method is active.
| Feature | Built-in | Vector | Smart Wrapper |
|---|---|---|---|
| Synonyms | ❌ | ✅ | ✅ (when ready) |
| Setup | Built-in | Requires sync | ✅ Zero config |
| Fallback | N/A | Manual | ✅ Automatic |
Immediate (no action needed):
node vector-memory/smart_memory.js --search "query"
Better quality (after sync):
# One-time setup
node vector-memory/smart_memory.js --sync
# Now all searches use vector
node vector-memory/smart_memory.js --search "query"
| File | Purpose |
|---|---|
smart_memory.js | Main entry - auto-selects method |
vector_memory_local.js | Vector implementation |
memory.js | OpenClaw wrapper |
None required.
Optional environment variables:
export MEMORY_DIR=/path/to/memory
export MEMORY_FILE=/path/to/MEMORY.md