Bug: CLI memory search returns empty results despite embedding model and vector data being correct
Environment
- macOS 15.3 (arm64)
- Node.js 23.11.1 (via nvm)
- OpenClaw 2026.2.26
- Memory provider:
local (embeddinggemma-300m-qat-Q8_0.gguf)
- Plugin slot:
memory-core
Summary
The CLI command openclaw memory search <query> returns "No matches" even though:
- ✅ Embedding model loads successfully (768 dimensions)
- ✅ Vector data is correctly stored (4 chunks indexed)
- ✅ Vector search works when tested directly via Node.js
- ❌ CLI search returns empty
Steps to Reproduce
-
Configure local embedding model:
{
"agents": {
"defaults": {
"memorySearch": {
"provider": "local",
"local": {
"modelPath": "/path/to/embeddinggemma-300m-qat-Q8_0.gguf"
}
}
}
}
}
-
Index memory files:
npx openclaw memory index --force
# Output: Memory index updated (main).
-
Check status:
npx openclaw memory status
# Shows: Indexed: 2/2 files · 4 chunks
# Vector: ready, Vector dims: 768
# Batch: disabled (failures 0/2) ← Problem indicator
-
Search:
npx openclaw memory search "test"
# Output: No matches
Expected Behavior
Should return matching chunks from indexed memory files.
Actual Behavior
Returns "No matches" even for keywords that exist in indexed files.
Diagnosis
I've verified the embedding model works correctly:
// Direct test via Node.js
const { getLlama, resolveModelFile } = await import('node-llama-cpp');
const llama = await getLlama();
const model = await llama.loadModel({ modelPath: resolvedPath });
const context = await model.createEmbeddingContext();
const embedding = await context.getEmbeddingFor('智谱');
console.log(embedding.vector.length); // 768 ✅
Vector search also works when tested directly with sqlite-vec:
SELECT c.id, c.text, vec_distance_cosine(v.embedding, ?) as distance
FROM chunks_vec v JOIN chunks c ON c.id = v.id
ORDER BY distance ASC
-- Returns correct results ✅
The issue appears to be in the CLI's MemoryManager.search() method:
this.provider is not being initialized correctly for CLI commands
- The code falls into FTS-only mode, but FTS5 is unavailable in Node.js built-in SQLite
- Result: empty array returned
Workaround
Using memory-lancedb-pro plugin works correctly (different embedding provider).
Related
- Node.js SQLite doesn't include FTS5 extension (by design)
- The
Batch: disabled (failures 0/2) in status suggests embedding provider initialization failed silently
Bug: CLI
memory searchreturns empty results despite embedding model and vector data being correctEnvironment
local(embeddinggemma-300m-qat-Q8_0.gguf)memory-coreSummary
The CLI command
openclaw memory search <query>returns "No matches" even though:Steps to Reproduce
Configure local embedding model:
{ "agents": { "defaults": { "memorySearch": { "provider": "local", "local": { "modelPath": "/path/to/embeddinggemma-300m-qat-Q8_0.gguf" } } } } }Index memory files:
npx openclaw memory index --force # Output: Memory index updated (main).Check status:
Search:
Expected Behavior
Should return matching chunks from indexed memory files.
Actual Behavior
Returns "No matches" even for keywords that exist in indexed files.
Diagnosis
I've verified the embedding model works correctly:
Vector search also works when tested directly with sqlite-vec:
The issue appears to be in the CLI's
MemoryManager.search()method:this.provideris not being initialized correctly for CLI commandsWorkaround
Using
memory-lancedb-proplugin works correctly (different embedding provider).Related
Batch: disabled (failures 0/2)in status suggests embedding provider initialization failed silently