Summary
When OpenClaw uses the QMD memory backend with session indexing enabled, memory_search returns session hit paths in the generic form:
But memory_get cannot read that path, because the QMD read path resolver expects the real collection name, e.g.:
That breaks the memory_search -> memory_get roundtrip for session-backed QMD results.
Impact
Session hits returned by memory_search are not directly readable via memory_get, even though the underlying QMD collection and document exist and can be queried successfully.
This makes QMD-backed session recall partially unusable in normal agent workflows.
Reproduction
Preconditions
memory.backend=qmd
- session memory / session indexing enabled
- agent-specific QMD session collection exists, e.g.
sessions-coder
Steps
- Index session content into QMD
- Run
memory_search for text known to exist in a session export
- Take a returned path from the result
- Call
memory_get with that exact path
Example
memory_search returns a result like:
qmd/sessions/e497305e-0e44-473e-b8d6-81d0c239ee4a.md
Then memory_get on that exact path fails with:
unknown qmd collection: sessions
Expected behavior
Paths returned by memory_search should be directly consumable by memory_get.
For session-backed QMD hits, that means the returned path should include the real QMD collection name, for example:
qmd/sessions-coder/e497305e-0e44-473e-b8d6-81d0c239ee4a.md
Actual behavior
memory_search serializes session results using the generic source alias:
But memory_get / QMD read-path resolution only accepts real collection keys from collectionRoots, such as:
So the roundtrip fails.
Root cause
This appears to be a path serialization mismatch between QMD search result formatting and QMD read-path resolution:
- search result path uses source alias (
sessions)
- read path resolver expects real collection name (
sessions-<agentId>)
In short:
memory_search returns a generic alias path, while memory_get requires the concrete QMD collection name.
What was verified
- raw QMD collection listing shows a real session collection such as
sessions-coder
- raw QMD search returns file references using the real collection, e.g.
qmd://sessions-coder/...
- OpenClaw search result normalization turns that into
qmd/sessions/...
- QMD read-path resolution rejects
sessions because it is not an actual registered collection key
Suggested fix
Preferred fix
Change memory_search result serialization for QMD session hits so it returns the real collection name:
qmd/sessions-coder/<file>.md
instead of:
This keeps the roundtrip explicit and lossless.
Alternative (less preferred)
Teach memory_get to accept qmd/sessions/... as an alias and map it to the active session collection.
This would work, but it adds implicit aliasing and is less clean than returning a roundtrip-safe path from memory_search in the first place.
Acceptance criteria
memory_search returns roundtrip-safe QMD paths for session hits
memory_get(<path returned by memory_search>) works without manual rewriting
- no regression for normal memory collections
- works for agent-specific session collection names
Notes
The underlying QMD indexing and raw search are working correctly. The bug is specifically in the OpenClaw path mapping layer between search output and read input.
Summary
When OpenClaw uses the QMD memory backend with session indexing enabled,
memory_searchreturns session hit paths in the generic form:qmd/sessions/<file>.mdBut
memory_getcannot read that path, because the QMD read path resolver expects the real collection name, e.g.:sessions-coderThat breaks the
memory_search -> memory_getroundtrip for session-backed QMD results.Impact
Session hits returned by
memory_searchare not directly readable viamemory_get, even though the underlying QMD collection and document exist and can be queried successfully.This makes QMD-backed session recall partially unusable in normal agent workflows.
Reproduction
Preconditions
memory.backend=qmdsessions-coderSteps
memory_searchfor text known to exist in a session exportmemory_getwith that exact pathExample
memory_searchreturns a result like:qmd/sessions/e497305e-0e44-473e-b8d6-81d0c239ee4a.mdThen
memory_geton that exact path fails with:unknown qmd collection: sessionsExpected behavior
Paths returned by
memory_searchshould be directly consumable bymemory_get.For session-backed QMD hits, that means the returned path should include the real QMD collection name, for example:
qmd/sessions-coder/e497305e-0e44-473e-b8d6-81d0c239ee4a.mdActual behavior
memory_searchserializes session results using the generic source alias:qmd/sessions/...But
memory_get/ QMD read-path resolution only accepts real collection keys fromcollectionRoots, such as:sessions-coderSo the roundtrip fails.
Root cause
This appears to be a path serialization mismatch between QMD search result formatting and QMD read-path resolution:
sessions)sessions-<agentId>)In short:
What was verified
sessions-coderqmd://sessions-coder/...qmd/sessions/...sessionsbecause it is not an actual registered collection keySuggested fix
Preferred fix
Change
memory_searchresult serialization for QMD session hits so it returns the real collection name:qmd/sessions-coder/<file>.mdinstead of:
qmd/sessions/<file>.mdThis keeps the roundtrip explicit and lossless.
Alternative (less preferred)
Teach
memory_getto acceptqmd/sessions/...as an alias and map it to the active session collection.This would work, but it adds implicit aliasing and is less clean than returning a roundtrip-safe path from
memory_searchin the first place.Acceptance criteria
memory_searchreturns roundtrip-safe QMD paths for session hitsmemory_get(<path returned by memory_search>)works without manual rewritingNotes
The underlying QMD indexing and raw search are working correctly. The bug is specifically in the OpenClaw path mapping layer between search output and read input.