AgentDB Performance Optimization
できること
このスキルは、量子化や高速な検索インデックスなどの手法で、AgentDBを速く軽くする方法を示します。大量のベクトルを扱う開発者向けです。
使う場面
- ✓ベクトルデータベースが大きくなるにつれてメモリを使いすぎるとき。
- ✓多数のレコードで検索が遅くなってきたとき。
- ✓非常に多くのベクトルに向けてAgentDBを計画する必要があるとき。
スキルのリンク
https://github.com/ruvnet/RuView/blob/main/.claude/skills/agentdb-optimization/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“私のAgentDBデータベースが大きくなりすぎて遅くなっています。メモリ使用量を減らし、検索を速くするにはどうすればよいですか?”
毎週5つの新しいスキル。1分で読めます。
仕組み
スキルは、保存データを縮める圧縮の選択肢、一致を素早く見つける検索インデックス、繰り返しのクエリのためのキャッシュを説明します。結果を測るためのベンチマークコマンドも含まれます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
AgentDB Performance Optimization
What This Skill Does
Provides comprehensive performance optimization techniques for AgentDB vector databases. Achieve 150x-12,500x performance improvements through quantization, HNSW indexing, caching strategies, and batch operations. Reduce memory usage by 4-32x while maintaining accuracy.
Performance: <100µs vector search, <1ms pattern retrieval, 2ms batch insert for 100 vectors.
Prerequisites
- Node.js 18+
- AgentDB v1.0.7+ (via agentic-flow)
- Existing AgentDB database or application
Quick Start
Run Performance Benchmarks
# Comprehensive performance benchmarking
npx agentdb@latest benchmark
# Results show:
# ✅ Pattern Search: 150x faster (100µs vs 15ms)
# ✅ Batch Insert: 500x faster (2ms vs 1s for 100 vectors)
# ✅ Large-scale Query: 12,500x faster (8ms vs 100s at 1M vectors)
# ✅ Memory Efficiency: 4-32x reduction with quantization
Enable Optimizations
import { createAgentDBAdapter } from 'agentic-flow/reasoningbank';
// Optimized configuration
const adapter = await createAgentDBAdapter({
dbPath: '.agentdb/optimized.db',
quantizationType: 'binary', // 32x memory reduction
cacheSize: 1000, // In-memory cache
enableLearning: true,
enableReasoning: true,
});
Quantization Strategies
1. Binary Quantization (32x Reduction)
Best For: Large-scale deployments (1M+ vectors), memory-constrained environments Trade-off: ~2-5% accuracy loss, 32x memory reduction, 10x faster
const adapter = await createAgentDBAdapter({
quantizationType: 'binary',
// 768-dim float32 (3072 bytes) → 96 bytes binary
// 1M vectors: 3GB → 96MB
});
Use Cases:
- Mobile/edge deployment
- Large-scale vector storage (millions of vectors)
- Real-time search with memory constraints
Performance:
- Memory: 32x smaller
- Search Speed: 10x faster (bit operations)
- Accuracy: 95-98% of original
2. Scalar Quantization (4x Reduction)
Best For: Balanced performance/accuracy, moderate datasets Trade-off: ~1-2% accuracy loss, 4x memory reduction, 3x faster
const adapter = await createAgentDBAdapter({
quantizationType: 'scalar',
// 768-dim float32 (3072 bytes) → 768 bytes (uint8)
// 1M vectors: 3GB → 768MB
});
Use Cases:
- Production applications requiring high accuracy
- Medium-scale deployments (10K-1M vectors)
- General-purpose optimization
Performance:
- Memory: 4x smaller
- Search Speed: 3x faster
- Accuracy: 98-99% of original
3. Product Quantization (8-16x Reduction)
Best For: High-dimensional vectors, balanced compression Trade-off: ~3-7% accuracy loss, 8-16x memory reduction, 5x faster
const adapter = await createAgentDBAdapter({
quantizationType: 'product',
// 768-dim float32 (3072 bytes) → 48-96 bytes
// 1M vectors: 3GB → 192MB
});
Use Cases:
- High-dimensional embeddings (>512 dims)
- Image/video embeddings
- Large-scale similarity search
Performance:
- Memory: 8-16x smaller
- Search Speed: 5x faster
- Accuracy: 93-97% of original
4. No Quantization (Full Precision)
Best For: Maximum accuracy, small datasets Trade-off: No accuracy loss, full memory usage
const adapter = await createAgentDBAdapter({
quantizationType: 'none',
// Full float32 precision
});
HNSW Indexing
Hierarchical Navigable Small World - O(log n) search complexity
Automatic HNSW
AgentDB automatically builds HNSW indices:
const adapter = await createAgentDBAdapter({
dbPath: '.agentdb/vectors.db',
// HNSW automatically enabled
});
// Search with HNSW (100µs vs 15ms linear scan)
const results = await adapter.retrieveWithReasoning(queryEmbedding, {
k: 10,
});
HNSW Parameters
// Advanced HNSW configuration
const adapter = await createAgentDBAdapter({
dbPath: '.agentdb/vectors.db',
hnswM: 16, // Connections per layer (default: 16)
hnswEfConstruction: 200, // Build quality (default: 200)
hnswEfSearch: 100, // Search quality (default: 100)
});
Parameter Tuning:
- M (connections): Higher = better recall, more memory
- Small datasets (<10K): M = 8
- Medium datasets (10K-100K): M = 16
- Large datasets (>100K): M = 32
- efConstruction: Higher = better index quality, slower build
- Fast build: 100
- Balanced: 200 (default)
- High quality: 400
- efSearch: Higher = b
よくある質問
圧縮は精度を下げますか?
スキルは、精度を保ちながらメモリ使用量を減らすことを目指すと述べています。
結果はどう測りますか?
スキルには、検索と挿入の速度を報告するベンチマークコマンドが含まれます。
まず何をインストールしますか?
Node.js 18以降、AgentDBのバージョン1.0.7以降、そして既存のデータベースです。
詳細
作者による元の説明
Optimize AgentDB performance with quantization (4-32x memory reduction), HNSW indexing (150x faster search), caching, and batch operations. Use when optimizing memory usage, improving search speed, or scaling to millions of vectors.
repo: ruvnet/RuView
人気
- GitHubのスター
- 102k
- ランキング
- #826
- ライセンス
- MIT
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
AgentDB Advanced Features
102kエージェントが、複数のマシンにまたがるデータベースの同期や、ベクトル検索とメタデータによる絞り込みの組み合わせなど、AgentDBの高度な機能を示します。
AgentDB Learning Plugins
102kエージェントが、過去の経験から改善する強化学習の手法を使って、AgentDB向けの学習プラグインを作成・学習できるよう支援します。
AgentDB Memory Patterns
102kエージェントが、AgentDBを永続メモリとして使い、セッションをまたいで会話と文脈を覚えられるよう支援します。
AgentDB Vector Search
102kエージェントが、正確な単語ではなく意味で文書を検索できるよう支援します。質問応答やナレッジベースに適しています。
似ているスキル
discrawl
394k保存済みのローカルなDiscordメッセージのアーカイブを検索して要約し、その新しさを確認し、ダイレクトメッセージを読めるようエージェントを支援します。
clickhouse-io
280kエージェントがClickHouseデータベースのクエリとスキーマを最適化できるようにします。高性能な分析処理向けのベストプラクティスを適用します。分析クエリが遅すぎるときに使います。
scientific-db-pubmed-database
280kエージェントが生物医学分野の科学論文を検索するのに役立ちます。特定の医療情報が必要な研究に便利です。