The agent's shared SQLite brain database connection.
Optional writeBack: MemoryToolWriteBackThe facade that made the tool (Memory.createTools()): the merged-away traces'
knowledge-graph copies are deleted through it, and a merge a learning layer does not keep is taken back through
it. Without it the tool restores the rows itself.
The refusal a merge meets whatever a human would answer, read before the tool orchestrator's approval gate
(ITool.refusalBeforeApproval), so no one is asked to approve a write that cannot act: a freeze, and, with the
turn's scope ids on the call, a session that records no writes. A refusal that reads the traces (other_user,
conflict) is given when the call runs, and fewer than two ids are left to execute, which refuses the same call
itself, in the same order.
The call's arguments, before the input schema is checked.
The call's context.
The refusal, or undefined when the call may run.
Merge the specified traces into one survivor.
Steps:
retrieval_count; on a tie, the first of traceIds.Merge input (traceIds, optional mergedContent).
Tool execution context; where it carries the turn's scope ids, every trace the call names must be
one the turn reaches: a live trace of the turn's own scopes that the turn's own user filed (another scope's reads
as not found; one another user filed refuses the whole merge, other_user). The merge then runs through the
learner session's recorder, writing each row only while it holds what was read (conflict otherwise). Only a
freeze stops a merge, with a layer or without one (frozen).
{ survivorId, deletedIds } on success, or an error result.
Readonly idGlobally unique tool identifier.
Readonly nameLLM-facing tool name.
Readonly displayHuman-readable display name.
Readonly descriptionLLM-facing description.
Readonly categoryLogical category for discovery and grouping.
Readonly hasThis tool writes to the database.
Readonly inputJSON schema for input validation and LLM tool-call construction.
ITool implementation that merges multiple memory traces into one.
Usage: