AgentDB Vector Search

Implement semantic vector search with AgentDB for intelligent document retrieval, similarity matching, and context-aware querying.

You say
Buy it · $89 Read it before you buy $89 Written by ruvnet · unverified publisher
Context cost
2.3k tokensestimated from the bundle, loaded when it triggers
Bundle
1 file · 9.0 kBtext throughout, nothing executable
Licence
MITpaid listing
Last change
no release on file
Servers it uses
Noneruns standalone

What it does

Implement semantic vector search with AgentDB for intelligent document retrieval, similarity matching, and context-aware querying. Use when building RAG systems, semantic search engines, or intelligent knowledge bases.

Installed, it changes the agent in these ways.

What this skill changes about the agent is not written down here yet. The listing was collected from its source, and the description is in its own SKILL.md.

Workflow

Runs a procedure end to end.

data science

The skill itself

This is the whole product. A skill is instructions the model reads, so there is nothing behind the listing you cannot see first — the front matter loads with every session, and the body below it loads when the skill triggers.

SKILL.md9.0 kB · 340 lines
--- name: "AgentDB Vector Search" description: "Implement semantic vector search with AgentDB for intelligent document retrieval, similarity matching, and context-aware querying. Use when building RAG systems, semantic search engines, or intelligent knowledge bases." ---
6# AgentDB Vector Search
7
8## What This Skill Does
9
10Implements vector-based semantic search using AgentDB's high-performance vector database with **150x-12,500x faster** operations than traditional solutions. Features HNSW indexing, quantization, and sub-millisecond search (<100µs).
11
12## Prerequisites
13
14- Node.js 18+
15- AgentDB v1.0.7+ (via agentic-flow or standalone)
16- OpenAI API key (for embeddings) or custom embedding model
17
18## Quick Start with CLI
19
20### Initialize Vector Database
21
22```bash
23# Initialize with default dimensions (1536 for OpenAI ada-002)
24npx agentdb@latest init ./vectors.db
25
26# Custom dimensions for different embedding models
27npx agentdb@latest init ./vectors.db --dimension 768 # sentence-transformers
28npx agentdb@latest init ./vectors.db --dimension 384 # all-MiniLM-L6-v2
29
30# Use preset configurations
31npx agentdb@latest init ./vectors.db --preset small # <10K vectors
32npx agentdb@latest init ./vectors.db --preset medium # 10K-100K vectors
33npx agentdb@latest init ./vectors.db --preset large # >100K vectors
34
35# In-memory database for testing
36npx agentdb@latest init ./vectors.db --in-memory
37```
38
39### Query Vector Database
40
41```bash
42# Basic similarity search
43npx agentdb@latest query ./vectors.db "[0.1,0.2,0.3,...]"
44
45# Top-k results
46npx agentdb@latest query ./vectors.db "[0.1,0.2,0.3]" -k 10
47
48# With similarity threshold (cosine similarity)
49npx agentdb@latest query ./vectors.db "0.1 0.2 0.3" -t 0.75 -m cosine
50
51# Different distance metrics
52npx agentdb@latest query ./vectors.db "[...]" -m euclidean # L2 distance
53npx agentdb@latest query ./vectors.db "[...]" -m dot # Dot product
54
55# JSON output for automation
56npx agentdb@latest query ./vectors.db "[...]" -f json -k 5
57
58# Verbose output with distances
59npx agentdb@latest query ./vectors.db "[...]" -v
60```
61
62### Import/Export Vectors
63
64```bash
65# Export vectors to JSON
66npx agentdb@latest export ./vectors.db ./backup.json
67
68# Import vectors from JSON
69npx agentdb@latest import ./backup.json
70
71# Get database statistics
72npx agentdb@latest stats ./vectors.db
73```
74
75## Quick Start with API
76
77```typescript
78import { createAgentDBAdapter, computeEmbedding } from 'agentic-flow/reasoningbank';
79
80// Initialize with vector search optimizations
81const adapter = await createAgentDBAdapter({
82 dbPath: '.agentdb/vectors.db',
83 enableLearning: false, // Vector search only
84 enableReasoning: true, // Enable semantic matching
85 quantizationType: 'binary', // 32x memory reduction
86 cacheSize: 1000, // Fast retrieval
87});
88
89// Store document with embedding
90const text = "The quantum computer achieved 100 qubits";
91const embedding = await computeEmbedding(text);
92
93await adapter.insertPattern({
94 id: '',
95 type: 'document',
96 domain: 'technology',
97 pattern_data: JSON.stringify({
98 embedding,
99 text,
100 metadata: { category: "quantum", date: "2025-01-15" }
101 }),
102 confidence: 1.0,
103 usage_count: 0,
104 success_count: 0,
105 created_at: Date.now(),
106 last_used: Date.now(),
107});
108
109// Semantic search with MMR (Maximal Marginal Relevance)
110const queryEmbedding = await computeEmbedding("quantum computing advances");
111const results = await adapter.retrieveWithReasoning(queryEmbedding, {
112 domain: 'technology',
113 k: 10,
114 useMMR: true, // Diverse results
115 synthesizeContext: true, // Rich context
116});
117```
118
119## Core Features
120
121### 1. Vector Storage
122```typescript
123// Store with automatic embedding
124await db.storeWithEmbedding({
125 content: "Your document text",
126 metadata: { source: "docs", page: 42 }
127});
128```
129
130### 2. Similarity Search
131```typescript
132// Find similar documents
133const similar = await db.findSimilar("quantum computing", {
134 limit: 5,
135 minScore: 0.75
136});
137```
138
139### 3. Hybrid Search (Vector + Metadata)
140```typescript
141// Combine vector similarity with metadata filtering
142const results = await db.hybridSearch({
143 query: "machine learning models",
144 filters: {
145 category: "research",
146 date: { $gte: "2024-01-01" }
147 },
148 limit: 20
149});
150```
151
152## Advanced Usage
153
154### RAG (Retrieval Augmented Generation)
155```typescript
156// Build RAG pipeline
157async function ragQuery(question: string) {
158 // 1. Get relevant context
159 const context = await db.searchSimilar(
160 await embed(question),
161 { limit: 5, threshold: 0.7 }
162 );
163
164 // 2. Generate answer with context
165 const prompt = `Context: ${context.map(c => c.text).join('\n')}
166Question: ${question}`;
167
168 return await llm.generate(prompt);
169}
170```
171
172### Batch Operations
173```typescript
174// Efficient batch storage
175await db.batchStore(documents.map(doc => ({
176 text: doc.content,
177 embedding: doc.vector,
178 metadata: doc.meta
179})));
180```
181
182## MCP Server Integration
183
184```bash
185# Start AgentDB MCP server for Claude Code
186npx agentdb@latest mcp
187
188# Add to Claude Code (one-time setup)
189claude mcp add agentdb npx agentdb@latest mcp
190
191# Now use MCP tools in Claude Code:
192# - agentdb_query: Semantic vector search
193# - agentdb_store: Store documents with embeddings
194# - agentdb_stats: Database statistics
195```
196
197## Performance Benchmarks
198
199```bash
200# Run comprehensive benchmarks
201npx agentdb@latest benchmark
202
203# Results:
204# ✅ Pattern Search: 150x faster (100µs vs 15ms)
205# ✅ Batch Insert: 500x faster (2ms vs 1s for 100 vectors)
206# ✅ Large-scale Query: 12,500x faster (8ms vs 100s at 1M vectors)
207# ✅ Memory Efficiency: 4-32x reduction with quantization
208```
209
210## Quantization Options
211
212AgentDB provides multiple quantization strategies for memory efficiency:
213
214### Binary Quantization (32x reduction)
215```typescript
216const adapter = await createAgentDBAdapter({
217 quantizationType: 'binary', // 768-dim → 96 bytes
218});
219```
220
221### Scalar Quantization (4x reduction)
222```typescript
223const adapter = await createAgentDBAdapter({
224 quantizationType: 'scalar', // 768-dim → 768 bytes
225});
226```
227
228### Product Quantization (8-16x reduction)
229```typescript
230const adapter = await createAgentDBAdapter({
231 quantizationType: 'product', // 768-dim → 48-96 bytes
232});
233```
234
235## Distance Metrics
236
237```bash
238# Cosine similarity (default, best for most use cases)
239npx agentdb@latest query ./db.sqlite "[...]" -m cosine
240
241# Euclidean distance (L2 norm)
242npx agentdb@latest query ./db.sqlite "[...]" -m euclidean
243
244# Dot product (for normalized vectors)
245npx agentdb@latest query ./db.sqlite "[...]" -m dot
246```
247
248## Advanced Features
249
250### HNSW Indexing
251- **O(log n) search complexity**
252- **Sub-millisecond retrieval** (<100µs)
253- **Automatic index building**
254
255### Caching
256- **1000 pattern in-memory cache**
257- **<1ms pattern retrieval**
258- **Automatic cache invalidation**
259
260### MMR (Maximal Marginal Relevance)
261- **Diverse result sets**
262- **Avoid redundancy**
263- **Balance relevance and diversity**
264
265## Performance Tips
266
2671. **Enable HNSW indexing**: Automatic with AgentDB, 10-100x faster
2682. **Use quantization**: Binary (32x), Scalar (4x), Product (8-16x) memory reduction
2693. **Batch operations**: 500x faster for bulk inserts
2704. **Match dimensions**: 1536 (OpenAI), 768 (sentence-transformers), 384 (MiniLM)
2715. **Similarity threshold**: Start at 0.7 for quality, adjust based on use case
2726. **Enable caching**: 1000 pattern cache for frequent queries
273
274## Troubleshooting
275
276### Issue: Slow search performance
277```bash
278# Check if HNSW indexing is enabled (automatic)
279npx agentdb@latest stats ./vectors.db
280
281# Expected: <100µs search time
282```
283
284### Issue: High memory usage
285```bash
286# Enable binary quantization (32x reduction)
287# Use in adapter: quantizationType: 'binary'
288```
289
290### Issue: Poor relevance
291```bash
292# Adjust similarity threshold
293npx agentdb@latest query ./db.sqlite "[...]" -t 0.8 # Higher threshold
294
295# Or use MMR for diverse results
296# Use in adapter: useMMR: true
297```
298
299### Issue: Wrong dimensions
300```bash
301# Check embedding model dimensions:
302# - OpenAI ada-002: 1536
303# - sentence-transformers: 768
304# - all-MiniLM-L6-v2: 384
305
306npx agentdb@latest init ./db.sqlite --dimension 768
307```
308
309## Database Statistics
310
311```bash
312# Get comprehensive stats
313npx agentdb@latest stats ./vectors.db
314
315# Shows:
316# - Total patterns/vectors
317# - Database size
318# - Average confidence
319# - Domains distribution
320# - Index status
321```
322
323## Performance Characteristics
324
325- **Vector Search**: <100µs (HNSW indexing)
326- **Pattern Retrieval**: <1ms (with cache)
327- **Batch Insert**: 2ms for 100 vectors
328- **Memory Efficiency**: 4-32x reduction with quantization
329- **Scalability**: Handles 1M+ vectors efficiently
330- **Latency**: Sub-millisecond for most operations
331
332## Learn More
333
334- GitHub: https://github.com/ruvnet/agentic-flow/tree/main/packages/agentdb
335- Documentation: node_modules/agentic-flow/docs/AGENTDB_INTEGRATION.md
336- MCP Integration: npx agentdb@latest mcp for Claude Code
337- Website: https://agentdb.ruv.io
338- CLI Help: npx agentdb@latest --help
339- Command Help: npx agentdb@latest help <command>
340
In the file
SKILL.md1,162 words
Files1
LicenceMIT
Why you can read it

