AgentDB Performance Optimization

Optimize AgentDB vector databases with quantization, HNSW indexing, caching, and batch operations.

Updated Aug 18, 2026
One-click install
npx skills add https://github.com/wandreandrade2018-maker/claude-config --skill agentdb-performance-optimization-wandreandrade2018-maker
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: AgentDB Performance Optimization
Source: https://github.com/wandreandrade2018-maker/claude-config/tree/main/.claude/skills/agentdb-optimization
Command: npx skills add https://github.com/wandreandrade2018-maker/claude-config --skill agentdb-performance-optimization-wandreandrade2018-maker

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires agentdb, agentic-flow.

What problem does it solve? Vector databases become slow and memory-hungry as they scale to hundreds of thousands or millions of embeddings. This Skill provides concrete configuration recipes to reduce AgentDB memory usage by 4-32x and accelerate search from seconds to microseconds without rewriting your application. ## Core Features & Use Cases - Quantization Strategies: Choose binary (32x reduction), scalar (4x), or product (8-16x) quantization with documented accuracy trade-offs for each. - HNSW Index Tuning: Configure M, efConstruction, and efSearch parameters for datasets ranging from 10K to over 1M vectors. - Caching & Batch Operations: Use in-memory LRU pattern caches and batch inserts to cut retrieval latency below 1ms and insert 100 vectors in 2ms. - Use Case: You have a production AgentDB instance with 1M document embeddings consuming 3GB of RAM and taking 100 seconds per query. Apply the binary quantization recipe to shrink it to 96MB and get 8ms searches. ## Quick Start Ask the AI to configure an AgentDB adapter with binary quantization, a 1000-pattern cache, and HNSW indexing for your existing vector database.

Frequently Asked Questions about AgentDB Performance Optimization

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce AgentDB memory usage for large vector databases?

Enable binary quantization in the AgentDB adapter configuration to achieve a 32x memory reduction, turning 3GB for 1M vectors into 96MB. Scalar quantization offers a 4x reduction with higher accuracy (98-99%) if binary's 95-98% accuracy is insufficient.

How to speed up vector search in AgentDB with HNSW?

AgentDB builds HNSW indices automatically, giving O(log n) search complexity. Tune hnswM (8 for small, 16 for medium, 32 for large datasets) and hnswEfSearch (50 for speed, 200 for recall) to balance latency against accuracy.

What is the difference between binary, scalar, and product quantization?

Binary quantization gives 32x memory reduction with 95-98% accuracy, scalar gives 4x reduction with 98-99% accuracy, and product quantization gives 8-16x reduction with 93-97% accuracy. Choose based on dataset size and accuracy requirements.

Does AgentDB quantization reduce search accuracy?

Yes, quantization trades accuracy for memory and speed. Binary loses roughly 2-5% accuracy, scalar loses 1-2%, and product loses 3-7%. Use quantizationType 'none' for full float32 precision when accuracy is critical.

Why is my AgentDB search slow and how do I fix it?

Slow searches usually come from missing cache or overly strict search parameters. Increase cacheSize to 2000, reduce k in retrieval calls, and lower hnswEfSearch to 50-100 for faster queries at slightly reduced recall.

When should I not use binary quantization for embeddings?

Avoid binary quantization when your application requires near-perfect recall, such as compliance or medical retrieval, since it retains only 95-98% accuracy. Use scalar quantization or full precision instead for those workloads.