pgvector-semantic-search

Enables semantic search on PostgreSQL embeddings using pgvector.

Updated May 25, 2026
One-click install
npx skills add https://github.com/yehezkieldio/formalist --skill pgvector-semantic-search-yehezkieldio
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: pgvector-semantic-search
Source: https://github.com/yehezkieldio/formalist/tree/main/.agents/skills/pgvector-semantic-search
Command: npx skills add https://github.com/yehezkieldio/formalist --skill pgvector-semantic-search-yehezkieldio

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Semantic search over large text corpora by storing embeddings in PostgreSQL and performing nearest-neighbor retrieval with pgvector.

Core Features & Use Cases

  • Store and index vector embeddings in PostgreSQL using pgvector, enabling fast similarity search with ANN indexes such as HNSW.
  • Create and tune index types (HNSW, IVFFlat) and parameters (m, ef_construction, ef_search) for balanced recall and latency.
  • Support quantization strategies (halfvec, binary quantization) to scale to very large datasets and improve memory usage.
  • Enable applications like Retrieval-Augmented Generation (RAG), document search, and semantic retrieval across diverse datasets.

Quick Start

Index a set of texts by computing embeddings and query them by vector similarity using pgvector.

Frequently Asked Questions about pgvector-semantic-search

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

FAQPage Schema
How do I enable semantic search over vector embeddings stored in PostgreSQL?▼

To enable semantic search in PostgreSQL, you use the pgvector extension to store vector embeddings and build ANN indexes like HNSW or IVFFlat for fast nearest-neighbor similarity retrieval.

HNSW vs IVFFlat: which ANN index should I use for pgvector similarity search?▼

Both HNSW and IVFFlat indexes enable ANN search in pgvector, but HNSW generally offers better recall-latency trade-offs by tuning parameters like m and ef_construction, while IVFFlat is often faster to build for large datasets.

Does pgvector support binary quantization to scale semantic search for large datasets?▼

Yes, pgvector supports optional binary quantization and halfvec storage formats, which reduce memory usage and allow semantic search to scale efficiently across very large text corpora.

Can I build a Retrieval-Augmented Generation pipeline using PostgreSQL for document retrieval?▼

Yes, you can build RAG pipelines using PostgreSQL by storing text embeddings in pgvector and performing cosine distance nearest-neighbor retrieval to fetch meaning-aligned documents for generation.

What PostgreSQL version is required to use the pgvector extension for semantic search?▼

Using pgvector for semantic search requires PostgreSQL 15 or higher, ensuring compatibility with the extension's halfvec storage format, HNSW indexing, and cosine distance operations.

How do I tune HNSW index parameters in pgvector for balanced semantic search recall?▼

You tune HNSW index parameters in pgvector by adjusting m and ef_construction during index creation, and ef_search during queries, to balance the recall accuracy and latency of semantic vector retrieval.