Associate Memories
associate_memoriesCreate typed relationships between memories to build a knowledge graph, improving recall of related context. Supports single and batch modes.
Instructions
Create typed relationships between memories. This builds a knowledge graph that improves recall by surfacing related context. Supports single-pair mode or batch mode with associations[] (max 500).
When to use:
After storing a new memory: link it to related existing memories
When a bug fix relates to an original feature implementation
When a new decision updates or invalidates a previous one
To connect patterns with their concrete examples
Authorable relationship types:
RELATES_TO: General relationship (default)
LEADS_TO: Causal relationship (A caused B)
OCCURRED_BEFORE: Temporal ordering
PREFERS_OVER: Chosen alternative
EXEMPLIFIES: Concrete example of a pattern
CONTRADICTS: Conflicts with another memory
REINFORCES: Strengthens another memory's validity
INVALIDATED_BY: Superseded by another memory
EVOLVED_INTO: Updated version of a concept
DERIVED_FROM: Implementation of a decision/pattern
PART_OF: Component of a larger effort
Read-only/internal relations:
System/internal relations such as SIMILAR_TO, PRECEDED_BY, EXPLAINS, SHARES_THEME, PARALLEL_CONTEXT, and DISCOVERED may appear in recall results, but they are not valid inputs for associate_memories.
Examples:
associate_memories({ memory1_id: "bug-fix-123", memory2_id: "feature-456", type: "RELATES_TO", strength: 0.9 })
associate_memories({ memory1_id: "new-decision", memory2_id: "old-decision", type: "EVOLVED_INTO", strength: 0.8 })
associate_memories({ associations: [{ memory1_id: "a", memory2_id: "b", type: "RELATES_TO", strength: 0.8 }] })
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| role | No | Relation-specific role for PART_OF associations. | |
| type | No | Relationship type between the two memories | |
| reason | No | Relation-specific reason for PREFERS_OVER, CONTRADICTS, INVALIDATED_BY, or EVOLVED_INTO associations. | |
| context | No | Relation-specific context for PREFERS_OVER or PART_OF associations. | |
| strength | No | Relationship strength: 0.9+ direct causation, 0.7-0.9 strong relation, 0.5-0.7 moderate | |
| timestamp | No | Relation-specific timestamp for INVALIDATED_BY associations. | |
| confidence | No | Relation-specific confidence for EXEMPLIFIES, EVOLVED_INTO, or DERIVED_FROM. | |
| memory1_id | No | ID of the source memory (from store_memory response or recall results) | |
| memory2_id | No | ID of the target memory to link to | |
| resolution | No | Relation-specific resolution for CONTRADICTS associations. | |
| associations | No | Batch mode. Up to 500 associations. Do not combine with top-level memory1_id/memory2_id/type/strength. | |
| observations | No | Relation-specific observations for REINFORCES associations. | |
| pattern_type | No | Relation-specific pattern label for EXEMPLIFIES associations. | |
| transformation | No | Relation-specific transformation note for DERIVED_FROM associations. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| failed | No | Batch mode: failed association records with errors. | |
| message | Yes | Confirmation message | |
| success | Yes | Whether every requested association was created. False for partial batch responses. | |
| summary | No | Batch mode: service summary. | |
| succeeded | No | Batch mode: successful association records. | |
| failed_count | No | Batch mode: number of associations that failed. | |
| created_count | No | Batch mode: number of associations created. |