Nothing in a skill executes. The client loads the text and the model follows it, so a skill can be audited the way a runbook is — by reading it.

What it costs in context

Skills are not billed by the call. They are paid for in context: every token the instructions occupy is a token your code, your diff and your conversation cannot use. Here is what this one takes and when it takes it.

≈70
always loaded
The name and description, so the model knows the skill exists and when to reach for it.
2,180
on trigger
The instruction body, read only when the skill fires.
1.1%
of a 200k window
Ten skills this size would take about 11% of the window before you open a file.
050k100k150k200k context window

2.3k tokens, estimated from the bundle at four bytes to the token, held for the rest of the session once it triggers. Middling. Fine to keep on in a project where you use it weekly, worth unloading in one where you never do.

Servers bill, skills cost

A server charges by the month. A skill charges once per session, in context, and then keeps charging it for as long as the session lives.

Before and after

The same question, put to the same model twice: once as it comes, and once with these instructions loaded.

No worked example has been published for this skill yet.

Adoption
Installsnone yet
Ratingno reviews yet

The procedure it runs

The procedure has not been published here. It is in the skill’s own SKILL.md, which its author has not sent to the marketplace yet.

Prose, not code

These steps are written for a model to follow, not executed by a runtime. It can still be told to skip one, and it will say so when it does.

