知识图谱内存服务器
使用本地知识图谱实现持久内存的基本实现。这使得 Claude 能够在聊天过程中记住用户的相关信息。
核心概念
实体
实体是知识图谱中的主要节点。每个实体具有:
唯一名称(标识符)
实体类型(例如“人”、“组织”、“事件”)
观察结果列表
例子:
关系
关系定义了实体之间的有向连接。它们始终以主动语态存储,描述实体之间如何交互或关联。
例子:
观察
观察值是关于实体的离散信息片段。它们是:
存储为字符串
附加到特定实体
可以独立添加或删除
应该是原子的(每个观察一个事实)
例子:
API
工具
创建实体
在知识图谱中创建多个新实体
输入:
entities
(对象数组)每个对象包含:
name
(字符串):实体标识符entityType
(字符串):类型分类observations
(string[]):相关观察
忽略具有现有名称的实体
创建关系
在实体之间创建多个新关系
输入:
relations
(对象数组)每个对象包含:
from
(字符串):源实体名称to
(字符串):目标实体名称relationType
(字符串):主动语态的关系类型
跳过重复关系
添加观察结果
向现有实体添加新观察
输入:
observations
(对象数组)每个对象包含:
entityName
(字符串):目标实体contents
(string[]):要添加的新观察结果
返回每个实体添加的观察值
如果实体不存在则失败
删除实体
删除实体及其关系
输入:
entityNames
(string[])级联删除关联关系
如果实体不存在则静默操作
删除观察结果
从实体中删除特定观察结果
输入:
deletions
(对象数组)每个对象包含:
entityName
(字符串):目标实体observations
(string[]):要删除的观察结果
如果不存在观察,则静默运行
删除关系
从图中删除特定关系
输入:
relations
(对象数组)每个对象包含:
from
(字符串):源实体名称to
(字符串):目标实体名称relationType
(字符串):关系类型
如果关系不存在则静默操作
读取图
阅读整个知识图谱
无需输入
返回包含所有实体和关系的完整图形结构
搜索节点
根据查询搜索节点
输入:
query
(字符串)搜索范围:
实体名称
实体类型
观察内容
返回匹配的实体及其关系
打开节点
按名称检索特定节点
输入:
names
(string[])返回:
请求的实体
被请求实体之间的关系
默默跳过不存在的节点
与 Claude Desktop 一起使用
设置
将其添加到您的 claude_desktop_config.json 中:
Docker
NPX
具有自定义设置的 NPX
可以使用以下环境变量配置服务器:
MEMORY_FILE_PATH
:内存存储 JSON 文件的路径(默认值:服务器目录中的memory.json
)
VS Code 安装说明
为了快速安装,请使用以下一键安装按钮之一:
如需手动安装,请将以下 JSON 块添加到 VS Code 中的“用户设置 (JSON)”文件中。您可以按下Ctrl + Shift + P
并输入Preferences: Open Settings (JSON)
来完成此操作。
或者,您可以将其添加到工作区中名为.vscode/mcp.json
的文件中。这样您就可以与其他人共享该配置。
请注意
.vscode/mcp.json
文件中不需要mcp
键。
NPX
Docker
系统提示
使用记忆的提示取决于用例。更改提示将有助于模型确定创建记忆的频率和类型。
以下是聊天个性化提示的示例。您可以在Claude.ai 项目的“自定义说明”字段中使用此提示。
建筑
Docker:
执照
此 MCP 服务器采用 MIT 许可证。这意味着您可以自由使用、修改和分发该软件,但须遵守 MIT 许可证的条款和条件。更多详情,请参阅项目仓库中的 LICENSE 文件。
local-only server
The server can only run on the client's local machine because it depends on local resources.
Tools
使用本地知识图谱实现持久内存的基本实现。这使得 Claude 能够在聊天过程中记住用户的相关信息。
Related MCP Servers
- AsecurityAlicenseAqualityAn improved implementation of persistent memory using a local knowledge graph with a customizable --memory-path. This lets Claude remember information about the user across chats.Last updated -91,113652MIT License
- AsecurityAlicenseAqualityEnhances user interaction through a persistent memory system that remembers information across chats and learns from past errors by utilizing a local knowledge graph and lesson management.Last updated -1371,16652MIT License
- -securityAlicense-qualityA persistent memory implementation using a local knowledge graph that lets Claude remember information about users across conversations.Last updated -6MIT License
- AsecurityAlicenseAqualityAn implementation of persistent memory for Claude using a local knowledge graph, allowing the AI to remember information about users across conversations with customizable storage location.Last updated -1122854JavaScriptMIT License
Appeared in Searches
- Basic concepts and understanding of memory
- Using an MCP server with Atlassian JIRA to extract ticket descriptions
- Resources or services available for free
- Using Knowledge Base Files for Drafting, Writing, and Editing Documents
- A server to import Postman collections and get all features without Postman dependency