
Agentdb Performance Optimization
Tune AgentDB vector storage with quantization, HNSW indexing, caching, and batch inserts when agent memory search is slow or RAM-heavy.
Overview
AgentDB Performance Optimization is an agent skill most often used in Build (also Operate infra) that documents quantization, HNSW indexing, caching, and batching to speed AgentDB vector search and cut memory use.
Install
npx skills add https://github.com/ruvnet/ruflo --skill agentdb-performance-optimizationWhat is this skill?
- Quantization modes documented for 4–32x memory reduction with accuracy tradeoffs
- HNSW indexing path cited for ~150x faster search vs baseline in bundled benchmarks
- Documented latency targets: sub-100µs vector search, ~2ms batch insert for 100 vectors
- npx agentdb@latest benchmark workflow for before/after measurements on your machine
- TypeScript createAgentDBAdapter configuration examples for binary quantization and cache settings
- 4–32x memory reduction with quantization (per skill doc)
- ~150x faster search cited vs 15ms baseline in benchmarks
- <100µs vector search and ~2ms batch insert for 100 vectors (documented targets)
Adoption & trust: 625 installs on skills.sh; 58.5k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your agent memory database is too slow or too large once vectors and patterns grow beyond a dev laptop smoke test.
Who is it for?
Builders already on AgentDB/agentic-flow who need measurable search and insert improvements before shipping agent features to real users.
Skip if: Greenfield apps with no vector memory yet—stand up basic AgentDB first; also skip if you are not on the Node/agentic-flow stack.
When should I use this skill?
Optimizing AgentDB memory usage, improving vector search speed, or scaling to very large vector counts.
What do I get? / Deliverables
You configure an optimized AgentDB adapter, run benchmarks, and adopt patterns that target sub-millisecond retrieval and efficient bulk inserts at scale.
- Optimized adapter configuration
- Benchmark results from npx agentdb@latest benchmark
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Most teams apply these knobs while building agent memory features; the same settings matter again under Operate when scaling traffic. AgentDB is agent-local or app-embedded retrieval infrastructure—classic agent-tooling work adjacent to reasoning banks and flow adapters.
Where it fits
Turn on binary quantization and HNSW when wiring createAgentDBAdapter for a new reasoning bank.
Run agentdb benchmark before launch to compare pattern search and batch insert against SLA targets.
Adjust cache and batch sizes after production traces show retrieval spikes on hot agent sessions.
How it compares
Optimization playbook for embedded AgentDB—not a hosted vector SaaS migration guide or generic Pinecone tuning doc.
Common Questions / FAQ
Who is agentdb-performance-optimization for?
Solo and indie developers building agentic apps with AgentDB who can edit TypeScript adapter config and run CLI benchmarks locally.
When should I use agentdb-performance-optimization?
In Build/agent-tooling while wiring memory; in Ship/perf before launch load tests; in Operate/infra when monitoring shows search or RAM regressions.
Is agentdb-performance-optimization safe to install?
It guides local DB and npm/npx commands—review scripts before running in CI. Check the Security Audits panel on this Prism page for the upstream skill package.
SKILL.md
READMESKILL.md - Agentdb Performance Optimization
# 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 ```bash # 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 ```typescript 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 ```typescript 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 ```typescript 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 ```typescript 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 ```typescript 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: ```typescript const adapter = await createAgentDBAdapter({ dbPath: '.agentdb$vectors.db', // HNSW automatically enabled }); // Search with HNSW (100µ