openclaw - 💡(How to fix) Fix memory_search corpus=sessions returns 0 results despite being documented parameter

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

The openclaw.json memorySearch configuration does not include session transcript files as an indexed source. Only memory/ and extraPaths (Wiki) are indexed. The session JSONL files in ~/.openclaw/agents/<agentId>/sessions/ are never processed by the embedding pipeline.

Fix Action

Workaround

Using rg -l for keyword-based file locating (~0.04s) followed by jq for content extraction provides a functional alternative, but lacks semantic search capabilities (fuzzy matching, synonym resolution, relevance ranking).

RAW_BUFFERClick to expand / collapse

Bug Description

The memory_search tool accepts corpus=sessions as a documented parameter, but it returns 0 results for any query because session transcript JSONL files are not indexed by the memory search system.

Expected Behavior

memory_search corpus=sessions should return semantic search results from session transcript files, similar to how corpus=all returns results from memory/ and Wiki files.

Actual Behavior

memory_search corpus=sessions returns 0 hits for any query. The response includes hits=0 despite session JSONL files existing in the agents directory.

Environment

  • OpenClaw version: running on Node.js v26.0.0
  • Session directory: ~/.openclaw/agents/main/sessions/ with 632 session JSONL files + ~590 trajectory files (~966MB total)
  • Memory search config: Ollama bge-m3 embedding, hybrid retrieval (vector 0.7 + BM25 0.3)
  • index-health.json shows only one source: memory (399 files, 2843 chunks) — no session source exists

Root Cause

The openclaw.json memorySearch configuration does not include session transcript files as an indexed source. Only memory/ and extraPaths (Wiki) are indexed. The session JSONL files in ~/.openclaw/agents/<agentId>/sessions/ are never processed by the embedding pipeline.

Workaround

Using rg -l for keyword-based file locating (~0.04s) followed by jq for content extraction provides a functional alternative, but lacks semantic search capabilities (fuzzy matching, synonym resolution, relevance ranking).

Suggested Fix

Either:

  1. Add session JSONL files as an indexed source in memorySearch configuration (with appropriate chunking for JSONL format)
  2. Remove corpus=sessions from the documented parameter if it is intentionally not supported
  3. Document the current limitation clearly in the tool schema or documentation

Option 1 would require:

  • JSONL-aware chunking (each line is a separate JSON object, not a natural text document)
  • Filtering trajectory and checkpoint files (they contain duplicated/highly overlapping content)
  • Incremental indexing as sessions grow (avoid re-embedding the full ~966MB on each update)

Impact

Users expecting corpus=sessions to work will get silently empty results, which is confusing and breaks the documented Cold layer retrieval strategy.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix memory_search corpus=sessions returns 0 results despite being documented parameter