Skip to main content
Glama

memory_relate

Create directional links between memories to record facts search cannot infer: supersedes, contradicts, caused_by, parent_of, or child_of. Enables related-memory recall through spreading activation.

Instructions

Create a directional link between two memories. Relations are used by spreading activation (recalling one memory wakes its related cluster) and are returned when include_related=True in memory_recall.

An edge must encode something search cannot infer. Recall already ranks by hybrid text + semantic similarity, so "these two memories are about the same topic" is knowledge the index has for free. What only a relation can record is direction and time: which memory REPLACED which, what CAUSED what, what CONTRADICTS what, what CONTAINS what. Prefer, in this order: supersedes, contradicts, caused_by, parent_of/child_of. Reach for related_to only when a genuine connection exists that none of those describe - it is the fallback, not the default.

Quality over volume: spreading activation surfaces at most 3 neighbours per seed memory, and it weights by relation type - a directional edge outranks related_to, so on any memory with more than 3 edges the related_to ones are what lose their slot. A vague edge is therefore not merely low-value, it is likely to never fire at all; and precise edges still compete against each other for those 3 slots, so a handful of them retrieves better than a dense mesh. If you cannot name the directional fact an edge records, do not create it.

A mislabelled edge is repairable: memory_unrelate retypes or removes one.

source_id is the memory making the claim about target_id. relation_type must be one of: supersedes (source replaces target), contradicts (conflicting claims), caused_by (source was caused by target), parent_of (source contains target), child_of (source belongs to target), related_to (fallback: a real connection none of the above captures).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
source_idYes
target_idYes
relation_typeYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.1

TDQS

A4.8/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does so well: it discloses spreading-activation behavior, the 3-neighbour budget, relation-type weighting, and the repairability of edges. It does not state what happens on duplicate edge creation or invalid IDs, but those are minor given the depth of behavior already disclosed.

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?

The description is long but dense and front-loaded: the core operation appears first, followed by usage policy, quality constraints, repair path, and parameter semantics. There is no filler; each paragraph earns its place by changing an agent's decision about whether and how to call the tool.

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?

For a relation-creation tool with no output schema or annotations, the description is complete enough to invoke correctly: it covers what relations do, when to create them, which type to choose, how to avoid low-value edges, and how to repair mistakes. No critical operational fact is missing.

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

Parameters5/5

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

Schema description coverage is 0%, but the description compensates fully: it defines source_id as 'the memory making the claim about target_id,' defines target_id implicitly through every relation definition, and enumerates all six relation_type values with prose semantics and a priority order. This goes well beyond the bare schema names.

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 opening sentence states a specific verb and resource: 'Create a directional link between two memories.' It also differentiates from siblings by explaining relations are surfaced through memory_recall and contrasted with memory_search, and that memory_unrelate is the repair path. An agent can tell exactly what this tool does and how it differs from other memory tools.

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?

The description gives explicit when-to-use guidance: only create edges that encode something search cannot infer, prefer relation types in a specified order, use related_to only as a fallback, and skip creation when no directional fact exists. It even names memory_unrelate as the alternative for fixing mislabelled edges and cites include_related=True in memory_recall as the consumption path.

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