MCP - Titan Memory Server

local-only server

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

Integrations

  • Collaboration between GitHub users @jasonkneen and @ExpressionsBot

  • Uses TensorFlow.js for efficient tensor operations in the neural memory model with operations wrapped in tf.tidy() for proper memory management

  • Implements a type-safe implementation with TypeScript including type-safe MCP tool definitions

🧠 MCP - Titan メモリサーバーの実装

@jasonkneen@ExpressionsBotのコラボレーション

Xでフォローしてください

Google Researchの論文「プログラミングのための生成AI:共通タスクフレームワーク」に着想を得た実装。このサーバーは、コード生成と理解を向上させるための研究で概説された原則に従い、メモリベクトルを介して状態を維持しながらシーケンスを学習および予測できるニューラルメモリシステムを提供します。

📚 研究背景

この実装は、コード生成モデルの評価と改善のためのフレームワークを紹介するGoogle Researchの論文(Muennighoff et al., 2024)で提示された概念に基づいています。Titan Memory Serverは、この論文の主要な概念を実装しています。

  • 記憶拡張シーケンス学習
  • 新奇性検出のための驚き指標
  • 安定学習のための多様体最適化
  • メモリベクトルによる状態維持

これらの機能は、メモリと状態の管理を改善することでコードの理解と生成を改善するという論文の目標と一致しています。

🚀 機能

  • 構成可能な次元を持つ神経記憶モデル
  • シーケンス学習と予測
  • 驚きのメトリック計算
  • モデルの永続性(保存/読み込み)
  • メモリ状態管理
  • 完全なMCPツール統合

📦 インストール

# Install dependencies npm install # Build the project npm run build # Run tests npm test

🛠️ 利用可能なMCPツール

1. 🎯 init_model

カスタム構成で Titan Memory モデルを初期化します。

{ inputDim?: number; // Input dimension (default: 64) outputDim?: number; // Output/Memory dimension (default: 64) }

2. 📚 train_step

現在の状態ベクトルと次の状態ベクトルを使用して、単一のトレーニング ステップを実行します。

{ x_t: number[]; // Current state vector x_next: number[]; // Next state vector }

3. 🔄 forward_pass

入力ベクトルを使用してモデルを順方向にパスします。

{ x: number[]; // Input vector }

4. 💾 save_model

モデルを指定されたパスに保存します。

{ path: string; // Path to save the model }

5. 📂 load_model

指定されたパスからモデルを読み込みます。

{ path: string; // Path to load the model from }

6. ℹ️ get_status

現在のモデルのステータスと構成を取得します。

{} // No parameters required

7. 🔄 train_sequence

ベクトルのシーケンスでモデルをトレーニングします。

{ sequence: number[][]; // Array of vectors to train on }

🌟 使用例

// Initialize model await callTool('init_model', { inputDim: 64, outputDim: 64 }); // Train on a sequence const sequence = [ [1, 0, 0, /* ... */], [0, 1, 0, /* ... */], [0, 0, 1, /* ... */] ]; await callTool('train_sequence', { sequence }); // Run forward pass const result = await callTool('forward_pass', { x: [1, 0, 0, /* ... */] });

🔧 技術的な詳細

  • 効率的なテンソル演算のためにTensorFlow.jsで構築
  • 安定した学習のために多様体最適化を使用する
  • 新規性検出のためのサプライズメトリックを実装
  • 適切なテンソルのクリーンアップによるメモリ管理
  • TypeScriptによる型安全な実装
  • 包括的なエラー処理

🧪 テスト

このプロジェクトには、以下を網羅した包括的なテストが含まれます。

  • モデルの初期化と構成
  • 訓練とフォワードパス操作
  • メモリ状態管理
  • モデルの永続性
  • エッジケースとエラー処理
  • テンソルのクリーンアップとメモリ管理

次のテストを実行します:

npm test

🔍 実装ノート

  • すべてのテンソル演算は適切なメモリ管理のためにtf.tidy()でラップされています。
  • 詳細なエラーメッセージで適切なエラー処理を実装します
  • 型安全なMCPツール定義を使用する
  • 操作間のメモリ状態を維持する
  • イプシロン許容値による浮動小数点精度の問題を処理する

📝 ライセンス

MIT ライセンス - 必要に応じて自由に使用および変更できます。

-
security - not tested
F
license - not found
-
quality - not tested

メモリ拡張モデルを使用したニューラル メモリ シーケンス学習を可能にし、状態管理、新規性検出、モデルの永続性などの機能を備え、コードの理解と生成を改善します。

  1. 📚 Research Background
    1. 🚀 Features
      1. 📦 Installation
        1. 🛠️ Available MCP Tools
          1. 1. 🎯 init_model
          2. 2. 📚 train_step
          3. 3. 🔄 forward_pass
          4. 4. 💾 save_model
          5. 5. 📂 load_model
          6. 6. ℹ️ get_status
          7. 7. 🔄 train_sequence
        2. 🌟 Example Usage
          1. 🔧 Technical Details
            1. 🧪 Testing
              1. 🔍 Implementation Notes
                1. 📝 License
                  ID: iasz64qj43