Token导航 LogoToken导航TokenDH.com
MCP DuckDB Knowledge Graph Memory Server logo
数据服务stdio官方级别未说明来源级核验

MCP DuckDB Knowledge Graph Memory Server

MCP Server

@smithery/cli

一个基于DuckDB的知识图谱内存服务器,用于高效存储和检索实体、观察和关系数据。

工具数

0

提示词数

0

GitHub Stars

57

资源数

0
知识图谱TypeScriptClaudeClaude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

IzumiSy

提供方

IzumiSy

最后核验

2026/5/17 20:22

运行时

Node.js

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

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

详细介绍

MCP DuckDB 知识图谱内存服务器

![Test](https://github.com/izumisy/mcp-duckdb-memory-server/actions/workflows/test.yaml) ](https://smithery.ai/server/@IzumiSy/mcp-duckdb-memory-server)

一个分支版本的 官方知识图谱内存服务器

安装

通过Smithery进行安装

通过自动方式为Claude Desktop安装DuckDB知识图谱内存服务器 “Smithery”可以翻译为“铁匠铺”或“锻造工坊”。这个词通常用来指代一个进行金属加工、锻造或修理等工作的场所,尤其是与铁匠或锻造师相关的

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

手动安装

否则,添加 @IzumiSy/mcp-duckdb-memory-server 在你的 claude_desktop_config.json 手动地(MEMORY_FILE_PATH (可选)

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

存储在该路径上的数据是一个DuckDB数据库文件。

Docker

构建

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

docker run -dit mcp-duckdb-graph-memory

使用方法

使用以下示例说明

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

动机

该项目通过将后端替换为DuckDB,增强了原有的MCP知识图谱内存服务器。

为什么选择DuckDB?

原始的MCP知识图谱内存服务器使用JSON文件作为其数据存储,并在内存中执行搜索。虽然这种方法对于小数据集效果良好,但它也带来了一些挑战:

  1. 演出随着数据集的增长,内存中搜索性能会下降
  2. 可扩展性在处理大量实体和关系时,内存使用量会显著增加
  3. 查询灵活性复杂查询和条件搜索难以实现
  4. 数据完整性确保事务和CRUD操作的原子性是一项挑战

选择DuckDB来应对这些挑战:

  • 快速查询处理DuckDB针对分析查询进行了优化,即使在处理大型数据集时也能表现出色
  • SQL 接口标准SQL可以用来轻松执行复杂查询
  • 事务支持支持事务处理以维护数据完整性
  • 索引功能允许创建索引以提高搜索性能
  • 嵌入式数据库在应用程序内部工作,无需外部数据库服务器

实施细节

此实现使用DuckDB作为后端存储系统,重点关注两个关键方面:

数据库结构

知识图谱以如下所示的关系数据库结构进行存储:

erDiagram
    ENTITIES {
        string name PK
        string entityType
    }
    OBSERVATIONS {
        string entityName FK
        string content
    }
    RELATIONS {
        string from_entity FK
        string to_entity FK
        string relationType
    }

    ENTITIES ||--o{ OBSERVATIONS : "has"
    ENTITIES ||--o{ RELATIONS : "from"
    ENTITIES ||--o{ RELATIONS : "to"

这种模式设计允许高效地存储和检索知识图谱组件,同时保持实体、观测值和关系之间的关联性。

模糊搜索实现

该实现结合了SQL查询与Fuse.js,以实现灵活的实体搜索:

  • DuckDB SQL查询从数据库中检索基础数据
  • Fuse.js 在检索到的数据上提供了模糊匹配功能
  • 这种混合方法既支持结构化查询,也支持灵活的文本匹配
  • 搜索结果包括完全匹配和部分匹配,按相关性排序

发展

设置

pnpm install

测试

pnpm test

许可证

这个项目采用MIT许可证授权——详见 许可证 文件中有详细信息。

目录标签

目录标签

知识图谱TypeScriptClaude本地部署内存数据库DuckDB实体关系模糊搜索

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Node.js

来源包(packageName,安装包名)

@smithery/cli

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP