Skip to main content
Glama

Knowledge Graph Memory Server

by bneil

内存自定义:PouchDB🧠

该项目为 MCP 团队提供的内存服务器添加了新功能。它允许创建和管理通过语言模型 (LLM) 捕获交互的知识图谱。🚀

这个仓库是从https://github.com/BRO3886/mcp-memory-custom fork 来的,这是一个很好的起点,再次感谢你修复了时间戳。这个仓库的目标主要是修复 JSON 文件内容不断增加的问题。

新功能✨

1. PouchDB集成

  • 服务器现在使用 PouchDB 进行强大的基于文档的存储
  • 为什么? :更好的数据一致性、内置版本控制以及改进的大型数据集性能
  • 维护文件备份以确保兼容性

2. 自定义内存路径

  • 用户现在可以为不同的项目指定不同的内存文件路径
  • 为什么? :此功能增强了内存数据的组织和管理,允许特定于项目的内存存储

3.时间戳

  • 服务器现在为交互生成时间戳
  • 为什么? :时间戳可以追踪每个记忆的创建或修改时间,为存储的数据提供更好的上下文和历史记录

入门🚀

先决条件🔧

  • Node.js(版本 16 或更高版本)
  • PouchDB(作为依赖项自动安装)

通过 Smithery 安装

要通过Smithery自动为 Claude Desktop 安装知识图谱内存服务器:

npx -y @smithery/cli install @bneil/mcp-memory-pouchdb --client claude

安装🛠️

  1. 克隆存储库:
    git clone git@github.com:bneil/mcp-memory-pouchdb.git cd mcp-memory-pouchdb
  2. 安装依赖项:
    npm install

配置⚙️

服务器需要设置两个环境变量:

  1. MEMORY_FILE_PATH :存储内存备份文件的绝对路径
  2. POUCHDB_PATH :PouchDB 数据库存储的绝对路径

claude_desktop_config.json / .cursor/mcp.json中的示例配置:

{ "mcpServers": { "memory": { "command": "node", "args": ["/path/to/mcp-memory-pouchdb/dist/index.js"], "env": { "MEMORY_FILE_PATH": "/path/to/custom/memory.json", "POUCHDB_PATH": "/path/to/custom/pouchdb_directory", "DISABLE_MEMORY_FILE": "true" } } } }

如果未设置任一环境变量,服务器将无法启动。🚫

可选的环境变量:

  • POUCHDB_OPTIONS :附加 PouchDB 配置选项的 JSON 字符串
  • DISABLE_MEMORY_FILE :设置为“true”以禁用保存到memory.json文件(仅使用PouchDB进行存储)

运行服务器🚀

更新 mcp 服务器 json 文件 📝

将其添加到您的claude_desktop_config.json / .cursor/mcp.json文件中:

{ "mcpServers": { "memory": { "command": "node", "args": ["/path/to/mcp-memory-pouchdb/dist/index.js"], "env" : { "MEMORY_FILE_PATH":"/home/.../local_dbs/memory.json", "POUCHDB_PATH":"/home/.../local_dbs/pouchdb" } } } }

系统提示变更:

Follow these steps for each interaction: 0. Memory Initialization: - At startup, execute a read_graph function to initialize memory access - If memory is empty, create a default entity for the user with basic placeholder info - Run initialization sequence: read_graph → create_entities → read_graph 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 retrieve all relevant information from your knowledge graph - Always refer to your knowledge graph as your "memory" - Verify memory access is functioning properly 3. Memory Attention: - 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, 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 5. Error Recovery: - If memory retrieval fails, execute read_graph function immediately - Log any memory access failures for debugging - Continue the conversation with best available information 6. Memory Validation: - Periodically verify that memory access is functional by checking for core entities - If validation fails, attempt reconnection via read_graph 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 3).
本地运行服务器💻

要启动知识图谱内存服务器,请运行:

npm run build node dist/index.js

服务器将通过标准输入/输出监听请求。

API 端点

服务器公开了几个可以通过特定参数调用的工具:

  • 获取当前时间
  • 设置内存文件路径📁
  • 创建实体
  • 创建关系
  • 添加观察📝
  • 删除实体
  • 删除观察结果🗑️
  • 删除关系
  • 阅读图表📖
  • 搜索节点🔍
  • 开放节点🔓

致谢🙏

  • 灵感来自 Anthropic 的内存服务器
  • 由 PouchDB 提供支持,提供强大的数据存储💾
-
security - not tested
A
license - permissive license
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

通过实现 PouchDB 来实现强大的文档存储,并支持创建和管理通过语言模型捕获交互的知识图谱,从而增强 MCP 内存服务器。

  1. 新功能✨
    1. PouchDB集成
    2. 自定义内存路径
    3. 3.时间戳
  2. 入门🚀
    1. 先决条件🔧
    2. 通过 Smithery 安装
    3. 安装🛠️
    4. 配置⚙️
    5. 运行服务器🚀
  3. API 端点
    1. 致谢🙏

      Related MCP Servers

      • -
        security
        A
        license
        -
        quality
        This project is based on the Knowledge Graph Memory Server from the MCP servers repository and retains its core functionality.
        Last updated -
        44
        107
        TypeScript
        MIT License
        • Apple
      • A
        security
        A
        license
        A
        quality
        A customized MCP memory server that enables creation and management of a knowledge graph with features like custom memory paths and timestamping for capturing interactions via language models.
        Last updated -
        11
        2
        JavaScript
        MIT License
        • Apple
      • A
        security
        A
        license
        A
        quality
        A memory server for Claude that stores and retrieves knowledge graph data in DuckDB, enhancing performance and query capabilities for conversations with persistent user information.
        Last updated -
        8
        95
        38
        TypeScript
        MIT License
        • Apple
      • -
        security
        A
        license
        -
        quality
        Enhanced knowledge graph memory server for AI assistants that uses Neo4j as the backend storage engine, enabling powerful graph queries and efficient storage of user interaction information with full MCP protocol compatibility.
        Last updated -
        TypeScript
        MIT License

      View all related MCP servers

      MCP directory API

      We provide all the information about MCP servers via our MCP API.

      curl -X GET 'https://glama.ai/api/mcp/v1/servers/bneil/mcp-memory-pouchdb'

      If you have feedback or need assistance with the MCP directory API, please join our Discord server