
带 DuckDB 后端的 MCP 内存服务器
概览
官方知识图谱内存服务器的分支版本。 通过 Smithery 自动安装 DuckDB 知识图谱内存服务器用于 Claude Desktop: 否则,手动在claude_desktop_config.json中添加@IzumiSy/mcp-duckdb-memory-server(MEMORY_FILE_PATH为可选) 该路径上存储的数据是一个DuckDB数据库文件。 该项目通过用DuckDB替代原有的MCP知识图谱内存服务器后端,增强了其后端。 最初的MCP知识图谱内存服务器使用JSON文件作为数据存储,并进行内存内搜索。虽然这种方法对小型数据集表现良好,但也带来了若干挑战: 1. : 随着数据集的增长,内存内搜索性能下降 2.: 处理大量实体和关系时内存使用显著增加 3.: 复杂的查询和条件搜索难以实现 4.
概述(AI 翻译)
官方知识图谱内存服务器的分支版本。
安装
通过Smithery安装
通过 Smithery 自动安装 DuckDB 知识图谱内存服务器用于 Claude Desktop:
手动安装
否则,请手动在你的 claude_desktop_config.json 中添加 [@IzumiSy/mcp-duckdb-memory-server(MEMORY_FILE_PATH 为可选)
该路径上存储的数据是一个DuckDB数据库文件。
Docker
建造
跑
用途
请使用下面的示例说明
动机
该项目通过用DuckDB替代原有的MCP知识图谱内存服务器后端,增强了其后端。
为什么是DuckDB?
最初的MCP知识图谱内存服务器使用JSON文件作为数据存储,并进行内存内搜索。虽然这种方法对小型数据集表现良好,但也带来了若干挑战:
- 性能:随着数据集的增长,内存内搜索性能下降
- 可扩展性:处理大量实体和关系时内存使用显著增加
- 查询灵活性:复杂的查询和条件搜索难以实现
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
MCP DuckDB Knowledge Graph Memory Server
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:
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)
{
"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
docker build -t mcp-duckdb-graph-memory .
Run
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:
安装
npx -y @izumisy/mcp-duckdb-memory-server配置
{
"mcpServers": {
"graph-memory": {
"command": "npx",
"args": [
"-y",
"@izumisy/mcp-duckdb-memory-server"
],
"env": {
"MEMORY_FILE_PATH": "/path/to/your/memory.data"
}
}
}
}