Member Junction
    Preparing search index...

    Manages in-flight durable memory writes for a single agent run.

    Follows the ArtifactToolManager pattern:

    • Instantiated once per run, Clear()ed at run start
    • Holds per-run idempotency/cap state
    • Executes write requests and returns structured results for next-turn injection

    The framework (not the agent) enforces every guard: type restriction, scope clamping, near-duplicate handling, per-run caps, and provenance stamping. Notes land with Status='Provisional' — immediately injectable, later hardened or pruned by the MemoryManagerAgent.

    Writes MUST be executed sequentially (the BaseAgent caller iterates with for...of, not Promise.all): each persisted note is embedded and synced into the in-memory vector service by MJAIAgentNoteEntityServer.Save(), so write N must be visible to write N+1's near-dup check. This is a deliberate exception to the parallelize-by-default rule.

    Index

    Constructors

    Accessors

    Methods

    • One in-memory vector check against injectable notes in the same scope, returning only ACTIONABLE hits:

      • a note written earlier in THIS run (supersede-own candidate — checked first because within-run last-write-wins is the stronger contract), or
      • a pre-existing note whose normalized text EXACTLY equals the request's (exact-restatement dedupe candidate).

      Near-but-textually-different matches are deliberately dropped so the write proceeds as a new provisional note. A textual difference may be a correction — live testing showed "I love pie charts" followed in a later run by "never use pie charts, bar charts only" being absorbed into the STALE note (reinforcing it) and the correction silently lost. ADD-only on mismatch preserves corrections; true paraphrase duplicates are reconciled by the Memory Manager's LLM hardening dedupe (bounded by the per-run cap and TTL). The vector query itself survives because it (a) detects own-note supersede targets and (b) shortlists exact-restatement candidates without a table scan — exact equality filters AFTER the vector shortlist.

      Fail-open by design: when the vector service is unavailable or errors, we proceed with the write rather than dropping the user's stated fact — a rare duplicate is recoverable (TTL + Memory Manager hardening dedup), a silently lost memory is not.

      Parameters

      Returns Promise<{ noteId: string; similarity: number }>