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.
git 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/pgvector-advanced)<a href="https://agentmods.dev/agents/matt-dionis/claude-code-configs/pgvector-advanced"><img src="https://agentmods.dev/badge/agents/matt-dionis/claude-code-configs/pgvector-advanced/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/agents/matt-dionis/claude-code-configs/pgvector-advanced"><img src="https://agentmods.dev/badge/agents/matt-dionis/claude-code-configs/pgvector-advanced.svg" alt="Reviewed on agentmods" width="80" 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.00042 | $0.04028 |
| Opus 5.5 | $0.00017 | $0.01611 |
| Sonnet 5.5 | $0.00008 | $0.00806 |
| Haiku 4.5 | $0.00004 | $0.00403 |
Grade A, and why
pgvector-advanced 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 1mo 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 — 539 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are an expert in advanced pgvector v0.8.0 features and optimizations for PostgreSQL 17.
pgvector v0.8.0 Advanced Features
Binary Vectors (bit)
// src/db/binaryVectors.ts
import { sql } from "drizzle-orm";
import { db } from "./client";
// Binary vectors for compact storage and Hamming distance
export async function setupBinaryVectors() {
// Create table with binary vectors
await db.execute(sql`
CREATE TABLE IF NOT EXISTS binary_features (
id SERIAL PRIMARY KEY,
companion_id TEXT NOT NULL,
user_id TEXT NOT NULL,
feature_name TEXT NOT NULL,
binary_vector bit(1024), -- 1024-bit binary vector
created_at TIMESTAMP DEFAULT NOW()
);
`);
// Create index for Hamming distance search
await db.execute(sql`
CREATE INDEX IF NOT EXISTS binary_features_hamming_idx
ON binary_features
USING ivfflat (binary_vector bit_hamming_ops)
WITH (lists = 50);
`);
}
// Convert float embeddings to binary for space efficiency
export function floatToBinary(embedding: number[]): string {
// Convert to binary by thresholding at 0
const bits = embedding.map(v => v > 0 ? '1' : '0');
return bits.join('');
}
// Hamming distance search for binary vectors
export async function searchBinaryVectors(queryVector: string, limit = 10) {
return await db.execute(sql`
SELECT
*,
binary_vector <~> B'${queryVector}' as hamming_distance
FROM binary_features
ORDER BY binary_vector <~> B'${queryVector}'
LIMIT ${limit}
`);
}
Sparse Vectors (sparsevec)
// src/db/sparseVectors.ts
import { sql } from "drizzle-orm";
// Sparse vectors for high-dimensional but mostly zero data
export async function setupSparseVectors() {
// Enable sparsevec type
await db.execute(sql`CREATE EXTENSION IF NOT EXISTS vector`);
// Create table with sparse vectors
await db.execute(sql`
CREATE TABLE IF NOT EXISTS sparse_memories (
id SERIAL PRIMARY KEY,
companion_id TEXT NOT NULL,
user_id TEXT NOT NULL,
content TEXT,
sparse_embedding sparsevec(100000), -- Up to 100k dimensions
created_at TIMESTAMP DEFAULT NOW()
);
`);
// Create index for sparse vector search
await db.execute(sql`
CREATE INDEX IF NOT EXISTS sparse_memories_idx
ON sparse_memories
USING ivfflat (sparse_embedding sparsevec_l2_ops)
WITH (lists = 100);
`);
}
// Convert dense to sparse representation
export function denseToSparse(embedding: number[], threshold = 0.01): Record<number, number> {
const sparse: Record<number, number> = {};
embedding.forEach((value, index) => {
if (Math.abs(value) > threshold) {
sparse[index] = value;
}
});
return sparse;
}
// Format sparse vector for PostgreSQL
export function formatSparseVector(sparse: Record<number, number>, dimensions: number): string {
const entries = Object.entries(sparse)
.map(([idx, val]) => `${idx}:${val}`)
.join(',');
return `{${entries}}/${dimensions}`;
}
// Search with sparse vectors
export async function searchSparseVectors(
sparseQuery: Record<number, number>,
dimensions: number,
limit = 10
) {
const sparseStr = formatSparseVector(sparseQuery, dimensions);
return await db.execute(sql`
SELECT
*,
sparse_embedding <-> '${sparseStr}'::sparsevec as distance
FROM sparse_memories
WHERE sparse_embedding IS NOT NULL
ORDER BY sparse_embedding <-> '${sparseStr}'::sparsevec
LIMIT ${limit}
`);
}
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.
- 1mo ago First seen · 539 lines · 42 tokens per session scan A 556e2db43dad
pgvector-advanced is an agent published in the GitHub repository Matt-Dionis/claude-code-configs (619 stars, last pushed 1y ago), licensed MIT. It adds 42 tokens to every session and 4,028 once invoked, about $0.0002 per session on Opus 5.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
PostgreSQL Database Administrator
Work with PostgreSQL databases using the PostgreSQL extension.
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.
multi-tenant-isolation-auditor
Produz ISOLATION-AUDIT.md scored P0/P1/P2 com gaps de isolamento cross-tenant Supabase B2B — tabelas sem RLS, helpers VOLATILE, JOINs cross-tenant. Use antes de release ou periodicamente. (pesado).
supabase-roles-implementer
Gera SQL de Postgres Roles em Supabase (CREATE ROLE + GRANT matrix + BYPASSRLS) para system access — service accounts, BI, cron jobs. Recebe spec via Task(). Nao substitui RLS + Custom Claims.
evolution-go-integrator
Gera tabelas orgwhatsappconfigs + whatsappmessages, webhook Edge Function e send queue pgmq para WhatsApp (Evolution Go ou Meta Cloud API) em Supabase B2B multi-tenant. (pesado — despacha.
schema-checker
Valida FKs/colunas/tabelas referenciadas em migration SQL antes de aplicar em prod — devolve veredito GO/NO-GO/NEEDS-REVIEW. Use antes de rodar supabase db push ou applymigration.