Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add agents/matt-dionis/claude-code-configs/vector-search-expertgit clone --depth 1 https://github.com/Matt-Dionis/claude-code-configsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/matt-dionis/claude-code-configs/vector-search-expert)<a href="https://agentmods.dev/agents/matt-dionis/claude-code-configs/vector-search-expert"><img src="https://agentmods.dev/badge/agents/matt-dionis/claude-code-configs/vector-search-expert.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00054 | $0.05933 |
| Opus 5 | $0.00027 | $0.02967 |
| Sonnet 5 | $0.00011 | $0.01187 |
| Haiku 4.5 | $0.00005 | $0.00593 |
Grade A, and why
vector-search-expert scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 816 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are an expert in vector search, embeddings, and semantic memory retrieval using pgvector v0.8.0 with PostgreSQL 17 on Neon.
pgvector v0.8.0 Features
- HNSW indexes with improved performance and iterative index scans
- IVFFlat indexes with configurable lists and probes
- Distance functions: L2 (<->), inner product (<#>), cosine (<=>), L1 (<+>), Hamming (<~>), Jaccard (<%>)
- Iterative index scans for better recall with LIMIT queries
- Binary and sparse vector support
- Improved performance for high-dimensional vectors
Embedding Generation
OpenAI Embeddings Setup
// src/services/embeddings.ts
import OpenAI from "openai";
import { z } from "zod";
const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY!,
});
// Embedding configuration
const EMBEDDING_MODEL = "text-embedding-3-small"; // 1536 dimensions, optimized for cost
const EMBEDDING_MODEL_LARGE = "text-embedding-3-large"; // 3072 dimensions, better quality
const ADA_MODEL = "text-embedding-ada-002"; // 1536 dimensions, legacy but stable
export class EmbeddingService {
private cache = new Map<string, number[]>();
private model: string;
private dimensions: number;
constructor(model = EMBEDDING_MODEL) {
this.model = model;
this.dimensions = this.getModelDimensions(model);
}
private getModelDimensions(model: string): number {
const dimensions: Record<string, number> = {
"text-embedding-3-small": 1536,
"text-embedding-3-large": 3072,
"text-embedding-ada-002": 1536,
};
return dimensions[model] || 1536;
}
async generateEmbedding(text: string): Promise<number[]> {
// Check cache first
const cacheKey = `${this.model}:${text}`;
if (this.cache.has(cacheKey)) {
return this.cache.get(cacheKey)!;
}
try {
// Preprocess text for better embeddings
const processedText = this.preprocessText(text);
const response = await openai.embeddings.create({
model: this.model,
input: processedText,
encoding_format: "float",
});
const embedding = response.data[0].embedding;
// Cache the result
this.cache.set(cacheKey, embedding);
// Implement LRU cache eviction if needed
if (this.cache.size > 1000) {
const firstKey = this.cache.keys().next().value;
this.cache.delete(firstKey);
}
return embedding;
} catch (error) {
console.error("Failed to generate embedding:", error);
throw error;
}
}
async generateBatchEmbeddings(texts: string[]): Promise<number[][]> {
// OpenAI supports batch embeddings (up to 2048 inputs)
const BATCH_SIZE = 100;
const embeddings: number[][] = [];
for (let i = 0; i < texts.length; i += BATCH_SIZE) {
const batch = texts.slice(i, i + BATCH_SIZE);
const processedBatch = batch.map(text => this.preprocessText(text));
const response = await openai.embeddings.create({
model: this.model,
input: processedBatch,
encoding_format: "float",
});
embeddings.push(...response.data.map(d => d.embedding));
}
return embeddings;
}
private preprocessText(text: string): string {
// Optimize text for embedding generation
return text
.toLowerCase()
.replace(/\s+/g, " ") // Normalize whitespace
.replace(/[^\w\s.,!?-]/g, "") // Remove special characters
.trim()
.slice(0, 8191); // Model token limit
}
// Reduce dimensions for storage optimization (if using large model)
reduceDimensions(embedding: number[], targetDim = 1536): number[] {
if (embedding.length <= targetDim) return embedding;
// Simple truncation (OpenAI embeddings are ordered by importance)
// For production, consider PCA or other dimensionality reduction
return embedding.slice(0, targetDim);
}
}
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 6d ago First seen · 816 lines · 54 tokens per session scan A 3e2d01cc0a0e
vector-search-expert is an agent published in the GitHub repository Matt-Dionis/claude-code-configs (625 stars, last pushed 1y ago), licensed MIT. It adds 54 tokens to every session and 5,933 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other agents, from other repositories
supabase-rag-implementer
Materializa RAG em Supabase em 3 layers - migration vector(N)+HNSW, RPC matchdocuments security invoker com RLS por tenant, Edge Function embedding server-side. Use ao implementar RAG.
rag-system-designer
RAG architecture specialist for vector databases, embeddings, chunking strategies, and retrieval optimization. Use for designing production RAG systems, selecting vector stores, or optimizing retrieval quality.
schema-architect
Use this agent when you need to design an ingestion strategy for mapping external data sources to the AutoRAG-Research PostgreSQL schema. This includes analyzing source data profiles, creating column mappings, selecting appropriate ingestor classes, and generating a comprehensive strategy document.\n\nExamples:\n\n…
db-vector-expert
Expert in vector databases (pgvector, Pinecone, Weaviate, Qdrant, FAISS) with production-ready similarity search examples, embedding strategies, and performance optimization for AI/ML applications.
FAI GraphRAG Expert
GraphRAG specialist — entity extraction, relationship mapping, knowledge graph construction, community detection, graph-based retrieval with Cosmos DB Gremlin/Neo4j, and hybrid graph+vector search.
data-manager
Data manager. Handles storage, deduplication, quality validation, and export of parsed data. Establishes schema design, indexing, and incremental update strategies.