Token导航 LogoToken导航

Agent Skill · 研究检索

using-vector-databases(使用矢量数据库)

用于辅助数据库表结构、查询语句、迁移脚本和数据维护任务。它适合让 Agent 分析 schema、编写 SQL、排查查询问题、整理索引或生成迁移建议。使用时需要明确数据库类型、连接环境和目标表,区分只读分析与写入变更;涉及删除、更新、迁移和批量导入时,应优先 dry-run、备份或事务保护,避免误操作。

using-vector-databases 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证为 MIT,第三方扫描有未通过项,按安装量在研究检索类的 73,675 个 Skill 里排第 50,882。

总安装 605周安装 26GitHub Stars 350下载 212核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:using-vector-databases(使用矢量数据库)
来源仓库:https://github.com/ancoleman/ai-design-components
仓库路径:skills/using-vector-databases
安装命令:
npx skills add https://github.com/ancoleman/ai-design-components --skill using-vector-databases
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/ancoleman/ai-design-components --skill using-vector-databases

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于辅助数据库表结构分析和查询语句编写。适合分析 schema、排查查询问题或生成迁移建议。需明确数据库类型和连接环境,区分只读与写入操作。涉及删除或批量导入时应优先 dry-run 或备份保护。using-vector-databases 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/using-vector-databases

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/ancoleman/ai-design-components --skill using-v…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

using-vector-databases 怎么安装?

在终端执行 npx skills add https://github.com/ancoleman/ai-design-components --skill using-vector-data…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

using-vector-databases 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

using-vector-databases 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

using-vector-databases 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

using-vector-databases 用的人多吗?

公开数据是累计安装 605 次,近一周安装 26 次,下载 212 次,GitHub 350 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

using-vector-databases 安全吗?

第三方扫描有未通过项,风险较高。除非你确认过源码,否则不建议直接安装到常用环境。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
using-vector-databases

使用矢量数据库 · 本页

605350接触敏感数据MIT未通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Vector Databases for AI Applications

When to Use This Skill

Use this skill when implementing:

  • RAG (Retrieval-Augmented Generation) systems for AI chatbots
  • Semantic search capabilities (meaning-based, not just keyword)
  • Recommendation systems based on similarity
  • Multi-modal AI (unified search across text, images, audio)
  • Document similarity and deduplication
  • Question answering over private knowledge bases

Quick Decision Framework

1. Vector Database Selection

START: Choosing a Vector Database

EXISTING INFRASTRUCTURE?
├─ Using PostgreSQL already?
│  └─ pgvector (<10M vectors, tight budget)
│      See: references/pgvector.md
│
└─ No existing vector database?
   │
   ├─ OPERATIONAL PREFERENCE?
   │  │
   │  ├─ Zero-ops managed only
   │  │  └─ Pinecone (fully managed, excellent DX)
   │  │      See: references/pinecone.md
   │  │
   │  └─ Flexible (self-hosted or managed)
   │     │
   │     ├─ SCALE: <100M vectors + complex filtering ⭐
   │     │  └─ Qdrant (RECOMMENDED)
   │     │      • Best metadata filtering
   │     │      • Built-in hybrid search (BM25 + Vector)
   │     │      • Self-host: Docker/K8s
   │     │      • Managed: Qdrant Cloud
   │     │      See: references/qdrant.md
   │     │
   │     ├─ SCALE: >100M vectors + GPU acceleration
   │     │  └─ Milvus / Zilliz Cloud
   │     │      See: references/milvus.md
   │     │
   │     ├─ Embedded / No server
   │     │  └─ LanceDB (serverless, edge deployment)
   │     │
   │     └─ Local prototyping
   │        └─ Chroma (simple API, in-memory)

2. Embedding Model Selection

REQUIREMENTS?

