Skip to main content
Glama

create_memory_relationship

Establish and define relationships between memories in the AGI MCP Server by specifying source, target, and relationship type (causal, temporal, semantic, emotional, strategic, or consolidation).

Instructions

Create a relationship between two memories

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
from_memory_idYesUUID of the source memory
propertiesNoAdditional properties for the relationship
relationship_typeYesType of relationship
to_memory_idYesUUID of the target memory

Implementation Reference

  • Core handler function that executes the tool logic: inserts a new relationship record into the memoryRelationships database table using Drizzle ORM and returns the created relationship.
    async createMemoryRelationship(fromMemoryId, toMemoryId, relationshipType, properties = {}) { try { const [relationship] = await this.db .insert(schema.memoryRelationships) .values({ fromMemoryId, toMemoryId, relationshipType, properties }) .returning(); return relationship; } catch (error) { console.warn('Memory relationships table not available:', error.message); return null; } }
  • mcp.js:601-608 (registration)
    MCP tool dispatch/registration in the CallToolRequestSchema handler: maps tool call to memoryManager.createMemoryRelationship and formats response.
    case "create_memory_relationship": const relationship = await memoryManager.createMemoryRelationship( args.from_memory_id, args.to_memory_id, args.relationship_type, args.properties || {} ); return { content: [{ type: "text", text: JSON.stringify(relationship, null, 2) }] };
  • Tool schema definition (input validation) provided in ListToolsRequestSchema response.
    name: "create_memory_relationship", description: "Create a relationship between two memories", inputSchema: { type: "object", properties: { from_memory_id: { type: "string", description: "UUID of the source memory" }, to_memory_id: { type: "string", description: "UUID of the target memory" }, relationship_type: { type: "string", enum: ["causal", "temporal", "semantic", "emotional", "strategic", "consolidation"], description: "Type of relationship" }, properties: { type: "object", description: "Additional properties for the relationship", default: {} } }, required: ["from_memory_id", "to_memory_id", "relationship_type"] } },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/QuixiAI/agi-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server