← ClaudeAtlas

pgvector-searchlisted

(Aspirational) Production hybrid search with PGVector + BM25 using Reciprocal Rank Fusion, metadata filtering, and performance optimization for semantic retrieval
ArieGoldkin/claude-forge · ★ 6 · AI & Automation · score 77
Install: claude install-skill ArieGoldkin/claude-forge
> **Aspirational** — these patterns are not yet implemented in the reference platform. # PGVector Hybrid Search **Production-grade semantic + keyword search using PostgreSQL** ## Overview Hybrid search combines **semantic similarity** (vector embeddings) with **keyword matching** (BM25) to achieve better retrieval than either alone. **Architecture:** ``` Query ↓ [Generate embedding] → Vector Search (PGVector) → Top 30 results ↓ [Generate ts_query] → Keyword Search (BM25) → Top 30 results ↓ [Reciprocal Rank Fusion (RRF)] → Merge & re-rank → Top 10 final results ``` ## Core Concepts ### 1. Semantic Search (Vector Similarity) **How it works:** 1. Embed query: `"database indexing strategies"` → `[0.23, -0.15, ..., 0.42]` (1024 dims) 2. Find nearest neighbors: `ORDER BY embedding <=> query_embedding LIMIT 30` 3. Returns: Conceptually similar documents (even with different words) **Example:** - Query: "machine learning model training" - Matches: "neural network optimization", "deep learning techniques" - Misses: "ML model training" (different embeddings despite similar meaning) **Strengths:** - Captures semantic meaning - Works across languages - Handles synonyms ("car" matches "automobile") **Weaknesses:** - Slow for exact keyword matches - Sensitive to embedding quality - Doesn't handle rare technical terms well --- ### 2. Keyword Search (BM25) **How it works:** 1. Tokenize query: `"database indexing"` → `database & indexing` 2. Full-text search: `WHERE co