Chuyển đến nội dung
Skillpedia
Cơ sở dữ liệu18k · #10719

vector-db

Skill này làm gì

Skill này hướng dẫn thiết kế hệ thống tìm kiếm vector để tìm nội dung theo ý nghĩa, gồm chọn embedding, kích thước đoạn và chỉ mục. Skill dành cho đội nhóm xây dựng tìm kiếm ngữ nghĩa hoặc truy xuất cho trợ lý AI.

Khi nào nên dùng

  • ✓Khi bạn muốn tìm kiếm theo ý nghĩa thay vì theo từ khóa chính xác.
  • ✓Khi bạn xây dựng cơ chế truy xuất để trợ lý AI có thể trả lời từ tài liệu của bạn.
  • ✓Khi bạn cần chọn loại chỉ mục hoặc thước đo khoảng cách cho embedding.

Liên kết skill

https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/vector-db/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/vector-db/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Hãy giúp tôi thiết lập tìm kiếm ngữ nghĩa trên các bài viết của trung tâm trợ giúp, để trợ lý AI tìm đúng bài cho từng câu hỏi.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Skill giải thích cách chọn mô hình embedding, chia tài liệu thành các đoạn có kích thước hợp lý, chọn thước đo khoảng cách và chỉ mục, rồi kết hợp tìm kiếm vector với tìm kiếm từ khóa.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Vector Database Expert

A retrieval systems specialist with deep expertise in embedding models, vector indexing algorithms, and Retrieval-Augmented Generation (RAG) architectures. This skill provides guidance for designing and operating vector search systems that power semantic search, recommendation engines, and LLM knowledge augmentation, covering embedding selection, indexing strategies, chunking, hybrid search, and production deployment.

Key Principles

  • Choose the embedding model based on your domain and retrieval task; general-purpose models work well for broad use cases, but domain-specific fine-tuned embeddings significantly improve recall for specialized content
  • Select the distance metric that matches your embedding model's training objective: cosine similarity for normalized embeddings, dot product for magnitude-aware comparisons, and L2 (Euclidean) for spatial distance
  • Chunk documents thoughtfully; chunk size directly impacts retrieval quality because too-large chunks dilute relevance while too-small chunks lose context
  • Index choice determines the trade-off between search speed, memory usage, and recall accuracy; understand HNSW, IVF, and flat index characteristics before choosing
  • Combine dense vector search with sparse keyword search (hybrid retrieval) for production systems; neither approach alone handles all query types optimally

Techniques

  • Generate embeddings with models like OpenAI text-embedding-3-small, Cohere embed-v3, or open-source sentence-transformers (all-MiniLM-L6-v2, BGE, E5) depending on cost and quality requirements
  • Configure HNSW indexes with appropriate M (connections per node, typically 16-64) and efConstruction (build quality, typically 100-200) parameters; higher values improve recall at the cost of memory and build time
  • Implement chunking strategies: fixed-size with overlap (e.g., 512 tokens with 50-token overlap), semantic chunking at paragraph or section boundaries, or recursive splitting that respects document structure
  • Build hybrid search by executing both vector similarity and BM25/keyword queries, then combining results with Reciprocal Rank Fusion (RRF) or a learned reranker like Cohere Rerank or cross-encoder models
  • Filter results using metadata (date ranges, categories, access permissions) at query time; most vector databases support pre-filtering or post-filtering with different performance characteristics
  • Design the RAG pipeline: query embedding, retrieval (top-k candidates), optional reranking, context assembly with source citations, and LLM generation with the retrieved context in the prompt

Common Patterns

  • Parent-Child Retrieval: Embed small chunks for precise matching but return the larger parent document or section as context to the LLM, preserving surrounding information
  • Multi-vector Representation: Generate multiple embeddings per document (title, summary, full text) and search across all representations to improve recall for different query styles
  • Contextual Retrieval: Prepend a document-level summary or metadata to each chunk before embedding so that the vector captures both local content and global context
  • Evaluation Pipeline: Measure retrieval quality with precision@k, recall@k, and NDCG using a labeled relevance dataset; track these metrics as embedding models and chunking strategies change

Pitfalls to Avoid

  • Do not use a single embedding model for all use cases without benchmarking; embedding quality varies dramatically across domains, languages, and query types
  • Do not index documents without preprocessing: remove boilerplate, normalize whitespace, and handle tables and code blocks as structured content rather than raw text
  • Do not skip reranking in production RAG systems; initial vector retrieval optimizes for speed, but a cross-encoder reranker significantly improves precision in the final results
  • Do not store only vectors without the original text and metadata; you need the source content for LLM context assembly, debugging, and auditing retrieval results
Câu hỏi thường gặp

Embedding là gì?

Đó là một danh sách số biểu diễn ý nghĩa của một đoạn văn bản, nên những văn bản có ý nghĩa gần nhau sẽ nằm gần nhau trong không gian số.

Vì sao kích thước đoạn lại quan trọng?

Đoạn quá lớn làm loãng mức liên quan, còn đoạn quá nhỏ làm mất ngữ cảnh cần để trả lời.

Vì sao kết hợp tìm kiếm vector và từ khóa?

Skill nói không cách nào tự nó xử lý tốt mọi loại truy vấn, nên tìm kiếm lai hoạt động tốt hơn khi chạy thực tế.

Chi tiết

Mô tả gốc của tác giả

Vector database expert for embeddings, similarity search, RAG patterns, and indexing strategies

repo: RightNow-AI/openfang

Độ phổ biến

Sao GitHub
18k
Vị trí xếp hạng
#10719
Giấy phép
Apache-2.0
Cập nhật
2/7/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự