postgres-semantic-search

Solid

PostgreSQL-based semantic and hybrid search with pgvector and ParadeDB. Use when implementing vector search, semantic search, hybrid search, or full-text search in PostgreSQL. Covers pgvector indexing, hybrid FTS/BM25 + RRF, ParadeDB, reranking, halfvec, multilingual search, query translation, and domain evals. Triggers: pgvector, vector search, semantic search, hybrid search, embedding search, PostgreSQL RAG, BM25, RRF, HNSW, IVFFlat, ParadeDB, pg_search, reranking, iterative_scan, filtered HNSW, halfvec, websearch_to_tsquery, unaccent, multilingual FTS, pg_trgm, trigram, fuzzy search, ILIKE, autocomplete, typo tolerance, fuzzystrmatch, Hit@K, MRR, retrieval evals, cross-lingual retrieval, non-English corpus, per-language indexing, query translation For general Postgres schema, index, RLS or query tuning unrelated to retrieval, use supabase-postgres-best-practices instead.

AI & Automation 62 stars 18 forks Updated 1 weeks ago MIT

Install

View on GitHub

Quality Score: 85/100

Stars 20%
60
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# PostgreSQL Semantic Search ## Quick Start ### 1. Setup ```sql CREATE EXTENSION IF NOT EXISTS vector; CREATE TABLE documents ( id SERIAL PRIMARY KEY, content TEXT NOT NULL, embedding vector(1536) -- 1536-dim embedding -- Or: embedding halfvec(3072) -- 3072-dim embedding (halfvec = 50% memory) ); ``` ### 2. Basic Semantic Search ```sql SELECT id, content, 1 - (embedding <=> query_vec) AS similarity FROM documents ORDER BY embedding <=> query_vec LIMIT 10; ``` ### 3. Add Index (> 10k documents) ```sql CREATE INDEX ON documents USING hnsw (embedding vector_cosine_ops); ``` ### Docker Quick Start ```bash # pgvector with PostgreSQL 17 docker run -d --name pgvector-db \ -e POSTGRES_PASSWORD=postgres \ -p 5432:5432 \ pgvector/pgvector:pg17 # Or PostgreSQL 18 docker run -d --name pgvector-db \ -e POSTGRES_PASSWORD=postgres \ -p 5432:5432 \ pgvector/pgvector:pg18 # ParadeDB (includes pgvector + pg_search + BM25) docker run -d --name paradedb \ -e POSTGRES_PASSWORD=postgres \ -p 5432:5432 \ paradedb/paradedb:latest # `latest` is convenient for quick-start; pin to e.g. paradedb/paradedb:pg17 for reproducible builds ``` Connect: `psql postgresql://postgres:postgres@localhost:5432/postgres` ## Cheat Sheet ### Distance Operators ```sql embedding <=> query -- Cosine distance (1 - similarity) embedding <-> query -- L2/Euclidean distance embedding <#> query -- Negative inner...

Details

Author
laguagu
Repository
laguagu/claude-code-nextjs-skills
Created
8 months ago
Last Updated
1 weeks ago
Language
TypeScript
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Featured

pgvector-semantic-search

Use this skill for setting up vector similarity search with pgvector for AI/ML embeddings, RAG applications, or semantic search. **Trigger when user asks to:** - Store or search vector embeddings in PostgreSQL - Set up semantic search, similarity search, or nearest neighbor search - Create HNSW or IVFFlat indexes for vectors - Implement RAG (Retrieval Augmented Generation) with PostgreSQL - Optimize pgvector performance, recall, or memory usage - Use binary quantization for large vector datasets **Keywords:** pgvector, embeddings, semantic search, vector similarity, HNSW, IVFFlat, halfvec, cosine distance, nearest neighbor, RAG, LLM, AI search Covers: halfvec storage, HNSW index configuration (m, ef_construction, ef_search), quantization strategies, filtered search, bulk loading, and performance tuning.

1,835 Updated 2 days ago
timescale
AI & Automation Listed

pgvector-search

(Aspirational) Production hybrid search with PGVector + BM25 using Reciprocal Rank Fusion, metadata filtering, and performance optimization for semantic retrieval

6 Updated 1 months ago
ArieGoldkin
AI & Automation Featured

postgres-hybrid-text-search

Use this skill to implement hybrid search combining BM25 keyword search with semantic vector search using Reciprocal Rank Fusion (RRF). **Trigger when user asks to:** - Combine keyword and semantic search - Implement hybrid search or multi-modal retrieval - Use BM25/pg_textsearch with pgvector together - Implement RRF (Reciprocal Rank Fusion) for search - Build search that handles both exact terms and meaning **Keywords:** hybrid search, BM25, pg_textsearch, RRF, reciprocal rank fusion, keyword search, full-text search, reranking, cross-encoder Covers: pg_textsearch BM25 index setup, parallel query patterns, client-side RRF fusion (Python/TypeScript), weighting strategies, and optional ML reranking.

1,835 Updated 2 days ago
timescale