Claude Memory MCP Server

by WhenMoon-afk
Verified

local-only server

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

クロード・メモリ MCP サーバー

大規模言語モデルに永続メモリ機能を提供する MCP (モデル コンテキスト プロトコル) サーバー実装。特に Claude デスクトップ アプリケーションと統合するように設計されています。

概要

このプロジェクトは、この分野における最新のアプローチを包括的に研究し、最適な記憶技術を実装します。これにより、クロードは会話やセッションをまたいで永続的な記憶を維持するための標準化された方法を得ることができます。

特徴

  • 階層型メモリアーキテクチャ:短期、長期、アーカイブメモリの階層
  • 複数のメモリタイプ:会話、知識、エンティティ、リフレクションのサポート
  • セマンティック検索:意味的類似性に基づいて記憶を検索する
  • 記憶の統合:短期記憶を長期記憶に自動的に統合する
  • 記憶管理:重要度に基づく記憶の保持と忘却
  • Claude 統合: Claude デスクトップ アプリケーションとのすぐに使用できる統合
  • MCPプロトコルサポート: モデルコンテキストプロトコルと互換性あり

建築

MCP サーバーは、次のコンポーネントを持つ機能ドメインベースのアーキテクチャに従います。

┌─────────────────────────────────────────────────────────┐ │ Claude Desktop │ └───────────────────────────┬─────────────────────────────┘ │ ┌───────────────────────────▼─────────────────────────────┐ │ MCP Interface │ │ ┌─────────────────┐ ┌─────────────────┐ ┌──────────┐ │ │ │ Tool Definitions│ │ Request Handler │ │ Security │ │ │ └─────────────────┘ └─────────────────┘ └──────────┘ │ └───────────────────────────┬─────────────────────────────┘ │ ┌───────────────────────────▼─────────────────────────────┐ │ Memory Domain Manager │ ├─────────────────┬─────────────────┬────────────────────┤ │ Episodic Domain│ Semantic Domain│ Temporal Domain │ ├─────────────────┴─────────────────┴────────────────────┤ │ Persistence Domain │ └─────────────────────────────────────────────────────────┘

機能ドメイン

  1. エピソードドメイン:セッションベースのインタラクションと文脈記憶を管理する
  2. セマンティックドメイン:知識の組織化と検索を扱う
  3. 時間領域:時間を考慮した記憶処理を制御する
  4. 永続ドメイン: ストレージの最適化と取得を管理します

インストール

前提条件

  • Python 3.8以上
  • pip パッケージマネージャー

インストール手順

  1. リポジトリをクローンします。
    git clone https://github.com/WhenMoon-afk/claude-memory-mcp.git cd claude-memory-mcp
  2. 依存関係をインストールします:
    pip install -e .
  3. セットアップ スクリプトを実行します。
    chmod +x setup.sh ./setup.sh

クロードデスクトップ統合

Claude デスクトップ アプリケーションと統合するには、Claude 構成ファイルに次のコードを追加します。

{ "mcpServers": { "memory": { "command": "python", "args": ["-m", "memory_mcp"], "env": { "MEMORY_FILE_PATH": "/path/to/your/memory.json" } } } }

メモリファイル構造

メモリ システムは、次のコンポーネントを持つ JSON ベースのファイル構造を使用します。

{ "metadata": { "version": "1.0", "created_at": "ISO-8601 timestamp", "updated_at": "ISO-8601 timestamp" }, "memory_index": { // Vector index for fast semantic search }, "short_term_memory": [ // Recent and frequently accessed memories ], "long_term_memory": [ // Older or less frequently accessed memories ], "archived_memory": [ // Rarely accessed but potentially valuable memories ], "memory_schema": { // Schema definitions for memory entries }, "config": { // Configuration settings for memory management } }

使用法

サーバーの起動

python -m memory_mcp

利用可能なツール

  • store_memory : 新しい情報をメモリに保存する
  • retrieve_memory : クエリに基づいて関連するメモリを取得する
  • list_memories : フィルタリングオプションを使用して利用可能なメモリを一覧表示します
  • update_memory : 既存のメモリエントリを更新する
  • delete_memory : 特定のメモリを削除する
  • memory_stats : メモリストアに関する統計情報を取得する

発達

プロジェクト構造

memory_mcp/ ├── memory/ │ ├── models.py # Memory data models │ ├── storage.py # Memory storage operations │ ├── retrieval.py # Memory retrieval operations │ └── consolidation.py # Memory consolidation operations ├── domains/ │ ├── episodic.py # Episodic memory domain │ ├── semantic.py # Semantic knowledge domain │ ├── temporal.py # Temporal processing domain │ └── persistence.py # Storage and retrieval domain ├── mcp/ │ ├── server.py # MCP server implementation │ ├── tools.py # MCP tool definitions │ └── handler.py # Request handling ├── security/ │ └── validation.py # Input validation └── utils/ ├── embeddings.py # Vector embedding utilities └── schema.py # Schema validation

テストの実行

pytest

研究の背景

この実装は、現在の LLM 永続メモリ技術の包括的な研究に基づいています。

  • OSにヒントを得たメモリ管理: MemGPTに似た階層型メモリアーキテクチャ
  • 生物学的エピソード記憶:文脈依存記憶想起
  • ベクトル埋め込み:ベクトルデータベースアプローチにヒントを得たセマンティック検索
  • 自己反省:定期的な復習による記憶の定着

貢献

貢献を歓迎します!お気軽にプルリクエストを送信してください。

ライセンス

このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細については LICENSE ファイルを参照してください。

謝辞

  • LLMの最適な記憶技術の研究に基づく
  • Claudeとの統合のためのモデルコンテキストプロトコルを実装します
-
security - not tested
A
license - permissive license
-
quality - not tested

Claude に永続メモリ機能を提供する MCP サーバー。セマンティック検索、メモリ統合、Claude デスクトップ アプリケーションとの統合を備えた階層型メモリ アーキテクチャを提供します。

  1. Overview
    1. Features
      1. Architecture
        1. Functional Domains
      2. Installation
        1. Prerequisites
        2. Installation Steps
      3. Claude Desktop Integration
        1. Memory File Structure
          1. Usage
            1. Starting the Server
            2. Available Tools
          2. Development
            1. Project Structure
            2. Running Tests
          3. Research Background
            1. Contributing
              1. License
                1. Acknowledgements
                  ID: rfina3sajk