Langsung ke konten
Skillpedia
Database102k Β· #826

AgentDB Performance Optimization

Fungsinya

Skill ini menunjukkan cara membuat AgentDB lebih cepat dan lebih ringan, dengan teknik seperti kuantisasi dan indeks pencarian cepat. Skill ini ditujukan bagi developer yang bekerja dengan kumpulan vektor yang besar.

Kapan dipakai

  • βœ“Saat basis data vektor Anda memakai terlalu banyak memori seiring pertumbuhannya.
  • βœ“Saat pencarian mulai melambat pada banyak catatan.
  • βœ“Saat Anda perlu merencanakan AgentDB untuk jumlah vektor yang sangat besar.

Link skill

https://github.com/ruvnet/RuView/blob/main/.claude/skills/agentdb-optimization/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/ruvnet/RuView/blob/main/.claude/skills/agentdb-optimization/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œDatabase AgentDB saya makin besar dan lambat. Bagaimana cara mengurangi penggunaan memorinya dan mempercepat pencarian?”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Skill menjelaskan opsi kompresi yang memperkecil data tersimpan, indeks pencarian yang menemukan kecocokan dengan cepat, dan caching untuk kueri yang berulang. Skill juga menyertakan perintah benchmark untuk mengukur hasilnya.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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
Pertanyaan umum

Apakah kompresi mengurangi akurasi?

Skill menyebutkan tujuannya adalah memangkas penggunaan memori sambil menjaga akurasi.

Bagaimana cara mengukur hasilnya?

Skill menyertakan perintah benchmark yang melaporkan kecepatan pencarian dan penyisipan.

Apa yang harus terpasang lebih dulu?

Node.js 18 atau lebih baru, AgentDB versi 1.0.7 atau lebih baru, dan database yang sudah ada.

Detail

Deskripsi asli dari pembuat

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

Popularitas

Bintang GitHub
102k
Peringkat
#826
Lisensi
MIT
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa