Skip to main content
Glama
Memory Custom

Memory Custom

by BRO3886

记忆定制

铁匠徽章

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

新功能

1. 自定义内存路径

  • 用户现在可以为不同的项目指定不同的内存文件路径。

  • 为什么? :此功能增强了内存数据的组织和管理,允许特定于项目的内存存储。

2.时间戳

  • 服务器现在为交互生成时间戳。

  • 为什么? :时间戳可以追踪每个内存的创建或修改时间,为存储的数据提供更好的背景和历史记录。

Related MCP server: KG Memory

入门

先决条件

  • Node.js(版本 16 或更高版本)

通过 Smithery 安装

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

npx -y @smithery/cli install @BRO3886/mcp-memory-custom --client claude

安装

  1. 克隆存储库:

    git clone git@github.com: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).

本地运行服务器

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

npm run build
node dist/index.js

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

API 端点

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

  • 获取当前时间

  • 设置内存文件路径

  • 创建实体

  • 创建关系

  • 添加观察结果

  • 删除实体

  • 删除观察结果

  • 删除关系

  • 读图

  • 搜索节点

  • 开放节点

致谢

  • 受到 Anthropic 的内存服务器的启发。

Available Tools

10 tools
add_observationsC

Add new observations to existing entities in the knowledge graph

Inputs: observations (required), memoryFilePath (required).

create_entitiesC

Create multiple new entities in the knowledge graph

Inputs: entities (required), memoryFilePath (required).

create_relationsC

Create multiple new relations between entities in the knowledge graph. Relations should be in active voice

Inputs: relations (required), memoryFilePath (required).

delete_entitiesC

Delete multiple entities and their associated relations from the knowledge graph

Inputs: entityNames (required), memoryFilePath (required).

delete_observationsC

Delete specific observations from entities in the knowledge graph

Inputs: deletions (required), memoryFilePath (required).

delete_relationsC

Delete multiple relations from the knowledge graph

Inputs: relations (required), memoryFilePath (required).

get_current_timeB

Get the current time

Inputs: no named parameters.

open_nodesC

Open specific nodes in the knowledge graph by their names

Inputs: names (required), memoryFilePath (required).

read_graphC

Read the entire knowledge graph

Inputs: memoryFilePath (required).

search_nodesC

Search for nodes in the knowledge graph based on a query

Inputs: query (required), memoryFilePath (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 10 tools

    Disambiguation4/5

    Most tools have distinct purposes focused on knowledge graph operations, but 'open_nodes' and 'search_nodes' could be confused as both involve accessing nodes. The descriptions clarify that 'open_nodes' retrieves specific nodes by name while 'search_nodes' queries based on content, but the overlap in node retrieval might cause misselection.

    Naming Consistency4/5

    Tools follow a consistent verb_noun pattern (e.g., add_observations, create_entities) with minor deviations. 'get_current_time' uses 'get' instead of a more domain-specific verb, and 'open_nodes' uses 'open' which is less common in this context, but overall the naming is readable and mostly predictable.

    Tool Count5/5

    With 10 tools, the count is well-scoped for managing a knowledge graph, covering creation, deletion, reading, and search operations. Each tool earns its place by addressing specific aspects of entity, relation, and observation handling, without feeling excessive or insufficient.

    Completeness4/5

    The tool set provides good coverage for knowledge graph CRUD operations, including create, read, and delete for entities, relations, and observations. A minor gap is the lack of update tools (e.g., update_entities or update_relations), which agents might need to work around by deleting and recreating, but core workflows are supported.

    Maintenance

    ActivityInactive
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      An advanced MCP server providing RAG-enabled memory through a knowledge graph with vector search capabilities, enabling intelligent information storage, semantic retrieval, and document processing.
      33 npm
      47
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that implements a heavily typed knowledge graph memory system with AI-powered entity and relation extraction, enabling structured knowledge storage and retrieval from unstructured text using predefined or custom ontologies.
      9
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      MCP server that gives AI agents and teams persistent, shared memory using a knowledge graph with vector embeddings, automatic consolidation of related facts, and hybrid search.
      3
      -