MCP DuckDB Knowledge Graph Memory Server logo

MCP DuckDB Knowledge Graph Memory Server

Community
IzumiSy

MCP Memory Server with DuckDB backend

PublisherIzumiSy
Repositorymcp-duckdb-memory-server
LanguageTypeScript
Forks
11
Stars
59
Available tools
8
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    MCP DuckDB Knowledge Graph Memory Server exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 8 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    59 stars and 11 forks from the linked repository.

MCP DuckDB Knowledge Graph Memory Server

Test smithery badge NPM Version NPM License

A forked version of the official Knowledge Graph Memory Server.

Installation

Installing via Smithery

To install DuckDB Knowledge Graph Memory Server for Claude Desktop automatically via Smithery:

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

Manual install

Otherwise, add @IzumiSy/mcp-duckdb-memory-server in your claude_desktop_config.json manually (MEMORY_FILE_PATH is optional)

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

The data stored on that path is a DuckDB database file.

Docker

Build

bash
docker build -t mcp-duckdb-graph-memory .

Run

bash
docker run -dit mcp-duckdb-graph-memory

Usage

Use the example instruction below

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

Motivation

This project enhances the original MCP Knowledge Graph Memory Server by replacing its backend with DuckDB.

Why DuckDB?

The original MCP Knowledge Graph Memory Server used a JSON file as its data store and performed in-memory searches. While this approach works well for small datasets, it presents several challenges:

  1. Performance: In-memory search performance degrades as the dataset grows
  2. Scalability: Memory usage increases significantly when handling large numbers of entities and relations
  3. Query Flexibility: Complex queries and conditional searches are difficult to implement
  4. Data Integrity: Ensuring atomicity for transactions and CRUD operations is challenging

DuckDB was chosen to address these challenges:

  • Fast Query Processing: DuckDB is optimized for analytical queries and performs well even with large datasets
  • SQL Interface: Standard SQL can be used to execute complex queries easily
  • Transaction Support: Supports transaction processing to maintain data integrity
  • Indexing Capabilities: Allows creation of indexes to improve search performance
  • Embedded Database: Works within the application without requiring an external database server

Implementation Details

This implementation uses DuckDB as the backend storage system, focusing on two key aspects:

Database Structure

The knowledge graph is stored in a relational database structure as shown below:

This schema design allows for efficient storage and retrieval of knowledge graph components while maintaining the relationships between entities, observations, and relations.

Fuzzy Search Implementation

The implementation combines SQL queries with Fuse.js for flexible entity searching:

  • DuckDB SQL queries retrieve the base data from the database
  • Fuse.js provides fuzzy matching capabilities on top of the retrieved data
  • This hybrid approach allows for both structured queries and flexible text matching
  • Search results include both exact and partial matches, ranked by relevance

Development

Setup

bash
pnpm install

Testing

bash
pnpm test

License

This project is licensed under the MIT License - see the LICENSE file for details.

Installation

TypingMind
{
  "mcpServers": {
    "mcp-duckdb-memory-server": {
      "command": "npx",
      "args": [
        "-y",
        "@izumisy/mcp-duckdb-memory-server"
      ]
    }
  }
}

Available Tools

  • create_entities

    Create multiple new entities in the knowledge graph

  • create_relations

    Create multiple new relations between entities in the knowledge graph. Relations should be in active voice

  • add_observations

    Add new observations to existing entities in the knowledge graph

  • delete_entities

    Delete multiple entities and their associated relations from the knowledge graph

  • delete_observations

    Delete specific observations from entities in the knowledge graph

  • delete_relations

    Delete multiple relations from the knowledge graph

  • search_nodes

    Search for nodes in the knowledge graph based on a query

  • open_nodes

    Open specific nodes in the knowledge graph by their names

Use MCP DuckDB Knowledge Graph Memory Server MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once MCP DuckDB Knowledge Graph Memory Server is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add MCP DuckDB Knowledge Graph Memory Server as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the MCP DuckDB Knowledge Graph Memory Server MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "mcp-duckdb-memory-server": {
      "command": "npx",
      "args": [
        "-y",
        "@izumisy/mcp-duckdb-memory-server"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the MCP DuckDB Knowledge Graph Memory Server MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the MCP DuckDB Knowledge Graph Memory Server MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use MCP DuckDB Knowledge Graph Memory Server to help me with this task?
MCP DuckDB Knowledge Graph Memory Server
Sure. I read it.
Here is what I found using MCP DuckDB Knowledge Graph Memory Server.

Frequently asked questions

What is the MCP DuckDB Knowledge Graph Memory Server MCP server used for?

MCP DuckDB Knowledge Graph Memory Server is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use MCP DuckDB Knowledge Graph Memory Server MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use MCP DuckDB Knowledge Graph Memory Server with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use MCP DuckDB Knowledge Graph Memory Server MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With MCP DuckDB Knowledge Graph Memory Server connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect MCP DuckDB Knowledge Graph Memory Server MCP to TypingMind?

MCP DuckDB Knowledge Graph Memory Server runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does MCP DuckDB Knowledge Graph Memory Server MCP provide in TypingMind?

MCP DuckDB Knowledge Graph Memory Server exposes 8 MCP tools that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use MCP DuckDB Knowledge Graph Memory Server MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If MCP DuckDB Knowledge Graph Memory Server requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