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
102kAgentDB를 영구 메모리 저장소로 사용해, 세션이 끝나도 대화와 맥락을 기억하도록 에이전트를 돕습니다.
AgentDB Vector Search
102k정확한 단어가 아니라 의미로 문서를 검색하도록 에이전트를 돕습니다. 질의응답과 지식 베이스에 알맞습니다.
비슷한 스킬
discrawl
394k에이전트가 저장된 로컬 Discord 메시지 보관본을 검색하고 요약하며, 최신 상태를 확인하고 다이렉트 메시지를 읽도록 돕습니다.
clickhouse-io
280k에이전트가 ClickHouse 데이터베이스의 쿼리와 스키마를 최적화하도록 돕습니다. 고성능 분석 작업의 모범 사례를 적용합니다. 분석 쿼리가 느릴 때 씁니다.
scientific-db-pubmed-database
280k생의학 분야의 과학 논문을 에이전트가 검색하도록 돕습니다. 특정 의학 정보가 필요한 연구에 유용합니다.