Skip to content

Support memory updates/upserts instead of duplicate rejection #2

Description

@hd719

Problem

Currently, when storing a memory with >0.95 similarity to an existing one, the plugin simply rejects it as a duplicate. This means you can't update a memory — e.g., if a user's preference changes from dark mode to light mode, the old memory stays and the new one is rejected.

Proposal

Add an upsert mode to memory_store:

  • When a near-duplicate is found (>0.95 similarity), update the existing entry's text, importance, and category instead of rejecting
  • Add an optional update boolean param to memory_store (default: false for backward compat)
  • Or add a dedicated memory_update tool that takes a memoryId + new text

Why it matters

Memory evolves. Preferences change, facts update, decisions get revised. The current duplicate detection is great for preventing noise, but it also prevents legitimate updates to existing knowledge.

Implementation notes

  • LanceDB supports row-level updates via table.update()
  • Could reuse the existing duplicate check logic but branch on an upsert flag
  • Should re-embed the new text and replace the vector as well

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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