Skip to main content
Glama

Consolidate memory

zenbrain_consolidate
Destructive

Run one consolidation pass to turn emotionally weighted recent episodes into semantic facts once and remove only stale working-memory slots; long-term memory stays intact. Use between sessions.

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

NameRequiredDescriptionDefault

No arguments

Output Schema

NameRequiredDescriptionDefault
prunedYesAlways 0: consolidation deletes nothing from long-term memory.
decayedYesWorking-memory slots removed by decay (relevance at or below 0.01).
promotedYesEpisodes promoted to semantic facts in this pass.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.5.2
    • changedOutput schema / properties / decayed / description
      Previous value: -"Working-memory slots decayed."New value: +"Working-memory slots removed by decay (relevance at or below 0.01)."
  2. 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."
  3. 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 declare destructiveHint=true, and the description goes well beyond that by naming exactly what is deleted (working-memory slots with relevance <= 0.01) and what is safe (nothing in long-term memory is deleted). It also discloses idempotency-like behavior that annotations cannot express: each qualifying episode becomes a fact 'once, however often the pass runs.'

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 core action, then scope of deletion, then invocation cadence. Every sentence carries information, though the middle sentence about slot relevance is dense and slightly harder to parse than the rest.

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 no parameters, an output schema present, and annotations covering the safety profile, the description supplies everything an agent needs: effect, deletion scope, frequency guidance, and a verification path 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 schema baseline is 4. The description correctly implies no configuration is needed to invoke it.

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 description names a specific action (one consolidation pass) and states the exact transformation it performs on episodes and working-memory slots. It is clearly distinct from sibling tools like zenbrain_store and zenbrain_health, which it references by name.

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 guidance: 'Run it between sessions or after a batch of zenbrain_store calls, not on every turn.' It also gives a concrete verification step (compare zenbrain_health before and after), leaving nothing to inference.

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