MCP HubMCP Hub
スキル一覧に戻る

koan-vector-migration

sylin-org
更新日 Yesterday
80 閲覧
2
1
2
GitHubで表示
その他general

について

このスキルは、AIによる再生成を行わず既存の埋め込みをエクスポートすることで、ベクトルデータベース間のゼロコスト移行を実現します。埋め込みキャッシング機能を提供し、ElasticSearchやWeaviateなどのプロバイダー向けのエクスポート/インポート操作をサポートします。既存の埋め込みへの投資を維持しながらベクトルデータベースプロバイダーを切り替える必要がある場合にご利用ください。

クイックインストール

Claude Code

推奨
プラグインコマンド推奨
/plugin add https://github.com/sylin-org/koan-framework
Git クローン代替
git clone https://github.com/sylin-org/koan-framework.git ~/.claude/skills/koan-vector-migration

このコマンドをClaude Codeにコピー&ペーストしてスキルをインストールします

ドキュメント

Koan Vector Migration

Core Principle

Export vectors without regenerating via AI. Cache embeddings to enable zero-cost vector database migration.

Vector Export (DATA-0078)

Export Vectors

var vectorRepo = serviceProvider.GetRequiredService<IVectorSearchRepository<Media, string>>();

await foreach (var batch in vectorRepo.ExportAllAsync(batchSize: 100, ct))
{
    // batch.Id: Entity identifier
    // batch.Embedding: float[] vector
    // batch.Metadata: Optional metadata

    // Cache the embedding
    var contentHash = EmbeddingCache.ComputeContentHash(embeddingText);
    await cache.SetAsync(contentHash, modelId, batch.Embedding, ct);
}

Provider Support

  • ElasticSearch: Scroll API (default batch: 1000)
  • Weaviate: GraphQL pagination (default batch: 100)
  • Qdrant: Planned
  • Milvus: Planned
  • Pinecone: Not supported (throws NotSupportedException)

Migration Pattern

1. Export vectors from Provider A → Cache
2. Switch configuration to Provider B
3. Import vectors from Cache → Provider B

Result: Zero AI API calls for migration

Example: Weaviate → ElasticSearch

// Step 1: Export from Weaviate
using (EntityContext.Adapter("weaviate"))
{
    var vectorRepo = sp.GetRequiredService<IVectorSearchRepository<Media, string>>();

    await foreach (var batch in vectorRepo.ExportAllAsync(batchSize: 100, ct))
    {
        await cache.SetAsync(batch.Id, "ada-002", batch.Embedding, ct);
    }
}

// Step 2: Switch to ElasticSearch in appsettings.json
{
  "Koan": {
    "Data": {
      "Sources": {
        "Vectors": {
          "Adapter": "elasticsearch",
          "ConnectionString": "http://localhost:9200"
        }
      }
    }
  }
}

// Step 3: Import to ElasticSearch
foreach (var mediaId in allMediaIds)
{
    var embedding = await cache.GetAsync(mediaId, "ada-002", ct);
    if (embedding != null)
    {
        var media = new Media { Id = mediaId, Embedding = embedding };
        await media.Save();
    }
}

When This Skill Applies

  • ✅ Migrating vector databases
  • ✅ Caching embeddings
  • ✅ AI provider switches
  • ✅ Cost optimization
  • ✅ Vector backup/restore

Reference Documentation

  • CLAUDE.md: Lines 96-123 (Vector Export for Migration)
  • ADR: DATA-0078 (Vector export specification)
  • Guide: docs/guides/ai-vector-howto.md

GitHub リポジトリ

sylin-org/koan-framework
パス: .claude/skills/vector-migration

関連スキル

algorithmic-art

メタ

This Claude Skill creates original algorithmic art using p5.js with seeded randomness and interactive parameters. It generates .md files for algorithmic philosophies, plus .html and .js files for interactive generative art implementations. Use it when developers need to create flow fields, particle systems, or other computational art while avoiding copyright issues.

スキルを見る

subagent-driven-development

開発

This skill executes implementation plans by dispatching a fresh subagent for each independent task, with code review between tasks. It enables fast iteration while maintaining quality gates through this review process. Use it when working on mostly independent tasks within the same session to ensure continuous progress with built-in quality checks.

スキルを見る

executing-plans

デザイン

Use the executing-plans skill when you have a complete implementation plan to execute in controlled batches with review checkpoints. It loads and critically reviews the plan, then executes tasks in small batches (default 3 tasks) while reporting progress between each batch for architect review. This ensures systematic implementation with built-in quality control checkpoints.

スキルを見る

cost-optimization

その他

This Claude Skill helps developers optimize cloud costs through resource rightsizing, tagging strategies, and spending analysis. It provides a framework for reducing cloud expenses and implementing cost governance across AWS, Azure, and GCP. Use it when you need to analyze infrastructure costs, right-size resources, or meet budget constraints.

スキルを見る