Skip to content

experimental.sessionMemory does not surface gateway-dispatched sessions in memory_search #53550

@shivasymbl

Description

@shivasymbl

Environment

  • OpenClaw: 2026.3.13 (61d171a)
  • LCM (lossless-claw): 0.5.0 (contextEngine slot)
  • Node.js: 22.22.1
  • OS: Ubuntu 24.04 (Linux 6.8.0)
  • Memory provider: QMD with Gemini embeddings (gemini-embedding-2-preview)
  • Graphiti plugin: enabled (not contextEngine)
  • dmScope: per-peer

Description

When agents.defaults.memorySearch.experimental.sessionMemory is true with sources: ["memory", "sessions"], memory_search does not surface content from gateway-dispatched sessions (e.g., openclaw_gateway adapter sessions). Only content from .md memory files is returned.

This creates a critical gap in multi-agent setups where an agent performs work in a gateway-dispatched session, then cannot recall that work when queried from a different session (e.g., WhatsApp DM).

Config

{
  "agents": {
    "defaults": {
      "memorySearch": {
        "provider": "gemini",
        "model": "gemini-embedding-2-preview",
        "experimental": {"sessionMemory": true},
        "sources": ["memory", "sessions"],
        "sync": {
          "sessions": {
            "deltaBytes": 50000,
            "deltaMessages": 20
          }
        }
      }
    }
  }
}

Reproduction

  1. Configure OpenClaw with openclaw_gateway adapter for an external orchestrator
  2. Gateway creates sessions with keys like agent:friday:paperclip:issue:{uuid}
  3. DM sessions have keys like agent:friday:whatsapp:direct:+1234567890
  4. Trigger a gateway-dispatched session that performs work
  5. Verify JSONL transcript exists in ~/.openclaw/agents/{name}/sessions/*.jsonl
  6. From a DM session, invoke memory_search for content only in the gateway session
  7. Expected: Results from the gateway session appear
  8. Actual: Only results from memory/*.md files. No session transcript content.

Root Cause Analysis

We traced this through three layers:

1. QMD only indexes .md files

QMD config at ~/.openclaw/agents/{name}/qmd/xdg-config/index.yml contains:

collections:
  memory-dir-friday:
    path: ~/.openclaw/workspace/memory
    pattern: "**/*.md"
  shared-docs-friday:
    path: ~/.openclaw/workspace/shared-docs
    pattern: "**/*.md"

No session transcript collection. No .jsonl patterns. QMD has no awareness of session files.

2. Session indexing pipeline doesn't execute

With experimental.sessionMemory: true configured, we see zero log output for session indexing. No session.*index, session.*sync, or memory.*session entries in journalctl. The feature appears to be configured but not active.

3. QMD timeout causes fallback

[memory] qmd query "search terms" --json -n 6 -c memory-root timed out after 4000ms
[memory] qmd memory failed; switching to builtin index

The 4000ms QMD timeout triggers a fallback to the builtin index, which also has no session awareness.

4. Gemini embedding provider interaction

We're using gemini-embedding-2-preview as the memory search provider. It's unclear if session indexing requires a specific embedding provider or if the Gemini provider doesn't support session transcript indexing. The docs don't specify provider requirements for sessionMemory.

Impact

In a multi-agent orchestration setup (e.g., OpenClaw + Paperclip AI), agents perform work in gateway-dispatched sessions. When the user asks the agent about that work via DM, the agent says "I have no record" — even though the work was done, transcripts exist on disk, and LCM stored the messages.

  • Hundreds of session transcript files exist but are not indexed
  • LCM stores cross-session data in SQLite (FTS5-indexed) but this isn't exposed via memory_search
  • User trust erodes every time the agent denies work it actually completed
  • Workaround: direct API calls to the external orchestrator on every turn (adds latency, requires orchestrator-specific knowledge)

Expected Behavior

  1. ALL session transcripts (including openclaw_gateway sessions) should be indexed when sessionMemory: true
  2. memory_search from any session should return results from all indexed sessions
  3. This should work with QMD, Gemini embeddings, or the builtin index
  4. Session indexing should produce log output for observability

Suggestions

  1. Add session JSONL indexing to QMD collections (or bypass QMD for session search)
  2. Log session indexing activity when sessionMemory is enabled
  3. Document which embedding providers support sessionMemory
  4. Document whether gateway-dispatched sessions are included in session indexing
  5. Consider exposing LCM's cross-conversation FTS5 data via memory_search when lossless-claw is the contextEngine

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.staleMarked as stale due to inactivity

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions