Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
8942ded
Initial commit of svs integration into pgvector engine
asonje Feb 5, 2026
f048826
- Changed graph_max_degree parameter to graph_degree
asonje Feb 12, 2026
6a2dd21
- Fixed parameters for maintenance work mem
asonje Feb 19, 2026
b7c4be2
-Adds normalization for cosine datasets
asonje Feb 20, 2026
9183ec8
- Sets metric to l2 if --normalize-cosine flag is true
asonje Feb 20, 2026
7ffed55
Fixes alpha type from float to int
asonje Feb 20, 2026
b8bd163
Adds normalize cosine feature and flag to hnsw as with svs
asonje Mar 3, 2026
2778ae4
- Adds 'use_search_history' parameter
asonje Mar 3, 2026
849c1e6
- Updates pgvector backend to load svs extension
asonje Aug 11, 2026
f96b1fa
Fix SVS extension integration for standalone svs extension
asonje Aug 11, 2026
c71b9e0
Forward quantization params to SVS and reject unsupported combos
asonje Nov 3, 2026
d28d6c1
Document SVS GUC encodings in CLI help and align flag naming
asonje Nov 3, 2026
776e1c4
Extract SVS into a standalone PgSVS engine
asonje Nov 3, 2026
609c8d3
Validate SVS GUC values against what the extension actually accepts
asonje Nov 3, 2026
f2eb683
Fix PgSVS compatibility with vectordbbench's current upstream base
asonje Nov 6, 2026
b1acf50
Fix halfvec table storage insert: wrap arrays in pgvector's HalfVector
asonje Nov 6, 2026
eb2089c
Document pgsvs in the extras install table
asonje Nov 18, 2026
e2a02b3
Add Streamlit UI config for PgSVS
asonje Nov 18, 2026
9ccf5f4
Fix PgSVS UI crash: missing required fields and asymmetric case-confi…
asonje Nov 19, 2026
f00f16c
Fix PgSVS concurrency: declare thread_safe and copy_for_thread
asonje Nov 19, 2026
b16b766
Remove dead and misleading PgSVS reranking/search-history surface
asonje Nov 19, 2026
7b6c495
Drop stale setuptools_scm fallback_version
asonje Nov 19, 2026
0a88de2
Remove dead reranking and bit-quantization code from PgSVS
asonje Nov 19, 2026
38491a9
Revert pgvector client changes out of this PR
asonje Nov 19, 2026
17983f6
Restore upstream's pgvector sample result files
asonje Nov 19, 2026
444c77a
Stop logging the plaintext password in PgSVS startup messages
asonje Nov 24, 2026
566333b
Scope the vamana index name to its table
asonje Nov 24, 2026
94362cc
Reject search_window_size values too small for the requested k
asonje Nov 24, 2026
889fb32
Stop persisting index-build settings onto the connection role
asonje Nov 24, 2026
ea66aa6
Validate compression_primary/secondary as a pair, not independently
asonje Nov 24, 2026
57cf093
Validate a reused index matches this run's config
asonje Nov 24, 2026
d500a31
Add a dedicated offline test file for PgSVS
asonje Nov 25, 2026
bedccbf
Reformat with black 26 to fix CI's lint check
asonje Nov 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ All the database client supported
| pinecone | `pip install vectordb-bench[pinecone]` |
| weaviate | `pip install vectordb-bench[weaviate]` |
| elastic, aliyun_elasticsearch| `pip install vectordb-bench[elastic]` |
| pgvector, pgvectorscale, pgdiskann, alloydb, vectorchord, lakebase_vector | `pip install vectordb-bench[pgvector]` |
| pgvector, pgvectorscale, pgdiskann, alloydb, vectorchord, lakebase_vector, pgsvs | `pip install vectordb-bench[pgvector]` |
| pgvecto.rs | `pip install vectordb-bench[pgvecto_rs]` |
| redis | `pip install vectordb-bench[redis]` |
| valkey | `pip install vectordb-bench[valkey]` |
Expand Down
599 changes: 599 additions & 0 deletions tests/test_pgsvs.py

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions vectordb_bench/backend/clients/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class DB(Enum):
PgVectoRS = "PgVectoRS"
PgVectorScale = "PgVectorScale"
PgDiskANN = "PgDiskANN"
PgSVS = "PgSVS"
AlloyDB = "AlloyDB"
LakebaseVector = "LakebaseVector"
Redis = "Redis"
Expand Down Expand Up @@ -145,6 +146,11 @@ def init_cls(self) -> type[VectorDB]: # noqa: PLR0911, PLR0912, C901, PLR0915

return PgDiskANN

if self == DB.PgSVS:
from .pgsvs.pgsvs import PgSVS

return PgSVS

if self == DB.Redis:
from .redis.redis import Redis

