Skip to content
Back to skills

Vector Db Indexer

ASecurity

Chunk documents and store vector embeddings into a Vector DB.

  • 2 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 27, 2026
ai-agentspythonapi

Works with

  • cli
  • api

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro shows the line behind each finding and how to fix it

Scanned September 27, 2026

npx -y skills add RMAzrim/opencode-artes --skill vector-db-indexer --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Vector Db Indexer?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Vector Db Indexer
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/rmazrim-vector-db-indexer/badge)](https://www.skillsdirectory.com/skills/rmazrim-vector-db-indexer)

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

Download with Pro
SKILL.md
---
name: Vector DB Indexer
description: Chunk documents and store vector embeddings into a Vector DB.
metadata:
  source: skills/vector-db-indexer/vector-db-indexer.md
---

# Vector DB Indexer

## Prerequisites & Dependencies
- Python 3.10+
- Packages: `pip install qdrant-client sentence-transformers tiktoken` (swap in `openai` for API embeddings; Chroma/pgvector equivalents follow the same flow)
- Environment: `EMBEDDING_MODEL` (e.g., `sentence-transformers/all-MiniLM-L6-v2`); `QDRANT_URL` and `QDRANT_API_KEY` when using managed Qdrant Cloud

## Execution Steps
1. Load source documents and normalize text: strip headers/footers, collapse whitespace, and extract metadata (source path, section title, timestamp).
2. Chunk with a token-bounded splitter (256-512 tokens) and 10-15% overlap so boundary context is preserved.
3. Generate embeddings in batches; ensure query-time embedding uses the exact same model and version.
4. Create the collection with matching vector size and distance metric (cosine for normalized embeddings) and add a payload index for metadata filtering.
5. Upsert points with deterministic UUIDs (hash of source path + chunk index) for idempotent re-indexing, storing chunk text and metadata as payload.
6. Verify: run semantic test queries, inspect top-k hits for relevance, and compare collection point count against expected chunk count.

```python
import hashlib, uuid
from qdrant_client import QdrantClient, models
from sentence_transformers import SentenceTransformer

CHUNK, OVERLAP = 400, 60  # words; tune to your embedding model
model = SentenceTransformer("all-MiniLM-L6-v2")
client = QdrantClient(url="http://localhost:6333")
client.create_collection(
    "docs",
    vectors_config=models.VectorParams(size=384, distance=models.Distance.COSINE),
)

def chunk_text(text: str) -> list[str]:
    words = text.split()
    return [" ".join(words[i:i + CHUNK]) for i in range(0, len(words), CHUNK - OVERLAP)]

points = []
for doc in documents:  # [{"path": str, "text": str}]
    for i, chunk in enumerate(chunk_text(doc["text"])):
        pid = uuid.UUID(hashlib.md5(f"{doc['path']}:{i}".encode()).hexdigest())
        points.append(models.PointStruct(
            id=str(pid),
            vector=model.encode(chunk).tolist(),
            payload={"text": chunk, "source": doc["path"], "chunk": i},
        ))
client.upsert("docs", points=points, wait=True)
```

Attribution

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

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.