Skip to content
pgstyPublic

About

Scalable, fast, and disk-friendly vector search in Postgres, the successor of pgvecto.rs. VectorChord fork by PGSTY

Topics

Resources

Stars

15 stars

Watchers

0 watching

Forks

Repository files navigation

vchord

Website: vchord.pgsty.com Docs: vchord Catalog: vchord Version: v1.4.0 License: AGPL-3.0 GitHub Stars PostgreSQL: 15-19

Disk-friendly vector similarity search for PostgreSQL 15–19, built on pgvector.

Documentation · Releases · Issues

Features

  • vchordrq: IVF/RaBitQ indexing for large datasets, with filtering, reranking, external builds, and recall evaluation.
  • vchordg: graph indexing for low-latency vector search.
  • L2, inner-product, cosine, range search, and multi-vector MaxSim operators.
  • vector, halfvec, and quantized rabitq4 / rabitq8 types.

ANN routing can trade small distance errors for speed. On ARM CPUs with FP16 and on x86 CPUs with AVX-512 FP16, halfvec L2 centroid selection and graph pruning round differences to f16 and accumulate in f32, retrying in f32 if a difference overflows. Final reranking, sphere predicates, and the residual-quantization lower bounds that decide reranking order keep f32 differences and accumulation. Tune probes and search breadth against recall on your own data.

Combine with vchord_bm25 and pg_tokenizer for hybrid vector and full-text search.

Installation

Install from the Pigsty package repository:

pig repo add pgsql -u
pig ext add vchord

Packages and source archives are also available from GitHub Releases. See the installation guide for platform details.

Add vchord to shared_preload_libraries, restart PostgreSQL, and enable the extension:

CREATE EXTENSION IF NOT EXISTS vchord CASCADE;

Usage

CREATE TABLE items (id bigserial PRIMARY KEY, embedding vector(3));

INSERT INTO items (embedding)
SELECT ARRAY[random(), random(), random()]::real[]
FROM generate_series(1, 1000);

CREATE INDEX ON items USING vchordrq (embedding vector_l2_ops);

SELECT * FROM items ORDER BY embedding <-> '[3, 1, 2]' LIMIT 5;

Use USING vchordg for a graph index. See indexing, graph search, and parameter tuning for configuration.

Build from Source

Requires Rust 1.99.1+, PostgreSQL development headers, pgvector, GNU Make, and matching Clang, libclang, and LLVM tools. The project uses pgrx 0.20.0.

git clone https://github.com/pgsty/vchord.git
cd vchord
PG_CONFIG=/path/to/pg_config make build
sudo make PG_CONFIG=/path/to/pg_config install

Set CLANG_PATH and LIBCLANG_PATH if multiple LLVM versions are installed. For Clang installations that load a default configuration file, set CLANG_NO_DEFAULT_CONFIG=1.

Upgrading

Install the new library and SQL files, restart PostgreSQL, then run in each database:

ALTER EXTENSION vchord UPDATE;

See release notes for migration requirements.

Testing

cargo test --locked --workspace --exclude vchord
PG_CONFIG=/path/to/pg_config make clippy
sqllogictest --db "$USER" --user "$USER" './tests/general/*.slt' './tests/vchordg/*.slt' './tests/vchordrq/*.slt'

The SQL tests require a running PostgreSQL instance with the extension installed. CI covers supported PostgreSQL versions and platforms; additional recovery checks are documented in devtools/README.md.

License

GNU Affero General Public License v3.0.

Copyright (c) 2025–2026 TensorChord Inc. and 2026 PGSTY PTE. LTD. Maintained by Ruohang Feng at PGSTY.

About

Scalable, fast, and disk-friendly vector search in Postgres, the successor of pgvecto.rs. VectorChord fork by PGSTY

Topics

Resources

Stars

15 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages