Agent skill
vector-databases
Install this agent skill to your Project
npx add-skill https://github.com/cuba6112/skillfactory/tree/main/skills/vector-databases
SKILL.md
Vector Databases
Overview
Model data as vectors with payload metadata, then run similarity search with optional filters or multi-stage retrieval. Keep index maintenance in the loop so performance does not degrade as the collection changes.
When to Use
- Use this skill when the frontmatter triggers apply; otherwise start with a simple keyword search or database query.
Decision Tree
- Do you need metadata filters for access control or faceting?
- Yes: store payloads and use filtered search.
- Do you need to blend multiple signals (dense + sparse or multi-step)?
- Yes: use a multi-stage hybrid query plan.
- Is search latency degrading after heavy updates or deletes?
- Yes: run optimizer/maintenance operations.
Workflows
1. Point Ingestion With Payloads
- Generate embeddings for each document or chunk.
- Attach a payload with filterable fields (tenant, source, timestamp).
- Upsert points into a collection with consistent vector dimensions.
2. Filtered Similarity Search
- Build a metadata filter from the request constraints.
- Embed the query and run a similarity search scoped to the filter.
- Return the top-k results with payload metadata for downstream ranking.
3. Multi-Stage Hybrid Retrieval
- Run a first-stage query to get broad recall (dense or sparse).
- Use a second-stage query or re-ranker to refine results.
- Merge and normalize scores before returning the final list.
4. Index Maintenance Pass
- Monitor update/delete volume and query latency.
- Run optimizer operations (vacuum/merge/index rebuild) on a schedule.
- Verify recall/latency before and after maintenance.
Non-Obvious Insights
- Payload design is retrieval design: without payload fields, you cannot filter or enforce access constraints.
- Hybrid retrieval is often multi-stage; plan for intermediate candidate sets and score normalization.
- Optimizer operations are part of normal maintenance, not one-off recovery tasks.
Evidence
- "Points are a record which consists of a vector and an optional payload." - Qdrant
- "there are use-cases when the best search is obtained by combining multiple queries, or by performing the search in more than one stage." - Qdrant
- "inverted index, a vector index and an object store interact with each other" - Weaviate
- "Optimizer describes options to rebuild database structures for faster search. They include a vacuum, a merge, and an indexing optimizer." - Qdrant
Scripts
scripts/vector-databases_tool.py: CLI for building points, validating dimensions, and combining hybrid scores.scripts/vector-databases_tool.js: Node.js CLI for the same tasks.
Dependencies
- Python 3.11+ or Node 18+. Use your DB client for actual ingestion/search.
References
- references/README.md
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
prompt-engineering
Comprehensive prompt engineering techniques for Claude models. Use this skill when crafting, optimizing, or debugging prompts for Claude API, Claude Code, or any Claude-powered application. Covers system prompts, role prompting, multishot examples, chain of thought, XML structuring, long context handling, extended thinking, prompt chaining, Claude 4.x-specific best practices, and agentic orchestration including subagents, agent loops, skills, MCP integration, and multi-agent workflows.
adk-rag-agent
Build RAG (Retrieval-Augmented Generation) agents with Google ADK and Vertex AI RAG Engine. Use when implementing document Q&A, knowledge base search, or citation-backed responses. Covers VertexAiRagRetrieval tool, corpus setup, and citation formatting.
headless-cli-agents
Build agentic systems using Claude CLI in headless mode or the Claude Agent SDK. Use when building automation pipelines, CI/CD integrations, multi-agent orchestration, or programmatic Claude interactions. Covers CLI flags (-p, --output-format), session management (--resume, --continue), Python SDK (claude-agent-sdk), custom tools, and agent loop patterns.
notion-knowledge-capture
Capture conversations and decisions into structured Notion pages; use when turning chats/notes into wiki entries, how-tos, decisions, or FAQs with proper linking.
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
gh-fix-ci
Inspect GitHub PR checks with gh, pull failing GitHub Actions logs, summarize failure context, then create a fix plan and implement after user approval. Use when a user asks to debug or fix failing PR CI/CD checks on GitHub Actions and wants a plan + code changes; for external checks (e.g., Buildkite), only report the details URL and mark them out of scope.
Didn't find tool you were looking for?