├─ Best quality (cost no object)
│  └─ Voyage AI voyage-3 (1024d)
│      • 9.74% better than OpenAI on MTEB
│      • ~$0.12/1M tokens
│      See: references/embedding-strategies.md
│
├─ Enterprise reliability
│  └─ OpenAI text-embedding-3-large (3072d)
│      • Industry standard
│      • ~$0.13/1M tokens
│      • Maturity shortening: reduce to 256/512/1024d
│
├─ Cost-optimized
│  └─ OpenAI text-embedding-3-small (1536d)
│      • ~$0.02/1M tokens (6x cheaper)
│      • 90-95% of large model performance
│
├─ Multilingual (100+ languages)
│  └─ Cohere embed-v3 (1024d)
│      • ~$0.10/1M tokens
│
└─ Self-hosted / Privacy-critical
   ├─ English: nomic-embed-text-v1.5 (768d, Apache 2.0)
   ├─ Multilingual: BAAI/bge-m3 (1024d, MIT)
   └─ Long docs: jina-embeddings-v2 (768d, 8K context)

Core Concepts

Document Chunking Strategy

Recommended defaults for most RAG systems:

  • Chunk size: 512 tokens (not characters)
  • Overlap: 50 tokens (10% overlap)

Why these numbers?

  • 512 tokens balances context vs. precision

- Too small (128-256): Fragments concepts, loses context - Too large (1024-2048): Dilutes relevance, wastes LLM tokens

  • 50 token overlap ensures sentences aren't split mid-context

See references/chunking-patterns.md for advanced strategies by content type.

Hybrid Search (Vector + Keyword)

Hybrid Search = Vector Similarity + BM25 Keyword Matching

User Query: "OAuth refresh token implementation"
           │
    ┌──────┴──────┐
    │             │
Vector Search   Keyword Search
(Semantic)      (BM25)
    │             │
Top 20 docs   Top 20 docs
    │             │
    └──────┬──────┘
           │
   Reciprocal Rank Fusion
   (Merge + Re-rank)
           │
    Final Top 5 Results

Why hybrid matters:

  • Vector captures semantic meaning ("OAuth refresh" ≈ "token renewal")
  • Keyword ensures exact matches ("refresh_token" literal)
  • Combined provides best retrieval quality

See references/hybrid-search.md for implementation details.

Getting Started

Python + Qdrant Example

from qdrant_client import QdrantClient
from qdrant_client.models import Distance, VectorParams, PointStruct

# 1. Initialize client
client = QdrantClient("localhost", port=6333)

# 2. Create collection
client.create_collection(
    collection_name="documents",
    vectors_config=VectorParams(size=1024, distance=Distance.COSINE)
)

# 3. Insert documents with embeddings
points = [
    PointStruct(
        id=idx,
        vector=embedding,  # From OpenAI/Voyage/etc
        payload={
            "text": chunk_text,
            "source": "docs/api.md",
            "section": "Authentication"
        }
    )
    for idx, (embedding, chunk_text) in enumerate(chunks)
]
client.upsert(collection_name="documents", points=points)

# 4. Search with metadata filtering
results = client.search(
    collection_name="documents",
    query_vector=query_embedding,
    limit=5,
    query_filter={
        "must": [
            {"key": "section", "match": {"value": "Authentication"}}
        ]
    }
)

For complete examples, see examples/qdrant-python/.

TypeScript + Qdrant Example

import { QdrantClient } from '@qdrant/js-client-rest';

const client = new QdrantClient({ url: 'http://localhost:6333' });

// Create collection
await client.createCollection('documents', {
  vectors: { size: 1024, distance: 'Cosine' }
});

// Insert documents
await client.upsert('documents', {
  points: chunks.map((chunk, idx) => ({
    id: idx,
    vector: chunk.embedding,
    payload: {
      text: chunk.text,
      source: chunk.source
    }
  }))
});

// Search
const results = await client.search('documents', {
  vector: queryEmbedding,
  limit: 5,
  filter: {
    must: [
      { key: 'source', match: { value: 'docs/api.md' } }
    ]
  }
});

For complete examples, see examples/typescript-rag/.

RAG Pipeline Architecture

Complete Pipeline Components

1. INGESTION
   ├─ Document Loading (PDF, web, code, Office)
   ├─ Text Extraction & Cleaning
   ├─ Chunking (semantic, recursive, code-aware)
   └─ Embedding Generation (batch, rate-limited)

2. INDEXING
   ├─ Vector Store Insertion (batch upsert)
   ├─ Index Configuration (HNSW, distance metric)
   └─ Keyword Index (BM25 for hybrid search)

