Elasticsearch Knowledge Graph for MCP

by j3k0

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Integrations

  • Uses Elasticsearch as the backend for the knowledge graph, providing distributed, scalable storage for entities and relations with advanced search capabilities

  • Provides a TypeScript interface to Elasticsearch with all core operations for interacting with the knowledge graph

MCP メモリ: AI 会話のための永続メモリ 🧠

**AIに会話を通して記憶を永続化させましょう。**重要な文脈を失わないように。

MCPメモリは、Elasticsearchを基盤とする堅牢なナレッジグラフシステムで、AIモデルにコンテキストウィンドウの制限を超えた永続的なメモリを提供します。モデルコンテキストプロトコル(MCP)向けに構築されており、LLMが重要な情報を永続的に記憶し、より一貫性があり、パーソナライズされた、効果的なAI対話を実現します。

🌟 AIモデルに永続メモリが必要な理由

AI アシスタントでこのようなフラストレーションを感じたことはありませんか?

  • AIが以前の会話の重要な詳細を忘れてしまう
  • 新しいチャットを始めるたびに同じ内容を繰り返さなければならない
  • 会話履歴がいっぱいになると貴重な洞察が失われる
  • 過去の仕事や決定を参照できない

MCP Memoryは、コンテキストを無期限に保存する構造化された検索可能なメモリストアを作成することで、これらの問題を解決します。AIはユーザーと有意義で長期的な関係を構築し、数日、数週間、あるいは数か月にわたるインタラクションを通して一貫性を維持できるようになります。

✨ 主な特徴

  • 📊 永続メモリ:複数のセッションにわたって情報を保存および取得します
  • 🔍 スマート検索: 強力なElasticsearchクエリで必要なものを正確に見つけます
  • 📓 コンテキストリコール:AIが会話に基づいて関連情報を自動的に優先順位付けします
  • 🧩 関係理解:人間の連想記憶を模倣した関係性と概念を結び付ける
  • 🔄長期記憶 / 短期記憶:一時的な詳細と重要な知識を区別する
  • 🗂️ メモリゾーン: 情報を別々のドメイン(プロジェクト、クライアント、トピック)に整理します
  • 🔒 信頼性と拡張性:Elasticsearch をベースに構築され、エンタープライズグレードのパフォーマンスを実現

🚀 5分でセットアップ

始めるのは非常に簡単です:

前提条件

  • Docker : Elasticsearch (またはローカルのElasticsearchインストール)を実行するために必要
  • Node.js : バージョン18以上
  • npm : パッケージ管理用
# 1. Clone the repository git clone https://github.com/mcp-servers/mcp-servers.git cd mcp-servers/memory # 2. Install dependencies npm install # 3. Start Elasticsearch (uses Docker) npm run es:start # Note: If you prefer to use your own Elasticsearch installation, # set the ES_NODE environment variable to point to your Elasticsearch instance # 4. Build the project npm run build

🔌 Claude デスクトップへの接続

MCP Memory は Claude Desktop とシームレスに連携するように設計されており、すべての会話にわたって Claude に永続的なメモリを提供します。

  1. 起動スクリプトをコピーして設定しますリポジトリには、簡単にコピーできるlaunch.exampleファイルが含まれています。
    # Copy the example launch file cp launch.example launch.sh # Edit launch.sh to add your Groq API key # This is required for smart memory retrieval nano launch.sh # or use your preferred editor
    スクリプトを実行可能にします。
    chmod +x launch.sh
  2. Claude Desktopにコマンドを追加します:
    • クロードのデスクトップ設定を開く
    • 「コマンド」セクションに移動します
    • 「新しいコマンドを追加」をクリックします
    • 次のように設定します。
      • 名前:MCPメモリ
      • コマンド: /path/to/mcp-servers/memory/launch.sh
      • 引数: 空のままにする
      • バックグラウンドで実行: はい
      • メニューに表示: はい
  3. 接続を確認してください:
    • Claude Desktopからコマンドを開始する
    • クロードがMCPメモリに接続されているという通知が表示されます。
    • 以前の会話で話し合ったことについて、クロードに聞いてみてください。

完全な例とビジュアル ガイドについては、 Claude Desktop MCP サーバー セットアップ ガイドをオンラインで参照してください。

💡 仕組み

MCP メモリは、次のような構造化された知識グラフを作成します。

  1. エンティティは人、概念、プロジェクト、または覚えておく価値のあるものを表します
  2. 関係はエンティティを結び付け、関連のネットワークを作成します
  3. 観察は実体に関する特定の詳細を捉える
  4. 関連性スコアリングにより、どの情報を優先するかを決定します

LLM と統合すると、システムは自動的に次の処理を実行します。

  • 会話中に得た新しい情報を保存する
  • 必要に応じて関連するコンテキストを取得します
  • 関連する概念間のつながりを構築する
  • 重要な知識は保持しながら、重要でない詳細は忘れる

🛠️ 例: エージェントがメモリを使用する方法

ユーザーの視点から

会話1:初期情報

User: My daughter's name is Emma and she's turning 8 next month. Claude: That's wonderful! Emma will be turning 8 next month. Is there anything special you're planning for her birthday? (Behind the scenes: Claude stores "Emma" as an entity of type "Person" with observations about her age and birthday timing)

会話2: 数日後または数週間後

