mcpField
M
Memory Custom

Memory Custom

本地服务
github.com/BRO3886记忆与知识484 周前更新

关于 Memory Custom

Memory Custom 扩展了 MCP 团队的 Memory 服务,支持项目专属的记忆文件,并为交互添加时间戳。它面向将交互数据存为知识图谱并进行检索的 MCP 客户端。

主要功能

  1. 01设置自定义记忆文件路径
  2. 02为不同项目使用独立记忆文件
  3. 03为交互添加时间戳
  4. 04创建实体和关系
  5. 05添加或删除观察记录
  6. 06读取、搜索和打开图谱节点

适用场景

  1. 01按项目隔离记忆数据
  2. 02追踪图谱信息的创建或修改时间
  3. 03在交互中搜索已存储的实体和关系

MCP 相关

向 MCP 客户端提供记忆图谱操作工具,包括选择文件路径、创建图谱、检索、搜索和删除。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

mcp.json · 通用配置
{
"mcpServers": {
"memory-custom": {
"command": "npx",
"args": [
"-y",
"@smithery/cli"
]
}
}
}
启动命令npx -y @smithery/cli

本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。

安装包
npm@smithery/cli

工具

还没有获取到工具列表

本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。

详细介绍

Memory Custom

smithery badge

此项目为 MCP 团队提供的 Memory 服务添加了新功能。它可以创建和管理知识图谱,使用大语言模型(LLM)记录交互。

Memory Custom MCP server

新功能

1. 自定义记忆路径
  • 用户现在可以为不同项目指定不同的记忆文件路径。
  • **原因:**此功能可增强记忆数据的组织和管理能力,支持按项目存储记忆。
2. 时间戳
  • 服务现在会为交互生成时间戳。
  • **原因:**时间戳可以追踪每条记忆的创建或修改时间,为存储的数据提供更丰富的上下文和历史记录。

开始使用

前置条件
  • Node.js(版本 16 或更高)
通过 Smithery 安装

要通过 Smithery 为 Claude Desktop 自动安装 Knowledge Graph Memory Server:

npx -y @smithery/cli install @BRO3886/mcp-memory-custom --client claude
安装
  1. 克隆代码库:

    git clone [email protected]:BRO3886/mcp-memory-custom.git
    cd mcp-memory-custom
    
  2. 安装依赖:

    npm install
    
配置

运行服务之前,可以设置 MEMORY_FILE_PATH 环境变量来指定记忆文件的路径。如果未设置,服务默认使用与脚本位于同一目录下的 memory.json。

运行服务
更新 mcp 服务 json 文件

将以下内容添加到 claude_desktop_config.json / .cursor/mcp.json 文件中:

{
  "mcpServers": {
    "memory": {
      "command": "node",
      "args": ["/path/to/mcp-memory-custom/dist/index.js"]
    }
  }
}

系统提示词变更:

Follow these steps for each interaction:
1. The memoryFilePath for this project is /path/to/memory/project_name.json - always pass this path to the memory file operations (when creating entities, relations, or retrieving memory etc.)
2. User Identification:
   - You should assume that you are interacting with default_user
   - If you have not identified default_user, proactively try to do so.

3. Memory Retrieval:
   - Always begin your chat by saying only "Remembering..." and retrieve all relevant information from your knowledge graph
   - Always refer to your knowledge graph as your "memory"

4. 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)

5. 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, add timestamps to wherever required. You can get current timestamp via get_current_time
     b) Connect them to the current entities using relations
     c) Store facts about them as observations, add timestamps to observations via get_current_time


IMPORTANT: Provide a helpful and engaging response, asking relevant questions to encourage user engagement. Update the memory during the interaction, if required, based on the new information gathered (point 4).
在本地运行服务

要启动 Knowledge Graph Memory Server,请运行:

npm run build
node dist/index.js

服务将通过标准输入/输出接收请求。

API 端点

此服务提供了多个可使用特定参数调用的工具:

  • 获取当前时间
  • 设置记忆文件路径
  • 创建实体
  • 创建关系
  • 添加观察记录
  • 删除实体
  • 删除观察记录
  • 删除关系
  • 读取图谱
  • 搜索节点
  • 打开节点

致谢

  • 灵感来自 Anthropic 的 Memory 服务。

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。