claude-scaffold: Skill for Claude Code

.claude/skills/rag-vector-db/SKILL.md

rag-vector-db is a skill for Claude Code from pyramidheadshark/claude-scaffold. It costs 0 tokens per session (688 once invoked), scanned A, original, MIT.

A guide to building retrieval-augmented generation systems, which let an AI search a document collection before answering. It covers vector databases such as Qdrant and pgvector, embeddings, document splitting, and ingestion pipelines.

In plain words
What is it for?
Use it when building semantic search, knowledge bases, or document pipelines with Qdrant, pgvector, or embeddings.
Why use it?
It helps choose and configure the parts needed to search documents by meaning instead of exact words.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is pyramidheadshark/claude-scaffold's own configuration. It tells Claude Code how to work on claude-scaffold itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything claude-scaffold configures →

Reuse

Borrowing it

Nothing to install: this file belongs to pyramidheadshark/claude-scaffold. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/pyramidheadshark/claude-scaffold/main/.claude/skills/rag-vector-db/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/pyramidheadshark/claude-scaffold

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 rag-vector-db

README.md
[![agentmods](https://agentmods.dev/badge/skills/pyramidheadshark/claude-scaffold/rag-vector-db/github.svg)](https://agentmods.dev/skills/pyramidheadshark/claude-scaffold/rag-vector-db)
Your own site
<a href="https://agentmods.dev/skills/pyramidheadshark/claude-scaffold/rag-vector-db"><img src="https://agentmods.dev/badge/skills/pyramidheadshark/claude-scaffold/rag-vector-db/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.

agentmods 80×15 button for rag-vector-db

Your own site · 80×15
<a href="https://agentmods.dev/skills/pyramidheadshark/claude-scaffold/rag-vector-db"><img src="https://agentmods.dev/badge/skills/pyramidheadshark/claude-scaffold/rag-vector-db.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 688 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00000 $0.00688
Opus 5 $0.00000 $0.00344
Sonnet 5 $0.00000 $0.00138
Haiku 4.5 $0.00000 $0.00069

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

Security

Grade A, and why

rag-vector-db 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 9d 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.

.claude/skills/rag-vector-db/SKILL.md · 91 lines

How it starts

The opening of the file, as written. The whole thing — 91 lines — stays where its author put it; the contents beside it link to each section on GitHub.

RAG & Vector DB Patterns

When to Load This Skill

Load when working with: Qdrant, pgvector, embeddings, chunking, retrieval-augmented generation, semantic search, knowledge bases, document ingestion pipelines.

Vector DB Choice

Option When to Use
Qdrant Default choice. Standalone service, excellent filtering, production-ready, Docker-friendly
pgvector Already have PostgreSQL, simple use case, don't want extra service
In-memory (numpy) Prototyping only, < 10k documents

Qdrant Setup

services:
  qdrant:
    image: qdrant/qdrant:latest
    ports:
      - "6333:6333"
    volumes:
      - qdrant_data:/qdrant/storage

volumes:
  qdrant_data:

Full adapter implementation: resources/qdrant-adapter.md

Embeddings

Two options:

  • OpenRouter (text-embedding-3-small) — API-based, no local GPU required
  • sentence-transformers (multilingual-e5-base, 768 dim, ~280MB) — local, free, good for Russian

Full implementations: resources/embeddings.md

Chunking

Chunking is the most critical RAG quality parameter. Default: paragraph-based, 512 tokens, 1-sentence overlap.

Full strategy + Chunk dataclass: resources/chunking-strategies.md

RAG Query Pipeline

class RAGService:
    def __init__(
        self,
        vector_db: QdrantAdapter,
        embedder: LocalEmbeddingAdapter,
        llm_adapter,
    ) -> None:
        self._db = vector_db
        self._embedder = embedder
        self._llm = llm_adapter

    async def answer(self, question: str, top_k: int = 5) -> dict:
        query_embedding = self._embedder.embed([question])[0]
        retrieved = await self._db.search(query_embedding, top_k=top_k)

        if not retrieved:
            return {"answer": "No information found in knowledge base.", "sources": []}

        context = "\n\n---\n\n".join(r["text"] for r in retrieved)
        sources = list({r["source"] for r in retrieved})

        answer = await self._llm.invoke(
            system="Answer based only on the provided context. If the answer is not in the context, say so explicitly.",
            messages=[{"role": "user", "content": f"Context:\n{context}\n\nQuestion: {question}"}],
        )

        return {"answer": answer, "sources": sources, "retrieved_count": len(retrieved)}

Read the full file on GitHub · 91 lines

Files

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.

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. 9d ago First seen · 91 lines · 0 tokens per session scan A 9a7f5bd668b2

Subscribe to this mod's changes

rag-vector-db is a skill published in the GitHub repository pyramidheadshark/claude-scaffold (4 stars, last pushed 4mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 688 tokens. 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.