Bug Summary
memory_search tool returns empty results despite:
- Database fully populated with chunks and vectors
- OpenAI embeddings working correctly
- FTS and vector search both functional when tested manually
- No errors logged
Environment
- OpenClaw version: 2026.2.3-1
- OS: Linux 6.17.0-12-generic (x64)
- Memory backend: openai (text-embedding-3-small)
- Vector storage: sqlite-vec (v0.1.7-alpha.2)
Steps to Reproduce
- Index memory files with
openclaw memory index --force
- Verify status shows "Indexed: 5/5 files · 21 chunks"
- Run
memory_search with any query:
{"query": "Rock RMS mobile app"}
- Result: Empty array
[] with no errors
Expected Behavior
Search should return relevant chunks from indexed memory files.
Actual Behavior
{
"results": [],
"provider": "openai",
"model": "text-embedding-3-small",
"citations": "auto"
}
Silent failure - no errors in logs, tool reports success but returns no matches.
Diagnostic Data
Database Status (All Healthy)
SELECT COUNT(*) FROM files; -- 5 files
SELECT COUNT(*) FROM chunks; -- 21 chunks
SELECT COUNT(*) FROM chunks_vec; -- 21 vectors (via vec0 extension)
SELECT COUNT(*) FROM chunks_fts; -- 21 rows
Manual Tests (All Pass)
1. OpenAI API Test:
curl https://api.openai.com/v1/embeddings \
-H "Authorization: Bearer sk-..." \
-d '{"input":"Rock RMS","model":"text-embedding-3-small"}'
✅ Returns valid 1536-dim embedding
2. FTS Search Test:
SELECT * FROM chunks_fts WHERE chunks_fts MATCH 'Rock';
✅ Returns 11 matching rows with snippets
3. Vector Similarity Test (Python):
# Using sqlite-vec extension with vec_distance_cosine()
# Query: "Rock RMS mobile"
# Returns:
# Distance: 0.4544 | Path: memory/rock_rms_mobile_guide.md
# Distance: 0.5282 | Path: memory/rock_rms_mobile_guide.md
# ...
✅ Returns 5 relevant chunks with cosine distances
Configuration
{
"agents": {
"defaults": {
"memorySearch": {
"enabled": true,
"sources": ["memory", "sessions"],
"provider": "openai"
}
}
}
}
Vector Table Schema
CREATE VIRTUAL TABLE chunks_vec USING vec0(
id TEXT PRIMARY KEY,
embedding FLOAT[1536]
);
All 21 chunks have valid embeddings stored as JSON arrays.
Root Cause Analysis
The memory_search tool appears to be failing to execute the actual search query, despite:
- ✅ Correctly identifying provider (openai)
- ✅ Loading the database
- ✅ Having valid authentication
- ✅ Having indexed data
The tool returns empty results instead of executing either:
- FTS query against
chunks_fts table
- Vector similarity query against
chunks_vec table
Both work perfectly when tested manually.
Related Issues
Possibly related to:
Workaround
Direct file reading works. Database is accessible and functional — just not through the memory_search tool.
Suggested Fix
Add debug logging to the memory search tool to expose where the query execution fails. Current silent failure makes debugging impossible.
Bug Summary
memory_searchtool returns empty results despite:Environment
Steps to Reproduce
openclaw memory index --forcememory_searchwith any query:{"query": "Rock RMS mobile app"}[]with no errorsExpected Behavior
Search should return relevant chunks from indexed memory files.
Actual Behavior
{ "results": [], "provider": "openai", "model": "text-embedding-3-small", "citations": "auto" }Silent failure - no errors in logs, tool reports success but returns no matches.
Diagnostic Data
Database Status (All Healthy)
Manual Tests (All Pass)
1. OpenAI API Test:
✅ Returns valid 1536-dim embedding
2. FTS Search Test:
✅ Returns 11 matching rows with snippets
3. Vector Similarity Test (Python):
✅ Returns 5 relevant chunks with cosine distances
Configuration
{ "agents": { "defaults": { "memorySearch": { "enabled": true, "sources": ["memory", "sessions"], "provider": "openai" } } } }Vector Table Schema
All 21 chunks have valid embeddings stored as JSON arrays.
Root Cause Analysis
The
memory_searchtool appears to be failing to execute the actual search query, despite:The tool returns empty results instead of executing either:
chunks_ftstablechunks_vectableBoth work perfectly when tested manually.
Related Issues
Possibly related to:
Workaround
Direct file reading works. Database is accessible and functional — just not through the
memory_searchtool.Suggested Fix
Add debug logging to the memory search tool to expose where the query execution fails. Current silent failure makes debugging impossible.