Skip to main content
Glama

Consolidate memory

zenbrain_consolidate
Destructive

Converts recent emotional episodes into semantic facts and prunes low-relevance working-memory slots in one pass. Use between sessions or after storing data.

Instructions

Run one consolidation pass: among the 100 most recent episodes, each one with an emotional weight above 0.5 becomes a semantic fact — once, however often the pass runs. Working-memory slots lose relevance with age, and slots whose relevance has dropped to 0.01 or below are removed; that is the only deletion, and nothing in long-term memory is deleted. Run it between sessions or after a batch of zenbrain_store calls, not on every turn; compare zenbrain_health before and after to see the effect.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
prunedYesAlways 0: consolidation deletes nothing from long-term memory.
decayedYesWorking-memory slots decayed.
promotedYesEpisodes promoted to semantic facts in this pass.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.1.7
    • changedOutput schema / properties / promoted / description
      Previous value: -"Episodes promoted to semantic facts."New value: +"Episodes promoted to semantic facts in this pass."
    • changedOutput schema / properties / pruned / description
      Previous value: -"Items pruned below the retention threshold."New value: +"Always 0: consolidation deletes nothing from long-term memory."
  2. First observedv0.1.5

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only say destructiveHint=true and idempotentHint=false; the description goes well beyond by scoping the deletion precisely (working-memory slots with relevance <= 0.01 are removed, that is the ONLY deletion, long-term memory is untouched) and clarifying dedup behavior ('once, however often the pass runs'). This is exactly the context needed to trust a destructive-hinted tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the action and mechanism, and every clause carries information (thresholds, deletion scope, timing). Slightly run-on across three long sentences, but there is no filler to cut.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present, return values need not be explained, and annotations cover the safety profile. The description supplies everything else an agent needs: trigger timing, thresholds, exact deletion scope, and a verification workflow via zenbrain_health.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool takes zero parameters, so the baseline of 4 applies. The description instead documents implicit inputs (the 100 most recent episodes, the 0.5 weight threshold, the 0.01 relevance cutoff) that would otherwise be invisible to the caller.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first clause gives a specific verb (run a consolidation pass) and resource (memory), then immediately defines the mechanism: recent episodes with emotional weight > 0.5 become semantic facts. An agent can distinguish this from zenbrain_store/recall/health without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit when-to-use ('between sessions or after a batch of zenbrain_store calls'), explicit when-not ('not on every turn'), and it recommends comparing zenbrain_health before and after. Both the trigger condition and the sibling to use for verification are named.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.