/agentdb-search:agentdb-quantized-searchfrom agentdb-search
Speeds up AgentDB's SqlJsRvfBackend vector search on large collections using an opt-in RaBitQ 1-bit quantized index. Useful when exact search slows past ~10,000 vectors or when choosing approximate vs exact search in browser/no-native-install environments.
Ships in agentdb-search. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
SqlJsRvfBackend, the built-in .rvf backend used when no native vector engine is available, scans every vector on every query. With quantizedIndex: 'rabitq', a 1-bit RaBitQ index from @ruvector/rabitq-wasm (an optional dependency, installed by default) narrows each query to a candidate set. The candidates are then rescored exactly, so returned similarities are exact. Only which ids reach the top-k is approximate.
import { SqlJsRvfBackend } from 'agentdb/backends';
const backend = new SqlJsRvfBackend({
dimension: 384,
metric: 'cosine', // or 'l2'; 'ip' always stays exact
quantizedIndex: 'rabitq',
rabitq: { minVectors: 2000, overfetch: 10, rerankFactor: 20 }, // defaults shown
} as any);
await backend.initialize();
backend.getQuantizedIndexStats(); // { enabled, indexed, dirty, builds, lastBuildMs } or null when off
The environment variable AGENTDB_QUANTIZED_INDEX=rabitq turns it on for every SqlJsRvfBackend in the process. If the package is missing, the backend logs one warning and keeps the exact scan.
npm run benchmark:ecosystem; 384-dim, clustered data, cosine, top-10)| Vectors | Exact scan | RaBitQ | Recall@10 | Index build (first query) |
|---|---|---|---|---|
| 5,000 | 3.3 ms | 3.1 ms | 1.000 | 0.5 s |
| 20,000 | 8.5 ms | 3.4 ms | 1.000 | 1.4 s |
| 50,000 | 33.3 ms | 5.2 ms | 1.000 | 5.1 s |
For queries unrelated to the data, where neighbours are near-tied, recall@10 is 0.96 to 0.98 at the default overfetch: 10 and 1.000 at 50.
filter use the exact scan.minVectors there is no index. The exact scan is as fast there.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub ruvnet/agentdb --plugin agentdb-search4 skills in this plugin
/agentdb-explainable-recallSearch with feature attributions — return WHY each match scored where it did. Use when debugging recall quality, auditing for bias, or explaining results to a user./agentdb-hybrid-searchHybrid search — BM25 keyword + dense vector fused with Reciprocal Rank Fusion. Use when queries have specific identifiers, code symbols, or proper nouns that pure semantic search might miss./agentdb-mmrMaximal Marginal Relevance rerank — get diverse top-k instead of redundant top-k. Use when standard search returns 5 near-duplicates, or when you want broader coverage of a topic.Other plugins' skills for the same job