Skip to main content
Glama

Consolidate memories

consolidate

Merge similar memories by clustering them based on embedding similarity, and optionally create summarized derived memories linked to each cluster for efficient periodic memory consolidation.

Instructions

Cluster similar memories via embedding similarity and optionally create derived/consolidated memories linked via 'derived_from'. Use during periodic consolidation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deriveNoCreate a derived memory for each cluster
userIdNoScope to a user (USER scope)
projectIdNoScope to a project
sessionIdNoScope to a session (SESSION scope)
thresholdNoCosine similarity threshold for clustering (default 0.7)
minClusterSizeNoMinimum members to report a cluster (default 2)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv2.3.0
    • addedInput schema / properties / sessionId
      Added value: +{
      +  "description": "Scope to a session (SESSION scope)",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • addedInput schema / properties / userId
      Added value: +{
      +  "description": "Scope to a user (USER scope)",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
  2. First observedv2.2.1

TDQS

B3.4/5.0
Behavior2/5

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

With no annotations, the description carries the full burden. It discloses the clustering mechanism and optional derived creation, but does not state whether original memories are modified, whether the operation is reversible, what side effects occur (e.g., deleting clusters), or any permission requirements. The lack of such context leaves the agent guessing about the tool's impact.

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

Conciseness5/5

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

Two sentences with no redundancy. The core purpose is front-loaded, and the usage hint is appended. Every word earns its place.

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

Completeness2/5

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

The tool performs clustering and optional derived memory creation, but the description lacks details on return values (no output schema), impact on existing memories, threshold behavior, and what 'consolidation' entails. An agent would need more context to call this correctly and understand its effects.

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

Parameters3/5

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

Schema description coverage is 100%, so all six parameters are already documented in the schema. The description adds a small amount of context about 'derived_from' linking but does not clarify parameter interactions or defaults beyond what the schema provides. Baseline 3 is appropriate.

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 states a specific action (cluster similar memories via embedding similarity) and a resource (memories), with an optional derived-memory creation linked via 'derived_from'. This clearly distinguishes it from sibling memory tools like merge_memory or link_memory by focusing on clustering and derived creation.

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

Usage Guidelines3/5

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

The description provides a timing hint ('Use during periodic consolidation') but does not specify when to avoid this tool or how it compares to alternatives like merge_memory or link_memory. The guidance is minimal and lacks exclusions.

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