3. RETRIEVAL (Query Time)
   ├─ Query Processing (expansion, embedding)
   ├─ Hybrid Search (vector + keyword)
   ├─ Filtering & Post-Processing (metadata, MMR)
   └─ Re-Ranking (cross-encoder, LLM-based)

4. GENERATION
   ├─ Context Construction (format chunks, citations)
   ├─ Prompt Engineering (system + context + query)
   ├─ LLM Inference (streaming, temperature tuning)
   └─ Response Post-Processing (citations, validation)

5. EVALUATION (Production Critical)
   ├─ Retrieval Metrics (precision, recall, relevancy)
   ├─ Generation Metrics (faithfulness, correctness)
   └─ System Metrics (latency, cost, satisfaction)

Essential Metadata for Production RAG

Critical for filtering and relevance:

metadata = {
    # SOURCE TRACKING
    "source": "docs/api-reference.md",
    "source_type": "documentation",  # code, docs, logs, chat
    "last_updated": "2025-12-01T12:00:00Z",

    # HIERARCHICAL CONTEXT
    "section": "Authentication",
    "subsection": "OAuth 2.1",
    "heading_hierarchy": ["API Reference", "Authentication", "OAuth 2.1"],

    # CONTENT CLASSIFICATION
    "content_type": "code_example",  # prose, code, table, list
    "programming_language": "python",

    # FILTERING DIMENSIONS
    "product_version": "v2.0",
    "audience": "enterprise",  # free, pro, enterprise

    # RETRIEVAL HINTS
    "chunk_index": 3,
    "total_chunks": 12,
    "has_code": True
}

Why metadata matters:

  • Enables filtering BEFORE vector search (reduces search space)
  • Improves relevance through targeted retrieval
  • Supports multi-tenant systems (filter by user/org)
  • Enables versioned documentation (filter by product version)

Evaluation with RAGAS

Use scripts/evaluate_rag.py for automated evaluation:

from ragas import evaluate
from ragas.metrics import (
    faithfulness,       # Answer grounded in context
    answer_relevancy,   # Answer addresses query
    context_recall,     # Retrieved docs cover ground truth
    context_precision   # Retrieved docs are relevant
)

# Test dataset
test_data = {
    "question": ["How do I refresh OAuth tokens?"],
    "answer": ["Use /token with refresh_token grant..."],
    "contexts": [["OAuth refresh documentation..."]],
    "ground_truth": ["POST to /token with grant_type=refresh_token"]
}

# Evaluate
results = evaluate(test_data, metrics=[
    faithfulness,
    answer_relevancy,
    context_recall,
    context_precision
])

# Production targets:
# faithfulness: >0.90 (minimal hallucination)
# answer_relevancy: >0.85 (addresses user query)
# context_recall: >0.80 (sufficient context retrieved)
# context_precision: >0.75 (minimal noise)

Performance Optimization

Embedding Generation

  • Batch processing: 100-500 chunks per batch
  • Caching: Cache embeddings by content hash
  • Rate limiting: Respect API provider limits (exponential backoff)

Vector Search

  • Index type: HNSW (Hierarchical Navigable Small World) for most cases
  • Distance metric: Cosine for normalized embeddings
  • Pre-filtering: Apply metadata filters before vector search
  • Result diversity: Use MMR (Maximal Marginal Relevance) to reduce redundancy

Cost Optimization

  • Embedding model: Consider text-embedding-3-small for budget constraints
  • Dimension reduction: Use maturity shortening (3072d → 1024d)
  • Caching: Implement semantic caching for repeated queries
  • Batch operations: Group insertions/updates for efficiency

Common Workflows

1. Building a RAG Chatbot

  • Vector database: Qdrant (self-hosted or cloud)
  • Embeddings: OpenAI text-embedding-3-large
  • Chunking: 512 tokens, 50 overlap, semantic splitter
  • Search: Hybrid (vector + BM25)
  • Integration: Frontend with ai-chat skill

See examples/qdrant-python/ for complete implementation.