Servers it uses

None. This skill calls no MCP servers at all.

Everything it needs is in the instructions, so it works in a project with nothing connected — the model reads the file and changes how it works with what it can already reach.

It writes no files and reaches no network. All it changes is how the model reasons and writes.

What it asks for
Writes filesno
Network accessno

Read from the allowed-tools line of this skill’s own SKILL.md. A skill grants no permissions of its own — it can only ask for tools your client already has.

What it will not do

Every skill is narrow, and the useful ones say where they stop. These are the jobs this one is the wrong tool for.

What this skill is not for has not been published here. Nothing is implied by that: it is a section the author has not filled in.

What is in the bundle

1 file, 9.0 kB on disk. A bundle is text throughout: the instructions the model reads, plus the templates it fills in.

  • SKILL.md9.0 kB
What is not in it

No dependencies and nothing executable: a skill is text the agent reads, so the bundle is 1 file you can review in full before installing. The MIT licence covers the templates and examples as well as the instructions.

Install

Installing copies the bundle into your project. Nothing runs at install time — the files sit on disk until the model reads them.

$89 once
AgentDB Vector Search · MIT · ruvnet
one-time
Price$89 once
LicenceMIT — the author’s, unchanged by this purchase
Paid throughStripe, once, on the card you add at the checkout
Keeps workingfor good — the files are yours once they are on disk
Updatesevery update its author ships, delivered through this account

