Summary
When using the qmd backend for memory_search, search results may be silently dropped if the collection names in the qmd database don't match what OpenClaw expects.
Environment
- OpenClaw version: 2026.2.3-1
- qmd version: 0.7.x (external CLI)
- OS: macOS (arm64)
Steps to Reproduce
- Have a pre-existing qmd database with collections named
memory, clawd, life
- Configure OpenClaw to use qmd backend with
memory.qmd.command pointing to external qmd
- OpenClaw creates its own isolated qmd environment at
~/.openclaw/agents/<agentId>/qmd/xdg-cache/
- When the isolated qmd inherits or copies collection contexts from an external source, collection names may be
memory instead of memory-dir
- Call
memory_search - results are returned as empty despite qmd query returning valid results
Root Cause
In qmd-manager.ts, the resolveDocLocation() function looks up collection paths using:
const root = this.collectionRoots.get(collection);
if (!root) return null; // <-- returns null, result dropped
The collectionRoots map is populated with OpenClaw's expected collection names:
memory-root (for MEMORY.md)
memory-alt (for memory.md)
memory-dir (for memory/**/*.md)
- Custom paths from config
But the qmd database may have collections named differently (e.g., memory instead of memory-dir), causing the lookup to fail.
Workaround
Delete the agent's qmd cache to force recreation:
rm -rf ~/.openclaw/agents/main/qmd/xdg-cache/qmd/
Then trigger a memory search - OpenClaw will recreate the collections with correct names.
Suggested Fix
- In
resolveDocLocation(), add fallback logic to handle collection name variations
- Or: in
ensureCollections(), detect and rename existing collections to match expected names
- Or: better document that external qmd databases should not be mixed with OpenClaw's isolated environment
Additional Issue: Timeout
A related issue: qmd query with local LLM query expansion can take 10-20 seconds. The default memory.qmd.limits.timeoutMs of 6000ms is too short, causing frequent timeouts. When qmd times out, it may return "No results found.\n" instead of valid JSON, causing JSON parse errors.
Suggest increasing default timeout to 30000ms or making it more prominent in documentation.
Summary
When using the qmd backend for
memory_search, search results may be silently dropped if the collection names in the qmd database don't match what OpenClaw expects.Environment
Steps to Reproduce
memory,clawd,lifememory.qmd.commandpointing to external qmd~/.openclaw/agents/<agentId>/qmd/xdg-cache/memoryinstead ofmemory-dirmemory_search- results are returned as empty despite qmd query returning valid resultsRoot Cause
In
qmd-manager.ts, theresolveDocLocation()function looks up collection paths using:The
collectionRootsmap is populated with OpenClaw's expected collection names:memory-root(forMEMORY.md)memory-alt(formemory.md)memory-dir(formemory/**/*.md)But the qmd database may have collections named differently (e.g.,
memoryinstead ofmemory-dir), causing the lookup to fail.Workaround
Delete the agent's qmd cache to force recreation:
rm -rf ~/.openclaw/agents/main/qmd/xdg-cache/qmd/Then trigger a memory search - OpenClaw will recreate the collections with correct names.
Suggested Fix
resolveDocLocation(), add fallback logic to handle collection name variationsensureCollections(), detect and rename existing collections to match expected namesAdditional Issue: Timeout
A related issue:
qmd querywith local LLM query expansion can take 10-20 seconds. The defaultmemory.qmd.limits.timeoutMsof 6000ms is too short, causing frequent timeouts. When qmd times out, it may return "No results found.\n" instead of valid JSON, causing JSON parse errors.Suggest increasing default timeout to 30000ms or making it more prominent in documentation.