2. Semantic Search Engine

  • Vector database: Qdrant or Pinecone
  • Embeddings: Voyage AI voyage-3 (best quality)
  • Chunking: Content-type specific (see chunking-patterns.md)
  • Search: Hybrid with re-ranking
  • Filtering: Pre-filter by metadata (date, category, etc.)

3. Code Search

  • Vector database: Qdrant
  • Embeddings: OpenAI text-embedding-3-large
  • Chunking: AST-based (function/class boundaries)
  • Metadata: Language, file path, imports
  • Search: Hybrid with language filtering

See examples/qdrant-python/ for code-specific implementation.

Integration with Other Skills

Frontend Skills

  • ai-chat: Vector DB powers RAG pipeline behind chat interface
  • search-filter: Replace keyword search with semantic search
  • data-viz: Visualize embedding spaces, similarity scores

Backend Skills

  • databases-relational: Hybrid approach using pgvector extension
  • api-patterns: Expose semantic search via REST/GraphQL
  • observability: Monitor embedding quality and retrieval metrics

Multi-Language Support

Python (Primary)

  • Client: qdrant-client
  • Framework: LangChain, LlamaIndex
  • See: examples/qdrant-python/

Rust

  • Client: qdrant-client (1,549 code snippets in Context7)
  • Framework: Raw Rust for performance-critical systems
  • See: examples/rust-axum-vector/

TypeScript

  • Client: @qdrant/js-client-rest
  • Framework: LangChain.js, integration with Next.js
  • See: examples/typescript-rag/

Go

  • Client: qdrant-go
  • Use case: High-performance microservices

Troubleshooting

Poor Retrieval Quality

  1. Check chunking strategy (too large/small?)
  2. Verify metadata filtering (too restrictive?)
  3. Try hybrid search instead of vector-only
  4. Implement re-ranking stage
  5. Evaluate with RAGAS metrics

Slow Performance

  1. Use HNSW index (not Flat)
  2. Pre-filter with metadata before vector search
  3. Reduce vector dimensions (maturity shortening)
  4. Batch operations (insertions, searches)
  5. Consider GPU acceleration (Milvus)

High Costs

  1. Switch to text-embedding-3-small
  2. Implement semantic caching
  3. Reduce chunk overlap
  4. Use self-hosted embeddings (nomic, bge-m3)
  5. Batch embedding generation

Qdrant Context7 Documentation

Primary resource: /llmstxt/qdrant_tech_llms-full_txt

  • Trust score: High
  • Code snippets: 10,154
  • Quality score: 83.1

Access via Context7:

resolve-library-id({ libraryName: "Qdrant" })
get-library-docs({
  context7CompatibleLibraryID: "/llmstxt/qdrant_tech_llms-full_txt",
  topic: "hybrid search collections python",
  mode: "code"
})

Additional Resources

Reference Documentation

  • references/qdrant.md - Comprehensive Qdrant guide
  • references/pgvector.md - PostgreSQL pgvector extension
  • references/milvus.md - Milvus/Zilliz for billion-scale
  • references/embedding-strategies.md - Embedding model comparison
  • references/chunking-patterns.md - Advanced chunking techniques

Code Examples

  • examples/qdrant-python/ - FastAPI + Qdrant RAG pipeline
  • examples/pgvector-prisma/ - PostgreSQL + Prisma integration
  • examples/typescript-rag/ - TypeScript RAG with Hono

Automation Scripts

  • scripts/generate_embeddings.py - Batch embedding generation
  • scripts/benchmark_similarity.py - Performance benchmarking
  • scripts/evaluate_rag.py - RAGAS-based evaluation

Next Steps:

  1. Choose vector database based on scale and infrastructure
  2. Select embedding model based on quality vs. cost trade-off
  3. Implement chunking strategy for the content type
  4. Set up hybrid search for production quality
  5. Evaluate with RAGAS metrics
  6. Optimize for performance and cost

平台分布

OpenCode

29.38%
按下载量换算62

Gemini CLI

23.6%
按下载量换算50

Antigravity

15.65%
按下载量换算33

Claude Code

12.2%
按下载量换算26

Cursor

7.67%
按下载量换算16

mcpjam

3.66%
按下载量换算8

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

可疑

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。

继续浏览同类 Skills