Skip to content

bug: restore rich preamble + v2 format in memory injection #8

@100yenadmin

Description

@100yenadmin

Problem

The Cortex plugin's formatMemoryContext() function lost its rich preamble during a routing refactor (commit 3184d96). The MEMORY_PREAMBLE constant was present in 3d22b2b and the v2 format commit cc544fa but got removed.

Current output (broken)

<relevant-memories>
- [49f39413] [2026-03-23] [medium/episodic] content here
</relevant-memories>

Expected output (with preamble)

<relevant-memories>
Long-term memories from your Cortex memory system, matched to this conversation.
Format: [score%] [date] [salience/category] content {item_id}

Score: >70% strong match, 30-50% tangential. Weight accordingly.
...category guide, rules, etc...

- [78%] [2026-03-23] [medium/episodic] content here {49f39413}
[N of M memories shown — use cortex_search for more]
</relevant-memories>

Also missing from v2 format

  • Score percentage as first field
  • Item ID in braces at end
  • Footer showing "N of M memories shown"

Fix

Restore MEMORY_PREAMBLE constant and update formatMemoryContext() to include it. Reference commit cc544fa for the v2 preamble text and format spec.

Secondary issue

openclaw-control-ui is being saved as username in memories — likely Cortex server-side attribution issue, not plugin-side.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    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