Skip to content

(capture) Internal "Review the conversation above" prompts stored as user chunks — memory DB noise #1518

@SonicBotMan

Description

@SonicBotMan

Bug Description

Internal system prompts injected by Hermes Agent — specifically the "Review the conversation above, consider saving..." type prompts — are being stored as role: "user" chunks in the MemTensor memory database, causing noise pollution in long-term memory.

These prompts are instruction strings from the agent framework to itself, not user messages.

Root Cause

Location: apps/memos-local-openclaw/src/capture/index.ts

The captureMessages() function has a SKIP_ROLES filter (skips role: "system") and a BOOT_CHECK_RE pattern filter, but no content filter for "Review the conversation above..." prompts which arrive with role: "user".

Evidence

SELECT COUNT(*) FROM chunks WHERE content LIKE 'Review the conversation above%';
-- Returns: ~37 chunks per production instance

Proposed Fix

Add REVIEW_CONVERSATION_RE and a skip check in captureMessages(), following the same pattern as BOOT_CHECK_RE:

const REVIEW_CONVERSATION_RE = /^Review the conversation above/i;

if (role === "user" && REVIEW_CONVERSATION_RE.test(msg.content.trim())) {
  continue; // skip
}

PR with the fix: MemTensor/MemOS#1517

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions