postgres-semantic-search

Enables semantic and hybrid search in PostgreSQL using vector embeddings and SQL functions.

Updated Apr 4, 2026
One-click install
npx skills add https://github.com/PheonixCodder/Beeclean-Production --skill postgres-semantic-search-pheonixcodder
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgres-semantic-search
Source: https://github.com/PheonixCodder/Beeclean-Production/tree/main/.agents/skills/postgres-semantic-search
Command: npx skills add https://github.com/PheonixCodder/Beeclean-Production --skill postgres-semantic-search-pheonixcodder

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires openai, @supabase/supabase-js, drizzle-orm, and includes scripts (resource) and references (resource) components.

What problem does it solve?

PostgreSQL-based semantic and hybrid search enables accurate retrieval across large text collections by combining vector similarity with traditional keyword search within a single database.

Core Features & Use Cases

  • Supports vector(1536) and halfvec(3072) embeddings with HNSW and IVFFlat indexes for scalable search.
  • Provides semantic search, hybrid search (FTS + BM25 + RRF), and ParadeDB as an Elasticsearch alternative.
  • Includes re-ranking options (Cohere/cross-encoders) for improved ranking in production search apps.

Quick Start

Compute a query embedding and call match_documents to retrieve the top results.

Frequently Asked Questions about postgres-semantic-search

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

FAQPage Schema
How do I implement semantic search in PostgreSQL using pgvector?

Semantic search in PostgreSQL uses pgvector to compute vector embeddings and retrieve top results via SQL functions like match_documents. It combines vector similarity with keyword search inside a single database.

What is the best way to combine full text search with vector similarity in PostgreSQL?

Hybrid search combines full text search, BM25, and vector similarity using Reciprocal Rank Fusion (RRF). This approach merges keyword and semantic results within PostgreSQL for highly accurate retrieval.

Can I use ParadeDB as an Elasticsearch alternative for PostgreSQL search?

Yes, ParadeDB is supported as an Elasticsearch alternative directly inside PostgreSQL. It enables advanced full text search and BM25 scoring without requiring an external search engine infrastructure.

Does this PostgreSQL semantic search skill support re-ranking with Cohere or cross-encoders?

Yes, production-grade retrieval supports re-ranking with Cohere and cross-encoders. This improves search ranking accuracy by reordering initial vector and keyword results based on deeper semantic relevance.

How do I build chunk-based RAG workflows with PostgreSQL vector search?

Chunk-based RAG workflows use the match_chunks SQL function to retrieve relevant document segments. This supports vector(1536) and halfvec(3072) embeddings with HNSW or IVFFlat indexes for scalable retrieval.

What are the limitations of using IVFFlat versus HNSW indexes for pgvector?

HNSW indexes offer faster query speeds at higher memory costs, while IVFFlat provides better build speed and lower memory usage. Both are supported for vector(1536) and halfvec(3072) embeddings to balance scale and latency.