Analytics cookies only (Google Analytics, PostHog). No ad networks, no cross-site tracking. See our privacy policy.
An open-source extension that adds vector similarity search to PostgreSQL, so embeddings live in ordinary tables next to the rest of your data. It stores single-precision, half-precision, binary and sparse vectors, supports exact and approximate (HNSW and IVFFlat) nearest-neighbor search with L2, inner product, cosine, L1, Hamming and Jaccard distances, and inherits Postgres features such as ACID transactions, JOINs and point-in-time recovery. It is not a separate server: any Postgres client library can query it.
Runs on a VPS from $6/mo (Kamatera 2GB, 2 GB RAM) · prices checked Nov 2026
Fits home hardware (30 MB measured idle, RAM only): Raspberry Pi 4 (4 GB) (arm64 untested), Raspberry Pi 5 (8 GB) (arm64 untested), Repurposed laptop (8 GB), Intel N100 mini PC (16 GB), AMD Ryzen mini PC (32 GB).
Pick pgvector when you already run PostgreSQL, or want embeddings stored next to your relational data with ACID transactions, JOINs and point-in-time recovery, instead of operating a separate vector server. It is a Postgres extension rather than a service: you run `CREATE EXTENSION vector`, add a `vector` column, and query it with SQL through any Postgres client. It supports single-precision, half-precision, binary and sparse vectors, exact and approximate (HNSW and IVFFlat) nearest-neighbor search, and L2, inner-product, cosine, L1, Hamming and Jaccard distances. The licence is the PostgreSQL License: the LICENSE file at v0.8.7 carries the PostgreSQL Global Development Group notice and `META.json` lists `PostgreSQL`, although GitHub's detector shows it as unrecognised. Our snippet runs `pgvector/pgvector:0.8.7-pg18-trixie` (tag v0.8.7, commit dated 2026-10-01; the project publishes tags but no GitHub releases) on Postgres 18, with a generated password and a health check, then enables the extension and runs the README's Getting Started queries. The README gives no RAM minimum, so our 512 MB floor is an estimate for an idle Postgres; index builds need more, see the caveats. In this catalog, Qdrant, Weaviate, Chroma and Milvus are standalone vector servers with their own APIs, and Milvus's standalone mode also needs etcd and MinIO. pgvector has none of that extra service to run, in exchange for being a single Postgres instance that you scale like Postgres.
Paid link — we earn a commission if you shop through it.
Run these commands on your server:
# pgvector - vector search inside PostgreSQL - adapted from the project's Docker instructions (pgvector/pgvector image on Postgres 18, generated password, health check), pinned to 0.8.7
echo "POSTGRES_PASSWORD=$(openssl rand -hex 16)" > .env
cat > docker-compose.yml <<'EOF'
services:
db:
image: pgvector/pgvector:0.8.7-pg18-trixie
restart: unless-stopped
ports:
- "5432:5432"
environment:
POSTGRES_USER: vector
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: vector
volumes:
- pgdata:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -h 127.0.0.1 -U vector -d vector"]
interval: 5s
timeout: 5s
retries: 20
volumes:
pgdata:
EOF
docker compose up -d
timeout 300 bash -c 'until docker compose exec -T db pg_isready -h 127.0.0.1 -U vector -d vector; do sleep 3; done'
# Enable the extension, then store and query three-dimensional vectors (the Getting Started example from the README)
docker compose exec -T db psql -U vector -d vector -c "CREATE EXTENSION IF NOT EXISTS vector;"
docker compose exec -T db psql -U vector -d vector -c "CREATE TABLE items (id bigserial PRIMARY KEY, embedding vector(3));"
docker compose exec -T db psql -U vector -d vector -c "INSERT INTO items (embedding) VALUES ('[1,2,3]'), ('[4,5,6]');"
docker compose exec -T db psql -U vector -d vector -c "SELECT id, embedding FROM items ORDER BY embedding <-> '[3,1,2]' LIMIT 5;"
docker compose exec -T db psql -U vector -d vector -c "SELECT extversion FROM pg_extension WHERE extname = 'vector';"
# → postgres://SERVER_IP:5432 (user vector, database vector, password in .env; the port is open to anyone who can reach it, so firewall it or change the mapping to 127.0.0.1:5432:5432 before real use)pgvector's README and the Postgres Docker image documentation flag these before you rely on it:
pgvector used 30 MB of RAM at idle on GCP e2-standard-2 · Ubuntu 26.04 LTS · Docker 29.9.3 (first boot, measured Nov 2026). We list a minimum of 512 MB.
The pgvector install snippet is marked verified on Ubuntu 26.04 (Nov 2026).