T1nker-1220_memories-with-lessons-mcp-server

T1nker-1220_memories-with-lessons-mcp-server

3.4

The Knowledge Graph Memory Server is a basic implementation of persistent memory using a local knowledge graph, allowing Claude to remember user information across chats and learn from past errors through a lesson system.

The Knowledge Graph Memory Server is designed to provide a persistent memory solution using a local knowledge graph. It enables the storage and retrieval of user information across different interactions, allowing for a more personalized and informed user experience. The server supports the creation and management of entities, relations, and observations, which are the building blocks of the knowledge graph. Additionally, it includes a lesson system that captures knowledge about errors and their solutions, helping to improve the system's performance over time. The server is integrated with various tools and platforms, making it versatile and adaptable to different use cases.

Features

  • Entity Management: Create, read, update, and delete entities in the knowledge graph.
  • Relation Management: Define and manage directed connections between entities.
  • Observation Handling: Add and remove discrete pieces of information about entities.
  • Lesson System: Capture and manage knowledge about errors and their solutions.
  • File Management: Automatically split files to maintain performance and store data efficiently.

MCP Tools

  • {'create_entities': 'Create multiple new entities in the knowledge graph.'}
  • {'create_relations': 'Create multiple new relations between entities.'}
  • {'add_observations': 'Add new observations to existing entities.'}
  • {'delete_entities': 'Remove entities and their relations.'}
  • {'delete_observations': 'Remove specific observations from entities.'}
  • {'delete_relations': 'Remove specific relations from the graph.'}
  • {'read_graph': 'Read the entire knowledge graph.'}
  • {'search_nodes': 'Search for nodes based on query.'}
  • {'open_nodes': 'Retrieve specific nodes by name.'}
  • {'create_lesson': 'Create a new lesson from an error and its solution.'}
  • {'find_similar_errors': 'Find similar errors and their solutions.'}
  • {'update_lesson_success': 'Update success tracking for a lesson.'}
  • {'get_lesson_recommendations': 'Get relevant lessons for current context.'}

Usage with Different Platforms

Cursor MCP Client Setup

bash
git clone [repository-url]
cd [repository-name]
pnpm install
pnpm build
node /path/to/the/dist/index.js

Claude Desktop - Docker


{
  "mcpServers": {
    "memory": {
      "command": "docker",
      "args": ["run", "-i", "-v", "claude-memory:/app/dist", "--rm", "mcp/memory"]
    }
  }
}

Claude Desktop - NPX


{
  "mcpServers": {
    "memory": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-memory"
      ]
    }
  }
}

Claude Desktop - NPX with custom setting


{
  "mcpServers": {
    "memory": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-memory"
      ],
      "env": {
        "MEMORY_FILE_PATH": "/path/to/custom/memory.json"
      }
    }
  }
}