Agent skill · data analytics · laguagu

postgres-semantic-search

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.

Why this skill is useful

Provides specific commands and indexing techniques for implementing semantic search in PostgreSQL that the AI wouldn't reliably generate on its own.

What it needs

Requires docker installed locally. About 10k tokens when loaded. Last updated 2026-08-03. 58 stars on the source repository.

What this skill does

PostgreSQL Semantic Search Quick Start 1. Setup 2. Basic Semantic Search 3. Add Index (> 10k documents) Docker Quick Start Connect: psql postgresql://postgres:postgres@localhost:5432/postgres Cheat Sheet Common Queries Index Quick Reference Decision Trees Choose Search Method Baseline hybrid against vector-only before shipping it. Hybrid is the right default for mixed queries, not an automatic win: on one measured corpus pure vector beat a well-weighted hybrid on both recall and MRR and was 9× faster, while a badly weighted one lost 10 pp. The keyword arm still earns its keep for exact identifiers, which a needle-in-haystack eval set cannot see — so keep it, and judge it on queries that need it. Numbers in hybrid-search.md. Choose Index Type Choose Vector Type Choose by dimensions, not by provider — the column type only depends on embedding size and pgvector's HNSW index limits. Common embedding dimensions are 1536 and 3072, but sizes vary by provider and model — check the provider's docs for the embedding you're using. For multilingual / non-English content, prefer multilingual-tuned embedding models (look for "multilingual" in the model name). Models tuned only on English may handle compound words and inflection poorly. Storage vs. index trick for 2000 < N ≤ 4000: keep the column as vector(N) (full float4, useful for future re-embedding or re-ranking experiments) and only cast at index creation and query time. This preserves precision on disk while staying within HNSW's dimension limit. If storage is tight or you never plan to re-embed, use halfvec(N) as the column type directly. Measure before adopting Every optimization in this skill (hybrid fusion, reranking, query expansion, embedding-model swaps) can regress on a specific corpus. Vendor and paper benchmarks are usually English, general-domain, and their ordering does not reliably transfer. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills laguagu/postgres-semantic-search

View the source on GitHub

Browse the @skills marketplace