mcpField
V
V3 Memory Unification

V3 Memory Unification

github.com/ruvnetデータ・データベース101.0k38 回インストール2 日前に更新
リポジトリ

V3 Memory Unification について

V3 Memory Unificationは、複数のエージェント用メモリーバックエンドをAgentDBに統合するスキルです。アーキテクチャ設計、インデックス設定、データ移行に加え、HNSWベクトル検索とSONA学習パターンの保存を扱います。

主な機能

  1. 01複数のメモリーバックエンドをAgentDBに統合
  2. 02HNSWベクトルインデックスの設定
  3. 03SQLiteとMarkdownのデータ移行
  4. 04SONA学習パターンの保存
  5. 05エージェント間のメモリー共有

活用シーン

  1. 01メモリーシステム統合の構成を設計
  2. 02SQLiteやMarkdownの記憶をAgentDBへ移行
  3. 03エージェントの学習パターンを保存・共有

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/ruvnet/ruview --skill v3-memory-unification

インストール後、Claude Code で/v3-memory-unificationを入力して読み込まれたか確認します。

詳細

V3 メモリの統合

このスキルの概要

複数のメモリシステムを、HNSW ベクトル検索を備えた統合 AgentDB バックエンドに集約します。下位互換性を維持しながら、検索パフォーマンスを 150 倍~12,500 倍向上させます。

クイックスタート

# Initialize memory unification
Task("Memory architecture", "Design AgentDB unification strategy", "v3-memory-specialist")

# AgentDB integration
Task("AgentDB setup", "Configure HNSW indexing and vector search", "v3-memory-specialist")

# Data migration
Task("Memory migration", "Migrate SQLite/Markdown to AgentDB", "v3-memory-specialist")

統合するシステム

レガシーシステム → AgentDB
┌─────────────────────────────────────────┐
│  • MemoryManager (basic operations)     │
│  • DistributedMemorySystem (clustering) │
│  • SwarmMemory (agent-specific)         │
│  • AdvancedMemoryManager (features)     │
│  • SQLiteBackend (structured)           │
│  • MarkdownBackend (file-based)         │
│  • HybridBackend (combination)          │
└─────────────────────────────────────────┘
                    ↓
┌─────────────────────────────────────────┐
│       🚀 AgentDB with HNSW             │
│  • 150x-12,500x faster search          │
│  • Unified query interface             │
│  • Cross-agent memory sharing          │
│  • SONA learning integration           │
└─────────────────────────────────────────┘

実装アーキテクチャ

統合メモリサービス
class UnifiedMemoryService implements IMemoryBackend {
  constructor(
    private agentdb: AgentDBAdapter,
    private indexer: HNSWIndexer,
    private migrator: DataMigrator
  ) {}

  async store(entry: MemoryEntry): Promise<void> {
    await this.agentdb.store(entry);
    await this.indexer.index(entry);
  }

  async query(query: MemoryQuery): Promise<MemoryEntry[]> {
    if (query.semantic) {
      return this.indexer.search(query); // 150x-12,500x faster
    }
    return this.agentdb.query(query);
  }
}
HNSW ベクトル検索
class HNSWIndexer {
  constructor(dimensions: number = 1536) {
    this.index = new HNSWIndex({
      dimensions,
      efConstruction: 200,
      M: 16,
      speedupTarget: '150x-12500x'
    });
  }

  async search(query: MemoryQuery): Promise<MemoryEntry[]> {
    const embedding = await this.embedContent(query.content);
    const results = this.index.search(embedding, query.limit || 10);
    return this.retrieveEntries(results);
  }
}

移行戦略

フェーズ 1:基盤
// AgentDB adapter setup
const agentdb = new AgentDBAdapter({
  dimensions: 1536,
  indexType: 'HNSW',
  speedupTarget: '150x-12500x'
});
フェーズ 2:データ移行
// SQLite → AgentDB
const migrateFromSQLite = async () => {
  const entries = await sqlite.getAll();
  for (const entry of entries) {
    const embedding = await generateEmbedding(entry.content);
    await agentdb.store({ ...entry, embedding });
  }
};

// Markdown → AgentDB
const migrateFromMarkdown = async () => {
  const files = await glob('**/*.md');
  for (const file of files) {
    const content = await fs.readFile(file, 'utf-8');
    await agentdb.store({
      id: generateId(),
      content,
      embedding: await generateEmbedding(content),
      metadata: { originalFile: file }
    });
  }
};

SONA 統合

学習パターンの保存
class SONAMemoryIntegration {
  async storePattern(pattern: LearningPattern): Promise<void> {
    await this.memory.store({
      id: pattern.id,
      content: pattern.data,
      metadata: {
        sonaMode: pattern.mode,
        reward: pattern.reward,
        adaptationTime: pattern.adaptationTime
      },
      embedding: await this.generateEmbedding(pattern.data)
    });
  }

  async retrieveSimilarPatterns(query: string): Promise<LearningPattern[]> {
    return this.memory.query({
      type: 'semantic',
      content: query,
      filters: { type: 'learning_pattern' }
    });
  }
}

パフォーマンス目標

  • 検索速度:HNSW により 150 倍~12,500 倍向上
  • メモリ使用量:最適化により 50~75%削減
  • クエリレイテンシ:エントリ数 100 万件以上で 100 ms 未満
  • エージェント間共有:リアルタイムのメモリ同期
  • SONA 統合:適応時間 0.05 ms 未満

成功指標

  • 7 つすべてのレガシーメモリシステムを AgentDB に移行
  • 検索パフォーマンスの 150 倍~12,500 倍向上を検証
  • メモリ使用量を 50~75%削減
  • 下位互換性を維持
  • SONA の学習パターンを統合
  • エージェント間のメモリ共有を運用開始

コメント