vector-search-patterns

Implement vector similarity search with embeddings, indexes, and hybrid retrieval pipelines.

Updated May 16, 2026
One-click install
npx skills add https://github.com/organvm-i-theoria/_agent-ontology --skill vector-search-patterns-organvm-i-theoria
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: vector-search-patterns
Source: https://github.com/organvm-i-theoria/_agent-ontology/tree/main/.agents/skills/vector-search-patterns
Command: npx skills add https://github.com/organvm-i-theoria/_agent-ontology --skill vector-search-patterns-organvm-i-theoria

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires httpx, chromadb, asyncpg, faiss, numpy.

What problem does it solve? Building semantic search and retrieval-augmented generation requires coordinating embedding generation, chunking, vector store selection, and index tuning, which is error-prone without proven patterns. ## Core Features & Use Cases - Embedding & Chunking Pipelines: Generate embeddings via the OpenAI API and split documents with fixed-size, sentence, paragraph, or semantic chunking strategies. - Vector Store Implementations: Ready-to-use code for ChromaDB, pgvector (IVFFlat and HNSW indexes), and FAISS with metadata filtering. - Hybrid Search & RAG: Combine vector similarity with PostgreSQL full-text search using weighted scoring, then feed retrieved chunks into an LLM for grounded answers. - Use Case: You are building a documentation Q&A bot. Use this Skill to chunk your docs, store embeddings in pgvector with an HNSW index, and run hybrid retrieval before generating cited answers. ## Quick Start Ask the AI to set up a pgvector table with an HNSW index and a hybrid search query combining vector similarity and full-text search for your documents.

Frequently Asked Questions about vector-search-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement vector similarity search in PostgreSQL?▼

Enable the pgvector extension, add a vector column matching your embedding dimension, and create an IVFFlat or HNSW index. Query with the cosine distance operator embedding <=> $1::vector ordered ascending to return the nearest neighbors.

ChromaDB vs pgvector vs FAISS for vector search?▼

ChromaDB suits development and small-scale projects with a simple persistent client. pgvector fits production workloads already on PostgreSQL, while FAISS delivers high-performance local search with in-memory indexes like IndexFlatIP.

How do I combine vector search with keyword search?▼

Run vector similarity and PostgreSQL full-text search as separate CTEs, then join results with a weighted score such as 0.7 times vector score plus 0.3 times text rank. This hybrid approach improves recall over either method alone.

Which vector index should I use for my dataset size?▼

Use a flat exact index under 10K vectors, HNSW for 10K to 1M vectors with 95-99% recall, IVFFlat for 1M to 100M, and IVF with product quantization beyond 100M where speed matters most.

Why should I chunk documents before generating embeddings?▼

Embedding entire documents dilutes semantic signal and exceeds model token limits. Chunking into 500-1000 token segments with overlap preserves context boundaries and produces embeddings that match granular user queries more accurately.