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 skills/ariegoldkin/claude-forge/pgvector-searchnpx skills add ArieGoldkin/claude-forge --skill pgvector-searchgit clone --depth 1 https://github.com/ArieGoldkin/claude-forgeWrote 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/skills/ariegoldkin/claude-forge/pgvector-search)<a href="https://agentmods.dev/skills/ariegoldkin/claude-forge/pgvector-search"><img src="https://agentmods.dev/badge/skills/ariegoldkin/claude-forge/pgvector-search.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 | $0.00032 | $0.01922 |
| Opus 5 | $0.00016 | $0.00961 |
| Sonnet 5 | $0.00006 | $0.00384 |
| Haiku 4.5 | $0.00003 | $0.00192 |
Grade A, and why
pgvector-search 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 5d 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 — 245 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Aspirational — these patterns are not yet implemented in the reference platform.
PGVector Hybrid Search
Production-grade semantic + keyword search using PostgreSQL
Overview
Hybrid search combines semantic similarity (vector embeddings) with keyword matching (BM25) to achieve better retrieval than either alone.
Architecture:
Query
↓
[Generate embedding] → Vector Search (PGVector) → Top 30 results
↓
[Generate ts_query] → Keyword Search (BM25) → Top 30 results
↓
[Reciprocal Rank Fusion (RRF)] → Merge & re-rank → Top 10 final results
Core Concepts
1. Semantic Search (Vector Similarity)
How it works:
- Embed query:
"database indexing strategies"→[0.23, -0.15, ..., 0.42](1024 dims) - Find nearest neighbors:
ORDER BY embedding <=> query_embedding LIMIT 30 - Returns: Conceptually similar documents (even with different words)
Example:
- Query: "machine learning model training"
- Matches: "neural network optimization", "deep learning techniques"
- Misses: "ML model training" (different embeddings despite similar meaning)
Strengths:
- Captures semantic meaning
- Works across languages
- Handles synonyms ("car" matches "automobile")
Weaknesses:
- Slow for exact keyword matches
- Sensitive to embedding quality
- Doesn't handle rare technical terms well
2. Keyword Search (BM25)
How it works:
- Tokenize query:
"database indexing"→database & indexing - Full-text search:
WHERE content_tsvector @@ to_tsquery('database & indexing') - Rank by BM25 score (TF-IDF + document length normalization)
Example:
- Query: "PostgreSQL B-tree index"
- Matches: Documents with exact phrase "PostgreSQL B-tree index"
- Misses: "Postgres tree-based indexing" (different words)
Strengths:
- Fast exact matches
- Handles technical terms well
- Works for rare/specific phrases
Weaknesses:
- No semantic understanding
- Requires exact word matches
- Sensitive to typos
3. Reciprocal Rank Fusion (RRF)
What ships with it
8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- capabilities.json 7.0 KB
- checklists/search-implementation-checklist.md 18 KB
- references/hybrid-search-rrf.md 8.3 KB
- references/indexing-strategies.md 9.6 KB
- references/metadata-filtering.md 11 KB
- references/testing-evaluation.md 4.0 KB
- templates/chunk-repository.py 10 KB runs code
- templates/search-service.py 5.5 KB runs code
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.
- 5d ago First seen · 245 lines · 32 tokens per session scan A 78467e3ef7d4
pgvector-search is a skill published in the GitHub repository ArieGoldkin/claude-forge (6 stars, last pushed 27d ago), licensed MIT. It adds 32 tokens to every session and 1,922 once invoked, about $0.0002 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-31.
Other skills, from other repositories
030201-pgvector-embeddings
Vector search with pgvector — embedding generation (OpenAI or hash), HNSW indexing, cosine similarity search, and enriched product JOIN queries.
pgvector-semantic-search
Use this skill for setting up vector similarity search with pgvector for AI/ML embeddings, RAG applications, or semantic search. Trigger when user asks to: Store or search vector embeddings in PostgreSQL Set up semantic search, similarity search, or nearest neighbor search Create HNSW or IVFFlat indexes for vectors…
postgres-hybrid-text-search
Use this skill to implement hybrid search combining BM25 keyword search with semantic vector search using Reciprocal Rank Fusion (RRF). Trigger when user asks to: Combine keyword and semantic search Implement hybrid search or multi-modal retrieval Use BM25/pgtextsearch with pgvector together Implement RRF (Reciprocal…
dsql
Build with Aurora DSQL — manage schemas, execute queries, handle migrations, diagnose query plans, diagnose cluster performance, load data, and develop applications with a serverless, distributed SQL database. Covers IAM auth, multi-tenant patterns, MySQL-to-DSQL and PostgreSQL-to-DSQL schema conversion, foreign key…
ai-vector-brain
Builds vector-brain implementations for repos, docs hubs, and compliance corpora. Use when creating pgvector retrieval brains with scripts, SQL, manifests, and evals.
building-agents
Use when building or restructuring an LLM agent — provider adapter, tool calling, structured output, RAG, agent loop, eval gate, cost routing, tracing, MCP server — model-agnostic across OpenAI/Anthropic/Gemini/OSS so a model swap is a config change. NOT vector-store SQL alone (that is postgresdb) or service…