Expand Down Expand Up @@ -398,6 +404,11 @@ def config_cls(self) -> type[DBConfig]: # noqa: PLR0911, PLR0912, C901, PLR0915

return PgDiskANNConfig

if self == DB.PgSVS:
from .pgsvs.config import PgSVSConfig

return PgSVSConfig

if self == DB.Redis:
from .redis.config import RedisConfig

Expand Down Expand Up @@ -674,6 +685,11 @@ def case_config_cls( # noqa: C901, PLR0911, PLR0912, PLR0915

return _pgdiskann_case_config.get(index_type)

if self == DB.PgSVS:
from .pgsvs.config import _pgsvs_case_config

return _pgsvs_case_config.get(index_type)

if self == DB.AlloyDB:
from .alloydb.config import _alloydb_case_config

Expand Down
1 change: 1 addition & 0 deletions vectordb_bench/backend/clients/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class IndexType(StrEnum):
IVF_HNSW_PQ = "IVF_HNSW_PQ"
BTREE = "BTREE"
NONE = "NONE"
PGSVS_VAMANA = "vamana"


class SQType(StrEnum):
Expand Down
128 changes: 128 additions & 0 deletions vectordb_bench/backend/clients/pgsvs/cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
import os
from typing import Annotated, Unpack

import click
from pydantic import SecretStr, ValidationError

from vectordb_bench.backend.clients import DB

from ....cli.cli import (
CommonTypedDict,
SVSBaseTypedDict,
cli,
click_parameter_decorators_from_typed_dict,
get_custom_case_config,
run,
)


class PgSVSTypedDict(CommonTypedDict, SVSBaseTypedDict):
user_name: Annotated[
str,
click.option("--user-name", type=str, help="Db username", required=True),
]
password: Annotated[
str,
click.option(
"--password",
type=str,
help="Postgres database password",
default=lambda: os.environ.get("POSTGRES_PASSWORD", ""),
show_default="$POSTGRES_PASSWORD",
),
]

host: Annotated[str, click.option("--host", type=str, help="Db host", required=True)]
port: Annotated[
int,
click.option(
"--port",
type=int,
help="Postgres database port",
default=5432,
show_default=True,
required=False,
),
]
db_name: Annotated[str, click.option("--db-name", type=str, help="Db name", required=True)]
maintenance_work_mem: Annotated[
str | None,
click.option(
"--maintenance-work-mem",
type=str,
help="Sets the maximum memory to be used for maintenance operations (index creation). "
"Can be entered as string with unit like '64GB' or as an integer number of KB."
"This will set the parameters: max_parallel_maintenance_workers,"
" max_parallel_workers & table(parallel_workers)",
required=False,
),
]
max_parallel_workers: Annotated[
int | None,
click.option(
"--max-parallel-workers",
type=int,
help="Sets the maximum number of parallel processes per maintenance operation (index creation)",
required=False,
),
]
quantization_type: Annotated[
str | None,
click.option(
"--quantization-type",
type=click.Choice(["none", "halfvec"]),
help="quantization type for vectors (in index)",
required=False,
),
]
table_quantization_type: Annotated[
str | None,
click.option(
"--table-quantization-type",
type=click.Choice(["none", "halfvec"]),
help="quantization type for vectors (in table)",
required=False,
),
]


@cli.command()
@click_parameter_decorators_from_typed_dict(PgSVSTypedDict)
def PgSVS(
**parameters: Unpack[PgSVSTypedDict],
):
from .config import PgSVSConfig, PgSVSVamanaConfig

parameters["custom_case"] = get_custom_case_config(parameters)
try:
case_config = PgSVSVamanaConfig(
graph_degree=parameters["graph_degree"],
alpha=parameters["alpha"],
search_window_size=parameters["search_window_size"],
use_search_history=parameters["use_search_history"],
build_window_size=parameters["build_window_size"],
leanvec_dims=parameters["leanvec_dims"],
compression_type=parameters["compression_type"],
compression_primary=parameters["compression_primary"],
compression_secondary=parameters["compression_secondary"],
maintenance_work_mem=parameters["maintenance_work_mem"],
max_parallel_workers=parameters["max_parallel_workers"],
normalize_cosine=parameters["normalize_cosine"],
quantization_type=parameters["quantization_type"],
table_quantization_type=parameters["table_quantization_type"],
)
except ValidationError as e:
raise click.UsageError(str(e)) from e
run(
db=DB.PgSVS,
db_config=PgSVSConfig(
db_label=parameters["db_label"],
user_name=SecretStr(parameters["user_name"]),
password=SecretStr(parameters["password"]),
host=parameters["host"],
port=parameters["port"],
db_name=parameters["db_name"],
),
db_case_config=case_config,
**parameters,
)
Loading
Loading