vector-search-expert

vector-search-expert is an agent for Claude Code from Matt-Dionis/claude-code-configs. It costs 54 tokens per session (5,933 once invoked), scanned A, original, MIT.

An AI-agent profile for semantic search, which finds information by meaning, using numerical representations called embeddings and PostgreSQL vector indexes.

In plain words
What is it for?
Use it when building memory retrieval with OpenAI embeddings, pgvector indexes, similarity calculations, iterative scans, or hybrid search.
Why use it?
It provides project-specific guidance for retrieving relevant memories efficiently and combining meaning-based search with other search methods.

Agent for Claude Code

Install

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.

agentmods
npx agentmods add agents/matt-dionis/claude-code-configs/vector-search-expert
Clone the repo
git clone --depth 1 https://github.com/Matt-Dionis/claude-code-configs

Made for: Claude Code.

Wrote 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.

agentmods badge for vector-search-expert

README.md
[![agentmods](https://agentmods.dev/badge/agents/matt-dionis/claude-code-configs/vector-search-expert.svg)](https://agentmods.dev/agents/matt-dionis/claude-code-configs/vector-search-expert)
Your own site
<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>
Per session 54 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 5,933 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 6d ago against content hash 3e2d01cc0a0e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

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.

configurations/mcp-servers/memory-mcp-server/.claude/agents/vector-search-expert.md · 816 lines

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);
  }
}

Read the full file on GitHub · 816 lines

Changes

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.

  1. 6d ago First seen · 816 lines · 54 tokens per session scan A 3e2d01cc0a0e

Subscribe to this mod's changes

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.

Related

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.

luanpdd/kit-mcp · 52 tokens

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.

SteveGJones/ai-first-sdlc-practices · 40 tokens

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…

NomaDamas/AutoRAG-Research · 338 tokens

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.

andisab/swe-marketplace · 46 tokens

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.

frootai/frootai · 45 tokens

data-manager

Data manager. Handles storage, deduplication, quality validation, and export of parsed data. Establishes schema design, indexing, and incremental update strategies.

revfactory/harness-100 · 34 tokens