Skip to content
timescale avatar

Pgvector Semantic Search

Semantic search over pgvector with halfvec storage, HNSW tuning, and binary quantization for large datasets.

CCM score
71 of 100
skills.sh installs
1.1K
GitHub stars
1.9K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers the golden-path setup: halfvec storage, cosine distance, HNSW indexing, and query patterns for RAG and semantic search
  • Documents HNSW parameters (m, ef_construction, hnsw.ef_search) with an ef_search recall and speed tradeoff table
  • Enforces Core Rules such as HNSW by default, indexing after bulk loads, concurrent index creation, and matching query operators to index ops
  • Includes memory sizing guidance by RAM tier and when to switch to binary quantization with re-ranking

Install

$ npx -y skills add timescale/pg-aiguide --skill pgvector-semantic-search -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

pgvector for Semantic Search

Semantic search finds content by meaning rather than exact keywords. An embedding model converts text into high-dimensional vectors, where similar meanings map to nearby points. pgvector stores these vectors in PostgreSQL and uses approximate nearest neighbor (ANN) indexes to find the closest matches quickly—scaling to millions of rows without leaving the database. Store your text alongside its embedding, then query by converting your search text to a vector and returning the rows with the smallest distance.

This guide covers pgvector setup and tuning—not embedding model selection or text chunking, which significantly affect search quality. Requires pgvector 0.8.0+ for all features (halfvec, binary_quantize, iterative scan).

Golden Path (Default Setup)

Details

Repository
github.com/timescale/pg-aiguide
Categories
Databases, AI Agents & LLM Apps
First seen
Jun 3, 2026

More from timescale/pg-aiguide

All 8

Similar to Pgvector Semantic Search

More Databases