Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Vector Databases

ASecurity

Design and operate vector databases for semantic search and RAG: embeddings, indexes (HNSW), filtering, hybrid search, and scaling. Use for AI retrieval.

2 stars
0 votes
0 copies
0 views
Added 9/29/2026
ai-agentspythongobashsqldockerapidatabasebackend

Works with

cliapi

Security Analysis

A96/100
mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 2 files and shows the line behind each finding

Scanned 9/29/2026

$npx -y skills add ssrjkk/claude-skills --skill vector-databases --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Vector Databases?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Vector Databases
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ssrjkk-vector-databases/badge)](https://www.skillsdirectory.com/skills/ssrjkk-vector-databases)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: vector-databases
description: "Design and operate vector databases for semantic search and RAG: embeddings, indexes (HNSW), filtering, hybrid search, and scaling. Use for AI retrieval."
category: database
tags: [vector-db, embeddings, hnsw, similarity-search, rag, retrieval, pgvector]
models: [sonnet, opus, gpt-5, gemini-2.5, glm-4.6]
version: 1.0.0
created: 2026-09-25
updated: 2026-09-28
author: ssrjkk
---
# Vector Databases

> Storing and searching embeddings for semantic retrieval and RAG.

## Quick Start
```bash
# pgvector on Postgres
docker run -e POSTGRES_PASSWORD=secret -p 5432:5432 -d pgvector/pgvector:pg17
# or Chroma:
pip install chromadb
```

## When to Use
- Semantic search over unstructured data
- RAG retrieval backends
- Recommendation by similarity
- Deduplication and clustering of texts

## Best Practices

### Embeddings
- Use retrieval-tuned embedding models
- Normalize vectors for cosine similarity
- Choose dimension balanced with storage and speed
- Embed at indexing time and query time consistently

### Indexes
- Prefer HNSW for balanced speed/recall
- Set `m` (connections) and `ef_construction` for build quality
- Use IVF for very large collections with disk budget
- Match the index to the metric (cosine/euclidean)

### Filtering & Hybrid
- Combine vector search with metadata filters
- Support hybrid retrieval (vector + keyword) when needed
- Re-rank top-k with a cross-encoder for quality
- Return scores for confidence thresholds

### Operations
- Set replication and backup for durability
- Monitor recall, latency, and index size
- Re-index when the embedding model changes
- Version the embedding model with the data

## Dependencies
```bash
# pgvector
docker run -e POSTGRES_PASSWORD=secret -p 5432:5432 -d pgvector/pgvector:pg17
# or Python-native
pip install chromadb qdrant-client
```

## Examples
```sql
-- pgvector setup and query
CREATE EXTENSION IF NOT EXISTS vector;

CREATE TABLE documents (
  id bigserial PRIMARY KEY,
  content text,
  embedding vector(384)
);

CREATE INDEX ON documents USING hnsw (embedding vector_cosine_ops);
```
```sql
-- Similarity search with filter
SELECT id, content, 1 - (embedding <=> $1) AS similarity
FROM documents
WHERE category = 'docs'
ORDER BY embedding <=> $1
LIMIT 5;
```
```python
import chromadb

client = chromadb.PersistentClient(path="./db")
col = client.get_or_create_collection("docs")

col.add(
    ids=["1", "2"],
    embeddings=[[0.1] * 384, [0.9] * 384],
    documents=["Alpha docs", "Beta docs"],
    metadatas=[{"cat": "guide"}, {"cat": "api"}],
)

res = col.query(query_embeddings=[[0.1] * 384], n_results=2, where={"cat": "guide"})
print(res["documents"])
```
```python
# Embed + store with sentence-transformers
from sentence_transformers import SentenceTransformer

model = SentenceTransformer("all-MiniLM-L6-v2")
vec = model.encode("query text").tolist()
col.add(ids=[id], embeddings=[vec], documents=[text])
```

## Step-by-Step
1. Choose a store: pgvector, Chroma, Qdrant, or managed services.
2. Pick an embedding model and vector dimension.
3. Index your corpus in batches with metadata.
4. Create an HNSW index tuned to your recall/latency goals.
5. Query with filters and hybrid options.
6. Re-rank results for quality where it matters.
7. Set backups, replication, and monitoring.
8. Re-index when you upgrade the embedding model.

## Validation
1. Recall@k meets the target on a labeled set
2. Query latency is within budget at scale
3. Metadata filters return correct subsets
4. Scores are meaningful and thresholdable
5. Backups restore successfully

## Troubleshooting
- Low recall: tune HNSW params or switch index type.
- Slow queries: reduce dimensions, add filters, or scale shards.
- Stale results: re-index after embedding model changes.

Attribution

ssrjkkssrjkk
View sourceSee grades on GitHubMore from ssrjkk →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Terse caveman voice: answer first, fluff gone, every technical fact kept. Use for /caveman, "caveman mode", "talk like caveman", "be brief", "less tokens". Stays on until "stop caveman" or "normal mode".

1100021 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

698461 votes

Writing Skills

Create and manage Claude Code skills in HASH repository following Anthropic best practices. Use when creating new skills, modifying skill-rules.json, understanding trigger patterns, working with hooks, debugging skill activation, or implementing progressive disclosure. Covers skill structure, YAML frontmatter, trigger types (keywords, intent patterns), UserPromptSubmit hook, and the 500-line rule. Includes validation and debugging with SKILL_DEBUG. Examples include rust-error-stack, cargo-dep...

3931 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3421 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Amp, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Grok Build, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

741 votes
View all in ai-agents →