Knowledge Graph Memory Server

メモリカスタム:PouchDB🧠

このプロジェクトは、MCPチームが提供するメモリサーバーに新機能を追加します。言語モデル(LLM)を介してインタラクションをキャプチャするナレッジグラフの作成と管理が可能になります。🚀

このリポジトリはhttps://github.com/BRO3886/mcp-memory-customからフォークされました。素晴らしい出発点となりました。タイムスタンプの修正に改めて感謝いたします。このリポジトリの目的は、コンテキスト用のJSONファイルが増え続ける問題を解決することでした。

新機能✨

1. PouchDBとの統合 💾

  • サーバーは、堅牢なドキュメントベースのストレージとしてPouchDBを使用するようになりました。
  • 理由: データの一貫性の向上、組み込みのバージョン管理、大規模データセットのパフォーマンスの向上
  • 互換性のためにファイルのバックアップを維持します

2. カスタムメモリパス 📁

  • ユーザーは、さまざまなプロジェクトごとに異なるメモリファイルパスを指定できるようになりました。
  • 理由: この機能により、メモリデータの整理と管理が強化され、プロジェクト固有のメモリストレージが可能になります。

3. タイムスタンプ ⏰

  • サーバーはインタラクションのタイムスタンプを生成するようになりました
  • なぜ? :タイムスタンプにより、各メモリがいつ作成または変更されたかを追跡できるようになり、保存されたデータのコンテキストと履歴が向上します。

はじめに🚀

前提条件🔧

  • Node.js (バージョン 16 以上)
  • PouchDB(依存関係として自動的にインストールされます)

Smithery 経由でインストール 📦

Smithery経由で Claude Desktop 用の Knowledge Graph Memory Server を自動的にインストールするには:

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

設定 ⚙️

サーバーでは、次の 2 つの環境変数を設定する必要があります。

  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).
ローカルでサーバーを実行する 💻

Knowledge Graph メモリ サーバーを起動するには、次のコマンドを実行します。

npm run build node dist/index.js

サーバーは標準入出力を介してリクエストをリッスンします。

APIエンドポイント 🔌

サーバーは、特定のパラメータで呼び出すことができるいくつかのツールを公開します。

  • 現在の時刻を取得する
  • メモリファイルパスの設定📁
  • エンティティを作成する
  • リレーションを作成する🔗
  • 観察事項を追加する📝
  • エンティティを削除
  • 観察結果を削除する🗑️
  • 関係を削除する🔗
  • グラフを読む📖
  • 検索ノード🔍
  • オープンノード🔓

謝辞🙏

  • AnthropicのMemoryサーバーにインスパイアされた
  • 堅牢なデータストレージのために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. New Features ✨
    1. 1. PouchDB Integration 💾
    2. 2. Custom Memory Paths 📁
    3. 3. Timestamping ⏰
  2. Getting Started 🚀
    1. Prerequisites 🔧
    2. Installing via Smithery 📦
    3. Installation 🛠️
    4. Configuration ⚙️
    5. Running the Server 🚀
  3. API Endpoints 🔌
    1. Acknowledgments 🙏

      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
        48
        25
        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

      ID: mw0ta0gz8j