Pluggable Knowledge Graph Memory MCP server

Provides a pluggable knowledge graph memory server for flexible storage and retrieval within compatible systems, offering enhanced customization through TypeScript-based architecture.
Back to servers
Setup instructions
Provider
IzumiSy
Release date
Feb 28, 2025
Language
TypeScript
Stats
41 stars

The DuckDB Knowledge Graph Memory Server is a Model Context Protocol (MCP) server that enhances the original Knowledge Graph Memory Server by replacing its backend with DuckDB. This implementation offers improved performance, scalability, and query flexibility when handling knowledge graph data for AI assistants.

Installation Options

Via Smithery

The easiest way to install the DuckDB Knowledge Graph Memory Server for Claude Desktop is through Smithery:

npx -y @smithery/cli install @IzumiSy/mcp-duckdb-memory-server --client claude

Manual Installation

To install manually, add the server configuration to your claude_desktop_config.json file:

{
  "mcpServers": {
    "graph-memory": {
      "command": "npx",
      "args": [
        "-y",
        "@izumisy/mcp-duckdb-memory-server"
      ],
      "env": {
        "MEMORY_FILE_PATH": "/path/to/your/memory.data"
      }
    }
  }
}

Note that MEMORY_FILE_PATH is optional and specifies where the DuckDB database file will be stored.

Docker Installation

If you prefer using Docker:

# Build the Docker image
docker build -t mcp-duckdb-graph-memory .

# Run the container
docker run -dit mcp-duckdb-graph-memory

Usage Instructions

To use the memory server with Claude, provide the following instruction in your conversation:

Follow these steps for each interaction:

1. User Identification:
   - You should assume that you are interacting with default_user
   - If you have not identified default_user, proactively try to do so.

2. Memory Retrieval:
   - Always begin your chat by saying only "Remembering..." and search relevant information from your knowledge graph
   - Create a search query from user words, and search things from "memory". If nothing matches, try to break down words in the query at first ("A B" to "A" and "B" for example).
   - Always refer to your knowledge graph as your "memory"

3. Memory
   - While conversing with the user, be attentive to any new information that falls into these categories:
     a) Basic Identity (age, gender, location, job title, education level, etc.)
     b) Behaviors (interests, habits, etc.)
     c) Preferences (communication style, preferred language, etc.)
     d) Goals (goals, targets, aspirations, etc.)
     e) Relationships (personal and professional relationships up to 3 degrees of separation)

4. Memory Update:
   - If any new information was gathered during the interaction, update your memory as follows:
     a) Create entities for recurring organizations, people, and significant events
     b) Connect them to the current entities using relations
     b) Store facts about them as observations

Key Features and Benefits

DuckDB Advantages

This implementation provides several advantages over the original memory server:

  • Better Performance: Efficiently handles larger datasets with optimized query processing
  • Improved Scalability: Manages growing numbers of entities and relations effectively
  • Enhanced Query Capabilities: Uses SQL for complex and conditional searches
  • Data Integrity: Supports transactions to maintain consistency
  • Efficient Storage: Uses proper database indexing to improve search performance

Database Structure

The knowledge graph is stored in a relational database structure with tables for:

  • Entities (with names and types)
  • Observations (facts about entities)
  • Relations (connections between entities)

This schema design allows for efficient storage and retrieval while maintaining proper relationships between all knowledge graph components.

Search Capabilities

The server implements a hybrid search approach:

  • Uses DuckDB SQL queries for structured data retrieval
  • Incorporates Fuse.js for fuzzy matching capabilities
  • Provides both exact and partial matches ranked by relevance

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "graph-memory" '{"command":"npx","args":["-y","@izumisy/mcp-duckdb-memory-server"],"env":{"MEMORY_FILE_PATH":"/path/to/your/memory.data"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "graph-memory": {
            "command": "npx",
            "args": [
                "-y",
                "@izumisy/mcp-duckdb-memory-server"
            ],
            "env": {
                "MEMORY_FILE_PATH": "/path/to/your/memory.data"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "graph-memory": {
            "command": "npx",
            "args": [
                "-y",
                "@izumisy/mcp-duckdb-memory-server"
            ],
            "env": {
                "MEMORY_FILE_PATH": "/path/to/your/memory.data"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later