You can read the whole bundle before paying — the SKILL.md above is the product, not a preview of it. What the money buys is the delivery: the folder packaged and handed to your machine by key, every update its author ships, and our support if it does not do what this listing says. The terms of use are MIT, set by the author and unchanged by buying it here.

Payment runs through Stripe, on a page like this one rather than a redirect. Once there is an account it joins the same mcprush invoice as everything else you run, so there is never a second card to enter.

Which clients pick it up on their own

A skill is a folder of text. A client with a skills folder reads it without being told; everywhere else the same text works, it is just handed to the model rather than found.

Claude Code.claude/skills/
Claude Desktop
ChatGPT
Cursor.cursor/skills/
VS Code.github/skills/
Codex CLI.agents/skills/
Gemini CLI.gemini/skills/
Grok.grok/skills/
Zed.agents/skills/
Windsurf.windsurf/skills/
Agent SDK.claude/skills/
HTTP / API
This release
Versionnot versioned
Publishedno release date on file
Price$89
Referenceruvnet/agentdb-vector-search

Versions

Its author publishes no version number, so there is nothing here to pin to: what you install is the folder as it stands today. Instructions change more often than APIs do — a skill can be rewritten entirely without anything it depends on moving.

v
  • No earlier releases have been published to the marketplace.
Pinning

Nothing to pin to: this skill carries no version number of its own. What you install is what the folder holds on the day you install it.

Reviews

no reviews yet · no installs yet

Nobody has reviewed this skill yet. The rating is the mean of the reviews written here, so there is none until somebody writes the first.

Who can post

Only accounts that have had the skill installed for fourteen days, so a review is written after living with it rather than after reading it. Publishers may reply once.

Publisher
Servers0