# Optimize AgentDB Vector Search

Large vector databases can become slow, memory-heavy, and hard to benchmark. This skill provides a structured AgentDB optimization workflow for quantization, HNSW indexing, caching, and validation.

## Install

```bash
npx skillstore add dnyoussef/agentdb-vector-search-optimization
```

## Metadata

- Status: approved
- Slug: dnyoussef-agentdb-vector-search-optimization
- Version: 1.0.0
- Author version: 1.0.0
- Skillstore revision: r1
- Version status: valid
- Tree hash: 7948218151cf51138f26400932b0d195361ca78267db94b035580b9f4c8a3782
- Author: DNYoussef
- GitHub username: DNYoussef
- License: MIT
- Repository: https://github.com/DNYoussef/ai-chrome-extension/tree/main/.claude/skills/agentdb/when-optimizing-vector-search-use-agentdb-optimization
- Ref: c579efd02184f1128d6741d16e6c8d951d7d4208
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: external\_commands, network
- Quality score: 80
- Quality tier: silver
- Public page: https://skillstore.pages.dev/skills/dnyoussef-agentdb-vector-search-optimization
- Manifest: https://skillstore.pages.dev/api/skills/dnyoussef-agentdb-vector-search-optimization/manifest

## Capabilities

- Guides a five-phase workflow for profiling, quantization, indexing, caching, and benchmarking.
- Provides TypeScript examples for AgentDB quantization, HNSW index creation, and query caching.
- Defines target metrics for memory reduction, p95 latency, throughput, accuracy, and cache hit rate.
- Compares product, scalar, and binary quantization options for vector compression.
- Supports planning for performance, machine learning, and backend engineering roles.

## Use Cases

- Reduce Memory Footprint: Tune quantization settings for a large embedding store while preserving search accuracy.
- Improve Search Latency: Add HNSW indexing and benchmark p95 latency for high-volume vector queries.
- Plan Optimization Work: Estimate phases, duration, metrics, and validation steps for an AgentDB performance project.

## Prompt Templates

### Measure Baseline

```
Help me measure baseline AgentDB vector search performance. Include latency, memory, throughput, accuracy, and cache metrics.
```

### Choose Quantization

```
Recommend a quantization strategy for my AgentDB vectors. I need lower memory use while keeping search accuracy above 95 percent.
```

### Tune HNSW Search

```
Create an HNSW tuning plan for AgentDB. Include M, efConstruction, efSearch, expected tradeoffs, and benchmark steps.
```

### Design Full Optimization

```
Design an end-to-end AgentDB optimization plan for millions of vectors. Include baselines, quantization, indexing, caching, batch operations, and acceptance criteria.
```

## Limitations

- Does not install AgentDB packages or run benchmarks automatically.
- Performance results depend on data shape, vector dimensions, hardware, and query patterns.
- Example code may need adaptation to the active AgentDB API version.
- Does not replace production load testing or accuracy evaluation.

## Best Practices

- Measure baseline performance before changing quantization, indexing, or caching.
- Validate accuracy after every compression or approximate search change.
- Benchmark p95 latency and throughput with production-like vector distributions.

## Anti Patterns

- Applying maximum compression before checking recall impact.
- Reporting speedup without baseline, dataset size, and hardware context.
- Tuning cache size without measuring hit rate and eviction behavior.

## Security Audit

- Audited at: 2026-07-05T12:39:29.445\+00:00
- Summary: The two static alerts were reviewed against SKILL.md. The TypeScript example at lines 80-103 is documentation, not shell execution, and the hardcoded URL at line 132 is a resource link rather than active network behavior. No prompt injection or malicious intent was found in the reviewed skill files.

## Stats

- Views: 213
- Downloads: 8
- Favorites: 0
- Popularity score: 0