User: I'm thinking about what to get for a gift. Claude: If you're looking for gift ideas for Emma's 8th birthday coming up, have you considered what her current interests are? At that age, many children enjoy creative items, books, or educational games. (Behind the scenes: Claude retrieved the entity "Emma", her age, and the fact that her birthday is approaching)

会話3:誕生日の後

User: The party went really well on Saturday! Claude: I'm glad Emma's 8th birthday party was a success on Saturday! Did she enjoy the gifts she received? (Behind the scenes: Claude updates the observations about Emma, noting that her birthday party occurred on a Saturday and went well)

エージェントがメモリを使用する方法

ユーザーが重要なことを言及すると、エージェントは次のことを行います。

  1. 覚えておく価値のある重要な情報を認識する
  2. エンティティ、関係、観察を作成してメモリに保存します
  3. 新しい詳細が明らかになったときに既存の情報を更新します

ユーザーが保存されている情報に関連する何かを言及すると、エージェントは次の操作を実行します。

  1. 現在の会話に基づいて関連するコンテキストをメモリから検索します
  2. 役に立つかもしれない重要な詳細を取得します
  3. この情報を自然に応答に組み込む

これは自動的に行われます。ユーザーはアシスタントと通常の会話をするだけで、メモリ システムがバックグラウンドで動作し、セッション間でコンテキストを維持します。

インテリジェントなエンティティ管理

MCP メモリには、エンティティの作成と更新のスマートな処理が含まれています。

  • すでに存在するエンティティを作成しようとすると、システムは既存のエンティティデータと、それを新しい情報で拡張する方法のガイダンスを返します。
  • システムは、新しいエンティティの作成と既存のエンティティの更新をインテリジェントに区別します。
  • 情報が更新されてもエンティティ関係は自動的に維持されます

🧰 管理ツール

MCP Memory には、ナレッジ グラフを維持するための包括的な管理 CLI が含まれています。

# Search the memory node dist/admin-cli.js search "Emma birthday" # View details about a specific entity node dist/admin-cli.js entity "Emma" # Back up your entire memory system node dist/admin-cli.js backup memory-backup.json

📚 高度な機能

メモリゾーン

知識を個別のドメインに整理します。

# Create a project-specific memory zone node dist/admin-cli.js zones add client-acme "ACME Corp Project Knowledge" # Import data into that zone node dist/admin-cli.js import acme-data.json client-acme

会話型メモリ管理

自然な会話を通じて、アシスタントにさまざまなゾーンの記憶を整理するように指示することもできます。

メモリゾーンの作成と使用

User: Claude, can you create a new memory zone called "work-project" for storing information about my current work project? Claude: I've created a new memory zone called "work-project". I'll store information related to your work project in this zone. What would you like me to remember about your project? User: The project deadline is March 15th, and we're building a new inventory management system. Claude: I've stored information about your work project in the "work-project" zone, including the March 15th deadline and that you're building an inventory management system. I'll keep future information about this project organized in this zone. (Behind the scenes: Claude creates a new memory zone and stores project information specifically in that zone)

ゾーン固有の情報の取得

User: What do you remember about my work project? Claude: Based on what we've discussed about your work project, I recall that you're building an inventory management system with a deadline of March 15th. (Behind the scenes: Claude specifically searches the "work-project" zone for relevant information)

メモリゾーンの切り替え

User: Claude, let's switch to my "cooking" memory zone now. I want to discuss a recipe. Claude: I've switched to your "cooking" memory zone. What recipe would you like to discuss today? (Behind the scenes: Claude updates its memory context to prioritize searching in the "cooking" zone) User: What was that pasta dish I told you about last month? Claude: From our previous conversations in your cooking zone, you shared a carbonara recipe that used pancetta, eggs, pecorino cheese, and black pepper. You mentioned it was a family favorite that you learned during your trip to Rome. (Behind the scenes: Claude searches specifically in the "cooking" zone to find this information)

メモリを個別のゾーンに整理することで、会話の関連性が高まり、現在のトピックやプロジェクトに焦点が当てられるようになります。

検索機能

Elasticsearch の強力な検索機能を活用します。

# Fuzzy search (finds "meeting" even with typo) node dist/admin-cli.js search "meteing notes" # Zone-specific search node dist/admin-cli.js search "budget" client-acme

🤝 貢献する

貢献を歓迎します!詳細はCONTRIBUTING.mdをご覧ください。

📝 ライセンス

マサチューセッツ工科大学


You must be authenticated.

A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

Elasticsearch を使用してモデル コンテキスト プロトコルにスケーラブルなナレッジ グラフ実装を提供し、高度な検索機能、メモリのような動作、マルチゾーン アーキテクチャを使用して AI モデルが情報を保存およびクエリできるようにします。

  1. 🌟 Why AI Models Need Persistent Memory
    1. ✨ Key Features
      1. 🚀 5-Minute Setup
        1. Prerequisites
        2. 🔌 Connecting to Claude Desktop
      2. 💡 How It Works
        1. 🛠️ Example: How Agents Use Memory
          1. From the User's Perspective
          2. How the Agent Uses Memory
          3. Intelligent Entity Management
        2. 🧰 Admin Tools
          1. 📚 Advanced Features
            1. Memory Zones
            2. Conversational Memory Management
            3. Search Capabilities
          2. 🤝 Contributing
            1. 📝 License
              ID: h9w4cyfdqx