
MCP 服务器通过知识图谱实现 Claude 的持久性知识存储,后端多存储和模糊搜索
概览
我对这类自动化上下文管理工具感到失望,因为它几乎无法控制。过了一段时间,我总得手动清理混乱或纠正不合适的LLM笔记。相反,我创建了一个工具,让LLM代理访问动态加载的上下文。不过,上下文本身是用户创建的:https://github.com/n-r-w/agent-standards-mcp 一种简单的方法,让LLM在对话中持续记忆。这个服务器让Claude或vscode通过知识图谱记住关于你、你的项目和偏好的信息。 主要功能:- : PostgreSQL(推荐)或 SQLite(本地文件)- : 保持不同项目隔离(通过提示自动检测) - : 通过模糊搜索和分页查找信息 请按照以下步骤让知识图谱在Claude上运行: - 无需安装数据库 - 自动创建在[你的主文件夹]/中的数据库文件。
概述(AI 翻译)
我对这类自动化上下文管理工具感到失望,因为几乎无法控制。过了一段时间,我总得手动清理杂乱或纠正不合适的LLM笔记。 相反,我创建了一个工具,让LLM代理访问动态加载的上下文。不过,上下文本身是用户创建的:https://github.com/n-r-w/agent-standards-mcp
KnowledgeGraph MCP 服务器
一种简单的方法,让LLM在对话中持续记忆。这个服务器让Claude或vscode通过知识图谱记住关于你、你的项目和偏好的信息。
主要特色:
- 多存储后端:PostgreSQL(推荐)或SQLite(本地文件)
- 项目分离:保持不同项目隔离(通过提示自动检测)
- Better Search:通过模糊搜索和分页查找信息
完整设置指南
请按照以下步骤让知识图谱在Claude上运行:
第一步:选择安装方法
选项A:NPX(最简单——无需下载)
选项B:Docker
第二步:选择你的数据库
SQLite(默认设置——无需设置):
- 无需安装数据库
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
WARNING
I’ve become disillusioned with automated context management tools like this, as it’s nearly impossible to control. After a while, I always have to manually clean up the mess or correct inappropriate LLM notes. Instead, I created a tool that gives the LLM agent access to dynamically loaded context. However, the context itself is user-created: https://github.com/n-r-w/agent-standards-mcp
KnowledgeGraph MCP Server
A simple way to give LLMs persistent memory across conversations. This server lets Claude or vscode remember information about you, your projects, and your preferences using a knowledge graph.
Key Features:
- Multiple Storage Backends: PostgreSQL (recommended) or SQLite (local file)
- Project Separation: Keep different projects isolated (auto-detected using prompts)
- Better Search: Find information with fuzzy search and pagination
Complete Setup Guide
Follow these steps in order to get the knowledge graph working with Claude:
Step 1: Choose Your Installation Method
Option A: NPX (Easiest - No download needed)
# Test that it works
npx knowledgegraph-mcp --help
Option B: Docker
# Clone and build
git clone https://github.com/n-r-w/knowledgegraph-mcp.git
cd knowledgegraph-mcp
docker build -t knowledgegraph-mcp .
Step 2: Choose Your Database
SQLite (Default - No setup needed):
- No database installation required
- Database file created automatically in
[you home folder]/.knowledge-graph/ - Perfect for personal use and most scenarios
- This is the default backend
PostgreSQL (For advanced users):
- Install PostgreSQL on your system
- Create a database:
CREATE DATABASE knowledgegraph; - Better for production use with multiple concurrent users
Step 3: Configure client
Claude Desktop
Edit your Claude Desktop configuration file:
Find your config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
If you chose NPX + SQLite (default and easiest):
{
"mcpServers": {
"Knowledge Graph": {
"command": "npx",
"args": ["-y", "knowledgegraph-mcp"]
}
}
}
Note: SQLite will automatically create the database in
[you home folder]/.knowledge-graph/knowledgegraph.db. To use a custom location, add:"KNOWLEDGEGRAPH_SQLITE_PATH": "/path/to/your/database.db"
If you chose Docker + SQLite (default):
{
"mcpServers": {
"Knowledge Graph": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-v", "[you home folder]/.knowledge-graph:/app/.knowledge-graph",
"knowledgegraph-mcp"
]
}
}
}
安装
npx -y knowledgegraph-mcp配置
{
"mcpServers": {
"Knowledge Graph": {
"command": "npx",
"args": ["-y", "knowledgegraph-mcp"]
}
}
}