Skip to main content
Glama
QuixiAI

AGI MCP Server

by QuixiAI

create_memory_relationship

Link two memories in an AI system by establishing causal, temporal, semantic, emotional, strategic, or consolidation relationships to enable memory continuity and contextual understanding.

Instructions

Create a relationship between two memories

Input Schema

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

Implementation Reference

  • Core handler function that executes the tool logic: inserts a new memory relationship record into the memoryRelationships table using Drizzle ORM.
    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 (handler)
    MCP CallToolRequest dispatch handler that extracts arguments and calls the core memoryManager.createMemoryRelationship function, returning JSON result.
    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) }] };
  • Input schema definition for the tool, used in MCP ListToolsRequestHandler to describe parameters and validation.
      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"]
      }
    },
  • Input schema definition in memoryTools export array (reference or source schema matching the one used in mcp.js).
      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"]
      }
    },
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. 'Create' implies a write/mutation operation, but the description doesn't mention permissions needed, whether this is reversible, what happens on conflict, or what the response looks like. For a creation tool with zero annotation coverage, this leaves significant behavioral questions unanswered.

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 a single, efficient sentence that states the core purpose without unnecessary words. It's appropriately sized for a tool with good schema documentation and gets straight to the point with zero waste.

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?

For a creation tool with no annotations and no output schema, the description is insufficient. It doesn't explain what gets created, what the relationship means operationally, whether there are constraints on relationship creation, or what the tool returns. Given the complexity of memory relationships and lack of structured behavioral information, more context is needed.

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 the schema already documents all parameters thoroughly. The description doesn't add any meaningful parameter semantics beyond what's in the schema - it doesn't explain relationship types, what 'properties' might contain, or how the relationship affects the memories. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'create' and the resource 'relationship between two memories', making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'get_memory_relationships' or explain what distinguishes this creation from other memory operations.

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

Usage Guidelines2/5

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

No guidance is provided about when to use this tool versus alternatives like 'create_memory_cluster' or 'find_related_memories'. The description lacks context about prerequisites, typical use cases, or when this operation is appropriate versus other memory manipulation tools.

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

Install Server

Other Tools

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