Bug Description
During reindex (via /api/v1/content/reindex), all memory files under viking://user/memories/ and viking://agent/memories/ are incorrectly tagged with context_type = "resource" instead of "memory".
This causes downstream consumers (e.g. OpenClaw's auto-recall plugin) that filter by context_type == "memory" to miss all reindexed memories.
Root Cause
In openviking/utils/summarizer.py (line ~61), the URI check uses a prefix that doesn't match actual memory paths:
# Current (broken)
if uri.startswith("viking://memory/"):
context_type = "memory"
elif uri.startswith("viking://agent/skills/"):
context_type = "skill"
Actual memory URIs look like:
viking://user/memories/entities/mem_xxx.md
viking://agent/<id>/memories/cases/mem_xxx.md
None of these start with viking://memory/, so they all fall through to the default "resource".
Fix
Use substring matching consistent with core/directories.py:get_context_type_for_uri():
# Fixed
if "/memories" in uri:
context_type = "memory"
elif "/skills" in uri:
context_type = "skill"
Note: core/directories.py already has the correct logic ("/memories" in uri). The summarizer should match.
Impact
ov find works fine (no type filter)
- OpenClaw auto-recall (
context_type == "memory") misses all reindexed memories
- New memories captured via
auto-capture are unaffected (different code path)
Versions Affected
Confirmed in 0.2.9 and 0.2.13.
Workaround
sed -i 's|if uri.startswith("viking://memory/")|if "/memories" in uri|' \
$(python3 -c "import openviking; print(openviking.__path__[0])")/utils/summarizer.py
sed -i 's|elif uri.startswith("viking://agent/skills/")|elif "/skills" in uri|' \
$(python3 -c "import openviking; print(openviking.__path__[0])")/utils/summarizer.py
Then re-run reindex:
curl -X POST http://127.0.0.1:1933/api/v1/content/reindex \
-H "Content-Type: application/json" \
-d '{"uri": "viking://", "regenerate": true, "wait": false}'
Bug Description
During
reindex(via/api/v1/content/reindex), all memory files underviking://user/memories/andviking://agent/memories/are incorrectly tagged withcontext_type = "resource"instead of"memory".This causes downstream consumers (e.g. OpenClaw's auto-recall plugin) that filter by
context_type == "memory"to miss all reindexed memories.Root Cause
In
openviking/utils/summarizer.py(line ~61), the URI check uses a prefix that doesn't match actual memory paths:Actual memory URIs look like:
viking://user/memories/entities/mem_xxx.mdviking://agent/<id>/memories/cases/mem_xxx.mdNone of these start with
viking://memory/, so they all fall through to the default"resource".Fix
Use substring matching consistent with
core/directories.py:get_context_type_for_uri():Note:
core/directories.pyalready has the correct logic ("/memories" in uri). The summarizer should match.Impact
ov findworks fine (no type filter)context_type == "memory") misses all reindexed memoriesauto-captureare unaffected (different code path)Versions Affected
Confirmed in 0.2.9 and 0.2.13.
Workaround
Then re-run reindex: