Skip to content
ai-supply.store
DiscoverCategoriesLeaderboardsCommunityAgent APIFAQ
PublishSign in
catalog / Data & ETL / pgvector
⇄ConnectorData & ETLFree

pgvector

Open-source vector similarity search for PostgreSQL — store and query embeddings directly in your Postgres DB.

@ai-supply
Installs310k
Rating★ 4.8
Reviews103
↗ Source repository

pgvector

pgvector is an open-source PostgreSQL extension for vector similarity search. It adds a vector data type and operators to Postgres, letting you store embedding vectors alongside relational data and search them with exact or approximate nearest-neighbor queries — no separate vector database required.

Key Features

  • Native Postgres: use SQL, JOIN with relational data, leverage existing Postgres tooling
  • Exact and approximate search: exact KNN and IVFFlat/HNSW approximate indexes
  • Distance metrics: L2, inner product, cosine, L1, Hamming, Jaccard
  • Sparse vector support (svector) for BM25-style retrieval
  • Half-precision vectors (halfvec) to cut storage by 2×
  • Works with any ORM that supports Postgres: SQLAlchemy, Django, ActiveRecord

Quick Start

CREATE EXTENSION vector;

CREATE TABLE embeddings (
  id SERIAL PRIMARY KEY,
  content TEXT,
  embedding vector(1536)
);

CREATE INDEX ON embeddings USING hnsw (embedding vector_cosine_ops);

-- Nearest neighbor search
SELECT content, 1 - (embedding <=> '[0.1,0.2,...]') AS similarity
FROM embeddings
ORDER BY embedding <=> '[0.1,0.2,...]'
LIMIT 5;
from pgvector.sqlalchemy import Vector
# Works with SQLAlchemy, Django, and psycopg2/psycopg3

Install via ai-supply

npx ai-supply add pgvector-postgres-embeddings

Curated mirror of the open-source pgvector (PostgreSQL License). Get it from the source.

More from @ai-supply

View profile →
◐Model
llama.cpp
Pure C/C++ LLM inference library — run quantized models on CPU, Metal, CUDA and more.
↓ 900k★ 4.9
⇄Connector
vLLM
High-throughput, memory-efficient LLM inference engine with PagedAttention and continuous batching.
↓ 820k★ 4.9
⠿Embedding
Sentence Transformers
State-of-the-art sentence and text embeddings — compute semantic similarity, clustering, and dense retrieval.
↓ 750k★ 4.9
⬡Pipeline
Diffusers
Hugging Face's state-of-the-art library for diffusion-based image, video, and audio generation models.
↓ 750k★ 4.9
ai-supply.store

The marketplace for AI capabilities. Skills, MCPs, plugins, agents, datasets — discoverable by humans, consumable by machines.

api · v3.1status · all green
Marketplace
  • Discover
  • Categories
  • Leaderboards
  • Benchmarks
Community
  • Community
  • FAQ
For agents
  • Quickstart (60s)
  • Authorize an agent
  • Agent API
  • OpenAPI spec
For builders
  • Publish
  • Dashboard
  • Revenue share
Account
  • Sign in
  • Settings
Legal
  • Terms
  • Publisher Agreement
  • Acceptable Use
  • Privacy