Files
agent-zero/plugins/_memory/prompts/agent.system.tool.memory.md
linkliti 98c18e17d9 feat(memory): unify memory tools under one action-based memory tool
The four memory tools memory_load, memory_save, memory_delete, and memory_forget collapse into one memory tool whose action arg selects load, save, delete, or forget, matching the action-dispatch shape of other tools. The tool keeps the numeric threshold and limit coercion, the destructive-confirmation guidance, and the exact-match cleanup of forget, and rejects unknown actions through a plugin prompt file. Memory messages now log as a single memory type with icon verb headlines and a dedicated MEM badge matching the behavior adjustment brain pink accent. Update the tool prompt, the Responses schema and prompt tests, the auto-recall and consolidation imports, the orchestrator skill and README references to the new tool, and the plugin DOX and README.

Validation: pytest tests/test_responses_tools.py plugins/_memory/tests/test_memory_tool_ui.py tests/test_tool_action_contracts.py plugins/_orchestrator/tests/test_status_adapters.py
2026-10-21 23:37:32 +03:00

1.5 KiB

memory tool

use when durable recall or storage is useful

  • memory: args action, then query, text, ids, area, threshold, limit, filter as the action needs
  • actions: load searches by meaning and metadata, save stores durable information and returns a memory ID, delete removes memories by comma-separated IDs, forget finds and removes matching memories

notes:

  • threshold is similarity from 0 to 1
  • filter is a metadata expression (e.g. area=='main')
  • confirm destructive changes when accuracy matters
  • memories usually include timestamp metadata; use it as a soft recency signal, not a hard TTL
  • when the user updates a durable fact/preference, load related memories first, forget/delete superseded versions, then save one complete current version
  • do not append a second memory for the same mutable subject when the new statement replaces the old one
  • do not forget a memory only because it is old; forget it when current evidence shows it is stale, false, superseded, duplicated, or unwanted
  • forget also cleans exact matches and derived fragment/solution records related to removed memories
  • use save for stable current facts, not short-lived test markers, greetings, or one-off conversation events

example:

{
  "thoughts": ["I should search memory for relevant prior guidance."],
  "headline": "Loading related memories",
  "tool_name": "memory",
  "tool_args": {
    "action": "load",
    "query": "tool argument format",
    "threshold": 0.7,
    "limit": 3
  }
}